use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1383Test method test15b.
/*
* (15) Unscoped subsystem with a value of apache-aries-provision-dependencies
* that is different than the scoped parent fails installation.
*/
@Test
public void test15b() throws Exception {
Subsystem root = getRootSubsystem();
Subsystem application = installSubsystem(root, APPLICATION_PROVISION_DEPENDENCIES_INSTALL, applicationProvisionDependenciesInstall(), true);
try {
Subsystem feature = installSubsystem(application, FEATURE_PROVISION_DEPENDENCIES_RESOLVE, featureProvisionDependenciesResolve(), false);
uninstallSubsystemSilently(feature);
fail("Subsystem should not have installed");
} catch (SubsystemException e) {
e.printStackTrace();
} finally {
uninstallSubsystemSilently(application);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1423Test method testEmptyNonOsgiHeaders.
@Test
public void testEmptyNonOsgiHeaders() throws Exception {
try {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
uninstallSubsystemSilently(applicationA);
} catch (SubsystemException e) {
e.printStackTrace();
fail("Subsystem should have installed");
}
}
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);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1425Test method testDeployedContentHeader.
@Test
public void testDeployedContentHeader() throws Exception {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
try {
Map<String, String> headers = applicationA.getDeploymentHeaders();
String header = headers.get(SubsystemConstants.DEPLOYED_CONTENT);
DeployedContentHeader dch = new DeployedContentHeader(header);
boolean foundClause = false;
for (DeployedContentHeader.Clause clause : dch.getClauses()) {
if (BUNDLE_A.equals(clause.getSymbolicName())) {
assertEquals("Wrong type", IdentityNamespace.TYPE_FRAGMENT, clause.getType());
foundClause = true;
break;
}
}
assertTrue("Missing clause", foundClause);
} finally {
uninstallSubsystemSilently(applicationA);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1425Test method testBundleSelectedFromLocalRepository.
@Test
public void testBundleSelectedFromLocalRepository() throws Exception {
Subsystem applicationB = installSubsystemFromFile(APPLICATION_B);
try {
assertNotConstituent(applicationB, BUNDLE_A, null, IdentityNamespace.TYPE_FRAGMENT);
assertConstituent(applicationB, BUNDLE_A, null, IdentityNamespace.TYPE_BUNDLE);
} finally {
uninstallSubsystemSilently(applicationB);
}
}
Aggregations