Package org.apache.aries.application.management

Examples of org.apache.aries.application.management.AriesApplicationContext


  @Test
  public void testAppWithoutApplicationManifest() throws Exception {
   
    AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
    AriesApplicationContext ctx = manager.install(app);
   
    ctx.start();
    assertHelloWorldService("test.eba");
   
    manager.uninstall(ctx);
  }
View Full Code Here


  @Test
  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);
  }
View Full Code Here

  @Test
  public void testUninstallReinstall() throws Exception {
   
    AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
    AriesApplicationContext ctx = manager.install(app);
   
    app = ctx.getApplication();

    ctx.start();

    assertHelloWorldService("org.apache.aries.sample2");

    ctx.stop();
    manager.uninstall(ctx);
   
    assertNull(IsolationTestUtils.findIsolatedAppBundleContext(bundleContext, "org.apache.aries.sample2"));

    ctx = manager.install(app);
    ctx.start();

    assertHelloWorldService("org.apache.aries.sample2");
   
    manager.uninstall(ctx);
  }
View Full Code Here

  @Test
  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);
  }
View Full Code Here

  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);
 
View Full Code Here

        }
    });
     
    AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
    AriesApplicationContext ctx = manager.install(app);     
   
    try {
        ctx.start();
       
        app = ctx.getApplication();
        assertEquals(1, app.getDeploymentMetadata().getApplicationDeploymentContents().size());
        assertEquals(1, app.getDeploymentMetadata().getApplicationProvisionBundles().size());
        assertTrue(loadedClass.get());
    } finally {
        manager.uninstall(ctx);
View Full Code Here

   
    private Context installApplication(IDirectory application, String applicationName) throws Exception {
        //install the application and start it
        AriesApplicationManager appManager = context().getService(AriesApplicationManager.class);
        AriesApplication app = appManager.createApplication(application);
        AriesApplicationContext appCtx = appManager.install(app);
        appCtx.start();

        return new Context(appCtx, IsolationTestUtils.findIsolatedAppBundleContext(context(), applicationName));
    }
View Full Code Here

   
    assertTrue("package javax.naming not found", packages.contains("javax.naming"));
    assertTrue("package p.q.r not found", packages.contains("p.q.r"));
    assertTrue("package x.y.z not found", packages.contains("x.y.z"));
    assertTrue("package a.b.c not found", packages.contains("a.b.c"));
    AriesApplicationContext ctx = manager.install(app);
    ctx.start();

    Set<Bundle> bundles = ctx.getApplicationContent();
   
    assertEquals("Number of bundles provisioned in the app", 5, bundles.size());
   
    ctx.stop();
    manager.uninstall(ctx);
   
  }
View Full Code Here

   
    repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());

    AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("hello.eba")));
    AriesApplicationContext ctx = manager.install(app);
    ctx.start();
   
    // Wait 5 seconds just to give the blueprint-managed beans a chance to come up
    try {
      Thread.sleep(5000);
    } catch (InterruptedException ix) {}
   
    HelloWorld hw = context().getService(HelloWorld.class);
    String result = hw.getMessage();
    assertEquals (result, "hello world");
   
   
    // Uncomment the block below after https://issues.apache.org/jira/browse/FELIX-2546,
    // "Only one service is provisioned even when specifying for mulitple services"
    // is fixed. This tracks the problem of provisioning only one service even when we
    // specify multiple services.
    
     /** HelloWorldManager hwm = context().getService(HelloWorldManager.class);
     * int numberOfServices = hwm.getNumOfHelloServices();
     * assertEquals(2, numberOfServices);
     */
    ctx.stop();
    manager.uninstall(ctx);
  
  }
View Full Code Here

    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);
  }
View Full Code Here

TOP

Related Classes of org.apache.aries.application.management.AriesApplicationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.