use of com.yahoo.jdisc.test.TestDriver in project vespa by vespa-engine.
the class ServerRepositoryIntegrationTest method requireThatInstallFromBundleWorks.
@Test
public void requireThatInstallFromBundleWorks() throws Exception {
MyModule module = new MyModule();
TestDriver driver = TestDriver.newSimpleApplicationInstance(module);
BundleInstaller installer = new BundleInstaller(driver.osgiFramework());
Bundle bundle = installer.installAndStart("my-server-provider.jar").get(0);
ContainerBuilder builder = driver.newContainerBuilder();
builder.serverProviders().install(bundle, "com.yahoo.jdisc.bundle.MyServerProvider");
assertTrue(module.init.await(60, TimeUnit.SECONDS));
Iterator<ServerProvider> it = builder.serverProviders().iterator();
assertTrue(it.hasNext());
ServerProvider server = it.next();
assertNotNull(server);
server.start();
assertTrue(module.start.await(60, TimeUnit.SECONDS));
server.close();
assertTrue(module.close.await(60, TimeUnit.SECONDS));
server.release();
assertTrue(module.destroy.await(60, TimeUnit.SECONDS));
assertFalse(it.hasNext());
driver.close();
}
use of com.yahoo.jdisc.test.TestDriver in project vespa by vespa-engine.
the class ApplicationLoaderIntegrationTest method requireThatPrivilegedBundleCanBeLoadedPrivileged.
@Test
public void requireThatPrivilegedBundleCanBeLoadedPrivileged() throws Exception {
MyModule module = new MyModule();
TestDriver driver = TestDriver.newApplicationBundleInstance("app-b-priv.jar", true, module);
assertTrue(module.init.await(60, TimeUnit.SECONDS));
assertEquals("com.yahoo.jdisc.bundle.ApplicationB", driver.application().getClass().getName());
driver.close();
}
use of com.yahoo.jdisc.test.TestDriver in project vespa by vespa-engine.
the class ApplicationLoaderIntegrationTest method requireThatUnprivilegedBundleCanBeLoadedUnprivileged.
@Test
public void requireThatUnprivilegedBundleCanBeLoadedUnprivileged() throws Exception {
MyModule module = new MyModule();
TestDriver driver = TestDriver.newApplicationBundleInstance("app-a.jar", false, module);
assertTrue(module.init.await(60, TimeUnit.SECONDS));
assertEquals("com.yahoo.jdisc.bundle.ApplicationA", driver.application().getClass().getName());
driver.close();
}
use of com.yahoo.jdisc.test.TestDriver in project vespa by vespa-engine.
the class ApplicationLoaderIntegrationTest method requireThatUnprivilegedBundleCanBeLoadedPrivileged.
@Test
public void requireThatUnprivilegedBundleCanBeLoadedPrivileged() throws Exception {
MyModule module = new MyModule();
TestDriver driver = TestDriver.newApplicationBundleInstance("app-a.jar", true, module);
assertTrue(module.init.await(60, TimeUnit.SECONDS));
assertEquals("com.yahoo.jdisc.bundle.ApplicationA", driver.application().getClass().getName());
driver.close();
}
use of com.yahoo.jdisc.test.TestDriver in project vespa by vespa-engine.
the class ApplicationLoaderIntegrationTest method requireThatInstallBundleInstructionPropagatesPrivileges.
@Test
public void requireThatInstallBundleInstructionPropagatesPrivileges() throws Exception {
TestDriver driver = TestDriver.newApplicationBundleInstance("app-ej-priv.jar", true);
assertEquals("com.yahoo.jdisc.bundle.ApplicationE", driver.application().getClass().getName());
driver.close();
}
Aggregations