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 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 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 Aries1383Test method test10.
/*
* (10) Subsystem fails installation if the apache-aries-provision-dependencies
* directive has a value other than "install" or "resolve".
*/
@Test
public void test10() throws Exception {
Subsystem root = getRootSubsystem();
try {
Subsystem subsystem = installSubsystem(root, APPLICATION_INVALID_PROVISION_DEPENDENCIES, applicationInvalidProvisionDependencies(), false);
uninstallSubsystemSilently(subsystem);
fail("Subsystem should not have installed");
} catch (SubsystemException e) {
e.printStackTrace();
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1383Test method testFullLifeCycle.
@Test
public void testFullLifeCycle() throws Exception {
Subsystem root = getRootSubsystem();
Subsystem subsystem = installSubsystem(root, APPLICATION_EMPTY, applicationEmpty(), false);
startSubsystem(subsystem, false);
stopSubsystem(subsystem);
uninstallSubsystem(subsystem);
}
Aggregations