use of org.apache.karaf.features.management.FeaturesServiceMBean.REPOSITORY_URI in project karaf by apache.
the class JmxRepositoryTest method testJmxRepositoryCompositeData.
@Test
public void testJmxRepositoryCompositeData() throws Exception {
Features features = new Features();
features.setName("test-1.0.0");
features.getRepository().add("mvn:org.test/test-dependency/1.0.0/xml/features");
features.getFeature().add(new Feature("test-feature", "1.0.0"));
URI uri = new URI("mvn:org.test/test/1.0.0/xml/features");
Repository repository = new RepositoryImpl(uri, features, true);
JmxRepository jmxRepository = new JmxRepository(repository);
CompositeData compositeData = jmxRepository.asCompositeData();
assertEquals("test-1.0.0", compositeData.get(REPOSITORY_NAME));
assertEquals(uri.toString(), compositeData.get(REPOSITORY_URI));
assertTrue((Boolean) compositeData.get(REPOSITORY_BLACKLISTED));
String[] repositoryUris = (String[]) compositeData.get(REPOSITORY_REPOSITORIES);
assertEquals(1, repositoryUris.length);
assertEquals("mvn:org.test/test-dependency/1.0.0/xml/features", repositoryUris[0]);
TabularData repositoryFeatures = (TabularData) compositeData.get(REPOSITORY_FEATURES);
assertEquals(1, repositoryFeatures.size());
assertNotNull(repositoryFeatures.get(new Object[] { "test-feature", "1.0.0" }));
}
Aggregations