use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1408Test method testRequirementFromRemoteRepositoryConvertsToRequireCapability.
@Test
public void testRequirementFromRemoteRepositoryConvertsToRequireCapability() throws Exception {
Bundle bundleB = installBundleFromFile(BUNDLE_B);
try {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
uninstallSubsystemSilently(applicationA);
} catch (SubsystemException e) {
e.printStackTrace();
fail("Subsystem should have installed");
} finally {
uninstallSilently(bundleB);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1421Test method testRequireBundleVersionRanges.
@Test
public void testRequireBundleVersionRanges() throws Exception {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
try {
Bundle bundleA = getConstituentAsBundle(applicationA, BUNDLE_A, null, null);
String expectedStr = bundleA.getHeaders().get(Constants.REQUIRE_BUNDLE);
RequireBundleHeader expected = new RequireBundleHeader(expectedStr);
Map<String, String> headers = ((BasicSubsystem) applicationA).getDeploymentHeaders();
String actualStr = headers.get(Constants.REQUIRE_BUNDLE);
RequireBundleHeader actual = new RequireBundleHeader(actualStr);
assertEquals("Wrong header", expected, actual);
} finally {
uninstallSubsystemSilently(applicationA);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1421Test method testRequireCapability.
@Test
public void testRequireCapability() throws Exception {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
try {
Bundle bundleA = getConstituentAsBundle(applicationA, BUNDLE_A, null, null);
String expectedStr = bundleA.getHeaders().get(Constants.REQUIRE_CAPABILITY);
RequireCapabilityHeader expected = new RequireCapabilityHeader(expectedStr);
Map<String, String> headers = ((BasicSubsystem) applicationA).getDeploymentHeaders();
String actualStr = headers.get(Constants.REQUIRE_CAPABILITY);
RequireCapabilityHeader actual = new RequireCapabilityHeader(actualStr);
assertEquals("Wrong header", expected, actual);
} finally {
uninstallSubsystemSilently(applicationA);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1421Test method testSubsystemImportService.
@Test
public void testSubsystemImportService() throws Exception {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
try {
String expectedStr = "foo;resolution:=optional,bar;filter:=\"(a=b)\";resolution:=optional";
SubsystemImportServiceHeader expected = new SubsystemImportServiceHeader(expectedStr);
Map<String, String> headers = ((BasicSubsystem) applicationA).getDeploymentHeaders();
String actualStr = headers.get(SubsystemConstants.SUBSYSTEM_IMPORTSERVICE);
SubsystemImportServiceHeader actual = new SubsystemImportServiceHeader(actualStr);
assertEquals("Wrong header", expected, actual);
} finally {
uninstallSubsystemSilently(applicationA);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1425Test method testFragmentResolved.
@Test
public void testFragmentResolved() throws Exception {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
try {
applicationA.start();
try {
Bundle bundleA = getConstituentAsBundle(applicationA, BUNDLE_A, null, IdentityNamespace.TYPE_FRAGMENT);
assertBundleState(bundleA, Bundle.RESOLVED);
} finally {
stopSubsystemSilently(applicationA);
}
} finally {
uninstallSubsystemSilently(applicationA);
}
}
Aggregations