use of org.apache.aries.application.management.AriesApplicationManager in project aries by apache.
the class BasicNoOpResolverTest method testAppWithoutApplicationManifest.
@Test
public void testAppWithoutApplicationManifest() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
// application name should be equal to eba name since application.mf is not provided
assertEquals("test.eba", app.getApplicationMetadata().getApplicationName());
AriesApplicationContext ctx = manager.install(app);
ctx.start();
HelloWorld hw = context().getService(HelloWorld.class);
String result = hw.getMessage();
assertEquals(result, "hello world");
ctx.stop();
manager.uninstall(ctx);
}
use of org.apache.aries.application.management.AriesApplicationManager in project aries by apache.
the class BasicNoOpResolverTest method testAppWithApplicationManifest.
@Test
public void testAppWithApplicationManifest() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
// application name should equal to whatever Application name provided in the application.mf
assertEquals("test application 2", app.getApplicationMetadata().getApplicationName());
AriesApplicationContext ctx = manager.install(app);
ctx.start();
HelloWorld hw = context().getService(HelloWorld.class);
String result = hw.getMessage();
assertEquals(result, "hello world");
ctx.stop();
manager.uninstall(ctx);
}
use of org.apache.aries.application.management.AriesApplicationManager in project aries by apache.
the class UpdateAppTest method testFineUpdate.
@Test
@Ignore
public void testFineUpdate() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = setupApp();
BundleContext oldCtx = IsolationTestUtils.findIsolatedAppBundleContext(bundleContext, SAMPLE_APP_NAME);
installMockUpdateStrategy();
updateApp(manager, app);
BundleContext newCtx = IsolationTestUtils.findIsolatedAppBundleContext(bundleContext, SAMPLE_APP_NAME);
assertAppMessage("hello brave new world");
assertTrue("We bounced the app where the update was supposed to do an update in place", oldCtx == newCtx);
}
use of org.apache.aries.application.management.AriesApplicationManager in project aries by apache.
the class UpdateAppTest method testUpdateThenStart.
@Test
@Ignore
public void testUpdateThenStart() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
AriesApplicationContext ctx = manager.install(app);
app = ctx.getApplication();
BundleContext oldCtx = IsolationTestUtils.findIsolatedAppBundleContext(bundleContext, SAMPLE_APP_NAME);
installMockUpdateStrategy();
ctx = updateApp(manager, app);
BundleContext newCtx = IsolationTestUtils.findIsolatedAppBundleContext(bundleContext, SAMPLE_APP_NAME);
assertNull("App is not started yet but HelloWorld service is already there", IsolationTestUtils.findHelloWorldService(bundleContext, SAMPLE_APP_NAME));
ctx.start();
assertAppMessage("hello brave new world");
assertTrue("We bounced the app where the update was supposed to do an update in place", oldCtx == newCtx);
}
use of org.apache.aries.application.management.AriesApplicationManager in project aries by apache.
the class UpdateAppTest method setupApp.
private AriesApplication setupApp() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
AriesApplicationContext ctx = manager.install(app);
app = ctx.getApplication();
ctx.start();
assertAppMessage("hello world");
return app;
}
Aggregations