use of org.apache.aries.subsystem.itests.util.SubsystemArchiveBuilder in project aries by apache.
the class Aries1441Test method test.
private void test(String type) throws Exception {
SubsystemArchiveBuilder builder = new SubsystemArchiveBuilder().symbolicName("subsystem").type(type).content("a;version=\"[0,0]\"").bundle("a", new BundleArchiveBuilder().symbolicName("a").importPackage("org.osgi.framework").importPackage("b").build()).bundle("b", new BundleArchiveBuilder().symbolicName("b").exportPackage("b").build());
if (SubsystemConstants.SUBSYSTEM_TYPE_COMPOSITE.equals(type)) {
builder.importPackage("org.osgi.framework,b");
}
Subsystem root = getRootSubsystem();
Subsystem subsystem = installSubsystem(root, "subsystem", builder.build());
uninstallableSubsystems.add(subsystem);
startSubsystem(subsystem);
stoppableSubsystems.add(subsystem);
Bundle core = getSubsystemCoreBundle();
core.stop();
stoppableSubsystems.remove(subsystem);
uninstallableSubsystems.remove(subsystem);
assertBundleState(getSystemBundle(), org.osgi.framework.Bundle.ACTIVE);
core.start();
root = getRootSubsystem();
subsystem = getChild(root, "subsystem", null, type);
stopSubsystem(subsystem);
assertBundleState(Bundle.RESOLVED, "b", root);
uninstallSubsystem(subsystem);
assertNotConstituent(root, "b");
}
Aggregations