Examples of ApplicationMetadata


Examples of org.apache.aries.application.ApplicationMetadata

  {
    ApplicationMetadataFactoryImpl manager = new ApplicationMetadataFactoryImpl();
   
    InputStream in = getClass().getClassLoader().getResourceAsStream("META-INF/APPLICATION2.MF");
   
    ApplicationMetadata am = manager.parseApplicationMetadata(in);
    assertNotNull(am);

    assertEquals(am.getApplicationName(),appName);

    //"com.travel.reservation.web;version=\"[1.1.0,1.2.0)\",com.travel.reservation.business",
    List<Content> contents = am.getApplicationContents();
    for (Content content : contents){
      if ("com.travel.reservation.web".equals(content.getContentName())){
        VersionRange vr = content.getVersion();
        assertEquals(vr.getMinimumVersion(),new Version("1.1.0"));
        assertEquals(vr.getMaximumVersion(),new Version("1.2.0"));
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

  {
    ApplicationMetadataFactoryImpl manager = new ApplicationMetadataFactoryImpl();
   
    InputStream in = getClass().getClassLoader().getResourceAsStream("META-INF/APPLICATION3.MF");
   
    ApplicationMetadata am = manager.parseApplicationMetadata(in);
    assertNotNull(am);

    assertEquals("Wrong number of bundles are in the application", 1, am.getApplicationContents().size());
    assertEquals("Wrong bundle name", "org.apache.aries.applications.test.bundle", am.getApplicationContents().get(0).getContentName());
  }
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

{
  @Test
  public void testBasicMetadataCreation() throws IOException
  {
    ApplicationMetadataFactory manager = new ApplicationMetadataFactoryImpl();
    ApplicationMetadata app = manager.parseApplicationMetadata(getClass().getResourceAsStream("/META-INF/APPLICATION.MF"));
   
    Assert.assertEquals("Travel Reservation", app.getApplicationName());
  }
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

  }
  @Test
  public void testMetadataCreation() throws Exception
  {
    ApplicationMetadataFactory manager = new ApplicationMetadataFactoryImpl();
    ApplicationMetadata app = manager.parseApplicationMetadata(getClass().getResourceAsStream("/META-INF/APPLICATION4.MF"));
    assertEquals("Travel Reservation", app.getApplicationName());
    assertEquals("com.travel.reservation", app.getApplicationSymbolicName());
    assertEquals(Version.parseVersion("1.2.0"), app.getApplicationVersion());
    List<Content> appContents = app.getApplicationContents();
    assertEquals(2, appContents.size());
    Content appContent1 = new ContentImpl("com.travel.reservation.business");
    Map<String, String> attrs = new HashMap<String, String>();
    attrs.put("version", "\"[1.1.0,1.2.0)\"");
    Content appContent2 = new ContentImpl("com.travel.reservation.web", attrs);
    assertTrue(appContents.contains(appContent2));
    assertTrue(appContents.contains(appContent1));
    List<ServiceDeclaration> importedService = app.getApplicationImportServices();
    assertEquals(2, importedService.size());
    assertTrue(importedService.contains(new ServiceDeclarationImpl("com.travel.flight.api")));
    assertTrue(importedService.contains(new ServiceDeclarationImpl("com.travel.rail.api")));
    List<ServiceDeclaration> exportedService = app.getApplicationExportServices();
    assertTrue(exportedService.contains(new ServiceDeclarationImpl("com.travel.reservation")));
   
   
  }
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

            String appContent = buildAppContent(bundleInfos);
            applicationMF.getMainAttributes().put(APPLICATION_CONTENT_NAME, appContent);
        }
       
        ManifestDefaultsInjector.updateManifest(applicationMF, ebaFile.getName(), ebaFile);
        ApplicationMetadata applicationMetadata = getApplicationMetadataFactory().createApplicationMetadata(applicationMF);
       
        DeploymentMetadata deploymentMetadata = readDeploymentManifest(ebaJarFile);
       
        return new GeronimoApplication(applicationMetadata,  deploymentMetadata, bundleInfos);
    }
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

    public GeronimoApplication loadApplication(JarFile ebaJarFile) throws IOException, ManagementException {
        return (GeronimoApplication) createApplication(ebaJarFile);
    }
   
    public GeronimoApplication loadApplication(Bundle bundle) throws IOException, ManagementException {
        ApplicationMetadata applicationMetadata = null;
        URL applicationMF = bundle.getEntry(AppConstants.APPLICATION_MF);
        InputStream applicationMFStream = null;
        try {
            applicationMFStream = applicationMF.openStream();
            applicationMetadata = getApplicationMetadataFactory().parseApplicationMetadata(applicationMFStream);
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

       
        if (dummyAppContent) {
            applicationMF.getMainAttributes().remove(APPLICATION_CONTENT_NAME);
        }
       
        ApplicationMetadata applicationMetadata = getApplicationMetadataFactory().createApplicationMetadata(applicationMF);
        return applicationMetadata;
    }
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

    public Set<BundleInfo> resolve(AriesApplication app, ResolveConstraint... constraints) throws ResolverException {
        log.trace("resolving {}", app);
        DataModelHelper helper = repositoryAdmin.getHelper();

        ApplicationMetadata appMeta = app.getApplicationMetadata();

        String appName = appMeta.getApplicationSymbolicName();
        Version appVersion = appMeta.getApplicationVersion();
        List<Content> appContent = appMeta.getApplicationContents();

        Repository appRepo;

        try {
            Document doc = RepositoryDescriptorGenerator.generateRepositoryDescriptor(appName + "_" + appVersion, app
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

    public Artifact getConfigurationID(Object plan,
                                       JarFile jarFile,
                                       ModuleIDBuilder idBuilder)
        throws IOException, DeploymentException {
        GeronimoApplicationManager appManager = installer.getGeronimoApplicationManager();
        ApplicationMetadata metadata;
        try {
            metadata = appManager.getApplicationMetadata(jarFile);
        } catch (ManagementException e) {
            throw new DeploymentException("Error getting Aries Application manifest", e);
        }
View Full Code Here

Examples of org.apache.aries.application.ApplicationMetadata

    protected void storeApplication(AriesApplication app, File directory) throws IOException {
        storeApplication(app, directory, getUnpackApplicationBundles());
    }
   
    protected void storeApplication(AriesApplication app, File directory, boolean unpack) throws IOException {
        ApplicationMetadata appMetadata = app.getApplicationMetadata();
        appMetadata.store(new File(directory, AppConstants.APPLICATION_MF));

        DeploymentMetadata deploymentMetadata = app.getDeploymentMetadata();
        if (deploymentMetadata != null) {
            deploymentMetadata.store(new File(directory, AppConstants.DEPLOYMENT_MF));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.