Search in sources :

Example 1 with ApplicationNotReadyException

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();
}
Also used : NonWorkingOsgiFramework(com.yahoo.jdisc.test.NonWorkingOsgiFramework) ApplicationNotReadyException(com.yahoo.jdisc.application.ApplicationNotReadyException) Test(org.junit.Test)

Aggregations

ApplicationNotReadyException (com.yahoo.jdisc.application.ApplicationNotReadyException)1 NonWorkingOsgiFramework (com.yahoo.jdisc.test.NonWorkingOsgiFramework)1 Test (org.junit.Test)1