use of org.apache.aries.application.ApplicationMetadataFactory in project aries by apache.
the class ApplicationMetadataImplTest method testMetadataCreation.
@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")));
}
use of org.apache.aries.application.ApplicationMetadataFactory in project aries by apache.
the class ApplicationMetadataImplTest method testBasicMetadataCreation.
@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());
}
Aggregations