for (Method method : testClass.getDeclaredMethods()) {
if (method.isAnnotationPresent(Deployment.class)) {
Deployment andep = method.getAnnotation(Deployment.class);
if (andep.managed() && andep.testable() && method.isAnnotationPresent(StartLevelAware.class)) {
StartLevelAware startLevelAware = method.getAnnotation(StartLevelAware.class);
int bundleStartLevel = startLevelAware.startLevel();
Bundle bundle = getBundle(testCase);
log.fine("Setting bundle start level of " + bundle + " to: " + bundleStartLevel);
BundleStartLevel startLevel = bundle.adapt(BundleStartLevel.class);
startLevel.setStartLevel(bundleStartLevel);
if (startLevelAware.autostart()) {