use of com.yahoo.jdisc.application.ApplicationNotReadyException in project vespa by vespa-engine.
the class ApplicationLoaderTestCase method requireThatApplicationStartExceptionUnsetsAndDestroysApplication.
@Test
public void requireThatApplicationStartExceptionUnsetsAndDestroysApplication() throws Exception {
MyApplication app = MyApplication.newStartException();
ApplicationLoader loader = new ApplicationLoader(new NonWorkingOsgiFramework(), Arrays.asList(new MyApplicationModule(app)));
loader.init(null, false);
try {
loader.start();
fail();
} catch (MyException e) {
}
assertNull(loader.application());
assertFalse(app.stop.await(100, TimeUnit.MILLISECONDS));
assertTrue(app.destroy.await(600, TimeUnit.SECONDS));
try {
loader.activateContainer(loader.newContainerBuilder());
fail();
} catch (ApplicationNotReadyException e) {
}
loader.stop();
loader.destroy();
}
Aggregations