Package org.apache.aries.application.management

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


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


     
    }, new Hashtable<String, String>());   
  }
 
  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");   
   
View Full Code Here

            System.out.println(c.getName() + " : " + c.getProperties());
          }
        }
      }
     
      AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
      AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
      app = manager.resolve(app);
      //installing requires a valid url for the bundle in repository.xml.
      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

  }
 
  @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

  }

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

                ((CompositeBundle) b).getCompositeFramework().getBundleContext().addBundleListener(this);
            }
        }
    });
     
    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

        Assert.assertNotNull("Missing the HelloWorld service", helloWorldBluePrint);       
    }
   
    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

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.