use of org.osgi.service.subsystem.SubsystemException 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.SubsystemException in project aries by apache.
the class Aries1383Test method test16a.
/*
* (16) Unscoped subsystem with a value of apache-aries-provision-dependencies
* that is the same as the scoped parent installs successfully.
*/
@Test
public void test16a() throws Exception {
Subsystem root = getRootSubsystem();
try {
Subsystem subsystem = installSubsystem(root, FEATURE_PROVISION_DEPENDENCIES_INSTALL, new SubsystemArchiveBuilder().symbolicName("application").type(SubsystemConstants.SUBSYSTEM_TYPE_APPLICATION + ';' + AriesProvisionDependenciesDirective.INSTALL.toString()).build(), true);
uninstallSubsystemSilently(subsystem);
} catch (SubsystemException e) {
e.printStackTrace();
fail("Subsystem should have installed");
}
}
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);
}
}
Aggregations