System.setProperty("karaf.lock.delay","1000");
System.setProperty("karaf.lock.class","org.apache.karaf.main.MockLock");
Main main = new Main(args);
main.launch();
Framework framework = main.getFramework();
String activatorName = TimeoutShutdownActivator.class.getName().replace('.', '/') + ".class";
Bundle bundle = framework.getBundleContext().installBundle("foo",
TinyBundles.bundle()
.set( Constants.BUNDLE_ACTIVATOR, TimeoutShutdownActivator.class.getName() )
.add( activatorName, getClass().getClassLoader().getResourceAsStream( activatorName ) )
.build( withBnd() )
);
bundle.start();
Thread.sleep(2000);
FrameworkStartLevel sl = framework.adapt(FrameworkStartLevel.class);
MockLock lock = (MockLock) main.getLockManager().getLock();
Assert.assertEquals(100, sl.getStartLevel());