use of org.apache.aries.application.management.AriesApplication in project aries by apache.
the class BasicAppManagerTest 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.AriesApplication in project aries by apache.
the class IsolatedRuntimeTest method testAppWithGlobalRepositoryBundle.
@Test
@Ignore
public void testAppWithGlobalRepositoryBundle() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
IsolationTestUtils.prepareSampleBundleV2(bundleContext, context().getService(RepositoryGenerator.class), context().getService(RepositoryAdmin.class), context().getService(ModellingManager.class));
AriesApplication newApp = manager.resolve(app, new ResolveConstraint() {
@Override
public String getBundleName() {
return "org.apache.aries.isolated.sample";
}
@Override
public VersionRange getVersionRange() {
return ManifestHeaderProcessor.parseVersionRange("[2.0.0,2.0.0]", true);
}
});
AriesApplicationContext ctx = manager.install(newApp);
ctx.start();
assertHelloWorldService("org.apache.aries.sample2", "hello brave new world");
manager.uninstall(ctx);
}
use of org.apache.aries.application.management.AriesApplication in project aries by apache.
the class IsolatedRuntimeTest method testAppWithApplicationManifest.
@Test
@Ignore
public void testAppWithApplicationManifest() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
AriesApplicationContext ctx = manager.install(app);
ctx.start();
assertHelloWorldService("org.apache.aries.sample2");
manager.uninstall(ctx);
}
use of org.apache.aries.application.management.AriesApplication in project aries by apache.
the class IsolatedRuntimeTest method testAppWithFragment.
@Test
@Ignore
public void testAppWithFragment() throws Exception {
AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("withFragment.eba")));
AriesApplicationContext ctx = manager.install(app);
ctx.start();
assertHelloWorldService("withFragment.eba");
manager.uninstall(ctx);
}
use of org.apache.aries.application.management.AriesApplication in project aries by apache.
the class AbstractBlogIntegrationTest method installEba.
protected AriesApplicationContext installEba(MavenArtifactUrlReference eba) throws Exception {
AriesApplication app = manager.createApplication(new URL(eba.getURL()));
AriesApplicationContext ctx = manager.install(app);
ctx.start();
return ctx;
}
Aggregations