Package org.apache.aries.application.management

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


      repositoryAdmin.removeRepository(repo.getURI());
    }
   
    repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());

    AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
    //installing requires a valid url for the bundle in repository.xml.
   
    app = manager.resolve(app);
   

 
  }
View Full Code Here


      repositoryAdmin.removeRepository(repo.getURI());
    }
   
    repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());

    AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
    //installing requires a valid url for the bundle in repository.xml.
   
    app = manager.resolve(app);
   
    DeploymentMetadata depMeta = app.getDeploymentMetadata();
   
    List<DeploymentContent> provision = depMeta.getApplicationProvisionBundles();
   
    assertEquals(provision.toString(), 3, provision.size());
   
    List<String> bundleSymbolicNames = new ArrayList<String>();
   
    for (DeploymentContent dep : provision) {
      bundleSymbolicNames.add(dep.getContentName());
    }
   
    assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_REFERENCE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_REFERENCE));
    assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_VALUE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_VALUE));
    assertTrue("Bundle " + BUNDLE_IN_FRAMEWORK + " not found.", bundleSymbolicNames.contains(BUNDLE_IN_FRAMEWORK));
   
    AriesApplicationContext ctx = manager.install(app);
    ctx.start();

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

    createdApplications = true;
  }
 
  @Test
  public void testFullUpdate() throws Exception {
    AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
    AriesApplication app = setupApp();
   
    updateApp(manager, app);

    assertAppMessage("hello brave new world");
View Full Code Here

    assertAppMessage("hello brave new world");
  }
 
  @Test
  public void testFineUpdate() throws Exception {
    AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
    AriesApplication app = setupApp();
   
    BundleContext oldCtx = IsolationTestUtils.findIsolatedAppBundleContext(bundleContext, SAMPLE_APP_NAME);
   
    installMockUpdateStrategy();
View Full Code Here

  }
 
  @Test
  public void testUpdateThenStart() throws Exception
  {
    AriesApplicationManager manager = getOsgiService(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();
View Full Code Here

     
    }, new Hashtable<String, String>());   
  }
 
  private AriesApplication setupApp() throws Exception {
    AriesApplicationManager manager = getOsgiService(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");   
   
View Full Code Here

  }
 
  @Test
  public void testAppWithoutApplicationManifest() throws Exception {
   
    AriesApplicationManager manager = getOsgiService(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 = getOsgiService(HelloWorld.class);
    String result = hw.getMessage();
    assertEquals (result, "hello world");
   
    ctx.stop();
    manager.uninstall(ctx);
  }
View Full Code Here

    manager.uninstall(ctx);
  }

  @Test
  public void testAppWithApplicationManifest() throws Exception {
    AriesApplicationManager manager = getOsgiService(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 = getOsgiService(HelloWorld.class);
    String result = hw.getMessage();
    assertEquals (result, "hello world");
   
    ctx.stop();
    manager.uninstall(ctx);
  }
View Full Code Here

      repositoryAdmin.removeRepository(repo.getURI());
    }
   
    repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());

    AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
    //installing requires a valid url for the bundle in repository.xml.
   
    app = manager.resolve(app);
  }
View Full Code Here

    }
   
    //add our generated repository.xml
    repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());

    AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
    //installing requires a valid url for the bundle in repository.xml.
   
    app = manager.resolve(app);
   
    DeploymentMetadata depMeta = app.getDeploymentMetadata();
   
    List<DeploymentContent> provision = depMeta.getApplicationProvisionBundles();
   
    assertEquals(provision.toString(), 3, provision.size());
   
    List<String> bundleSymbolicNames = new ArrayList<String>();
   
    for (DeploymentContent dep : provision) {
      bundleSymbolicNames.add(dep.getContentName());
    }
   
    assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_REFERENCE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_REFERENCE));
    assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_VALUE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_VALUE));
    assertTrue("Bundle " + BUNDLE_IN_FRAMEWORK + " not found.", bundleSymbolicNames.contains(BUNDLE_IN_FRAMEWORK));
   
    AriesApplicationContext ctx = manager.install(app);
    ctx.start();

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

TOP

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

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.