use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1435Test method testChildExportsPackage.
@Test
public void testChildExportsPackage() throws Exception {
registerWeavingHook("b");
Subsystem applicationB = installSubsystemFromFile(APPLICATION_B);
try {
Subsystem compositeE = installSubsystemFromFile(applicationB, COMPOSITE_E);
try {
startSubsystem(compositeE);
try {
testSharingPolicy(applicationB, "b", true);
testDynamicImport(applicationB, "b.B");
testSharingPolicy(applicationB, "b", true);
testSharingPolicy(compositeE, "b", false);
testSharingPolicy(getRootSubsystem(), "b", false);
} finally {
stopSubsystemSilently(compositeE);
}
} finally {
uninstallSubsystemSilently(compositeE);
}
} finally {
uninstallSubsystemSilently(applicationB);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1435Test method testNoProviders.
@Test
public void testNoProviders() throws Exception {
registerWeavingHook("b");
Subsystem applicationB = installSubsystemFromFile(APPLICATION_B);
try {
Bundle bundleA = getConstituentAsBundle(applicationB, BUNDLE_A, null, null);
bundleA.loadClass("a.A");
try {
bundleA.loadClass("b.B");
fail("Class should not have loaded");
} catch (ClassNotFoundException e) {
// Okay.
}
testSharingPolicy(applicationB, "b", false);
} finally {
uninstallSubsystemSilently(applicationB);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1435Test method testWovenSubsystemParentContainsProvider.
@Test
public void testWovenSubsystemParentContainsProvider() throws Exception {
registerWeavingHook("b");
Subsystem compositeE = installSubsystemFromFile(COMPOSITE_E);
try {
assertNotConstituent(getRootSubsystem(), BUNDLE_B);
assertConstituent(compositeE, BUNDLE_B);
Subsystem applicationB = getChild(compositeE, APPLICATION_B);
assertNotConstituent(applicationB, BUNDLE_B);
testDynamicImport(applicationB, "b.B");
testSharingPolicy(compositeE, "b", false);
testSharingPolicy(applicationB, "b", true);
} finally {
uninstallSubsystemSilently(compositeE);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1435Test method testDisconnectedEdgeWithParent.
@Test
public void testDisconnectedEdgeWithParent() throws Exception {
registerWeavingHook("b");
Bundle bundleB = getRootSubsystem().getBundleContext().installBundle(BUNDLE_B, new ByteArrayInputStream(createBundleBContent()));
try {
Subsystem applicationA = installSubsystemFromFile(APPLICATION_A);
try {
Subsystem applicationB = getChild(applicationA, APPLICATION_B);
uninstallSubsystem(applicationB);
removeConnectionWithParent(applicationA);
applicationB = installSubsystemFromFile(applicationA, APPLICATION_B);
try {
try {
testDynamicImport(applicationB, "b.B");
fail("Dynamic import should have failed");
} catch (AssertionError e) {
// Okay.
}
testSharingPolicy(applicationB, "b", true);
testSharingPolicy(applicationA, "b", false);
testSharingPolicy(getRootSubsystem(), "b", false);
} finally {
uninstallSubsystemSilently(applicationB);
}
} finally {
uninstallSubsystemSilently(applicationA);
}
} finally {
uninstallSilently(bundleB);
}
}
use of org.osgi.service.subsystem.Subsystem in project aries by apache.
the class Aries1435Test method testWovenSubsystemContainsProvider.
@Test
public void testWovenSubsystemContainsProvider() throws Exception {
registerWeavingHook("b");
Subsystem applicationE = installSubsystemFromFile(APPLICATION_E);
try {
assertConstituent(applicationE, BUNDLE_B);
testDynamicImport(applicationE, "b.B");
testSharingPolicy(applicationE, "b", false);
} finally {
uninstallSubsystemSilently(applicationE);
}
}
Aggregations