use of org.osgi.service.subsystem.SubsystemException in project aries by apache.
the class Aries1429Test method testMissingParentChildEdgeNotTolerated.
@Test
public void testMissingParentChildEdgeNotTolerated() throws Exception {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
try {
removeConnectionWithParent(applicationA);
try {
((AriesSubsystem) applicationA).addRequirements(Collections.singletonList((Requirement) new TestRequirement.Builder().namespace(PackageNamespace.PACKAGE_NAMESPACE).attribute(PackageNamespace.PACKAGE_NAMESPACE, "org.osgi.framework").build()));
fail("No exception received");
} catch (SubsystemException e) {
Throwable cause = e.getCause();
assertNotNull("Wrong cause", cause);
assertEquals("Wrong cause", IllegalStateException.class, cause.getClass());
}
} finally {
uninstallSubsystemSilently(applicationA);
}
}
use of org.osgi.service.subsystem.SubsystemException 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.SubsystemException in project aries by apache.
the class Aries1416Test method testSharedContentBundlePreferredProvider.
@Test
public void testSharedContentBundlePreferredProvider() throws Exception {
// Install feature A containing bundle B and application A both in the
// archive and as content into the root subsystem region. Bundle B
// provides capability b. Application A contains bundle A requiring
// capability b both in the archive and as content. Preferred provider
// bundle B is also included in the archive but not as content.
Subsystem featureA = installSubsystemFromFile(FEATURE_A);
try {
// Install feature B having the same characteristics as feature A
// described above into the root subsystem region. Bundle B will
// become shared content of features A and B. Shared content bundle
// B from the system repository should be used as the preferred
// provider. Bundle B from the local repository should not be
// provisioned.
Subsystem featureB = installSubsystemFromFile(FEATURE_B);
uninstallSubsystemSilently(featureB);
} catch (SubsystemException e) {
e.printStackTrace();
fail("Subsystem should have installed");
} finally {
uninstallSubsystemSilently(featureA);
}
}
use of org.osgi.service.subsystem.SubsystemException in project aries by apache.
the class Aries1416Test method testSystemRepositoryBundlePreferredProvider.
@Test
public void testSystemRepositoryBundlePreferredProvider() throws Exception {
Subsystem root = getRootSubsystem();
// Install bundle B providing capability b into the root subsystem's
// region.
Bundle bundleB = installBundleFromFile(BUNDLE_B, root);
try {
// Install application A containing content bundle A requiring
// capability b and dependency bundle B providing capability b.
// Bundle B is not content but will become part of the local
// repository. The preferred provider is bundle B. Bundle B from the
// system repository should be used. Bundle B from the local
// repository should not be provisioned.
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.SubsystemException in project aries by apache.
the class Aries1383Test method test16c.
/*
* (16) Unscoped subsystem with a value of apache-aries-provision-dependencies
* that is the same as the scoped parent installs successfully.
*/
@Test
public void test16c() throws Exception {
Subsystem root = getRootSubsystem();
try {
Subsystem subsystem = installSubsystem(root, "application", new SubsystemArchiveBuilder().symbolicName("application").type(SubsystemConstants.SUBSYSTEM_TYPE_APPLICATION + ';' + AriesProvisionDependenciesDirective.RESOLVE.toString()).subsystem("feature", new SubsystemArchiveBuilder().symbolicName("feature").type(SubsystemConstants.SUBSYSTEM_TYPE_FEATURE + ';' + AriesProvisionDependenciesDirective.RESOLVE.toString()).build()).build(), false);
uninstallSubsystemSilently(subsystem);
} catch (SubsystemException e) {
e.printStackTrace();
fail("Subsystem should have installed");
}
}
Aggregations