use of org.eclipse.osgi.service.resolver.State in project rt.equinox.framework by eclipse.
the class TestOptional_002 method testTest_002.
public void testTest_002() {
State state = buildEmptyState();
StateObjectFactory sof = StateObjectFactory.defaultFactory;
bundle_1 = create_bundle_1(sof);
bundle_2 = create_bundle_2(sof);
bundle_3 = create_bundle_3(sof);
// ***************************************************
// stage a
// expect to pass =true
// ***************************************************
addBundlesToState_a(state);
// ***************************************************
try {
state.resolve();
} catch (Throwable t) {
fail("unexpected exception class=" + t.getClass().getName() + " message=" + t.getMessage());
return;
}
checkBundlesResolved_a();
checkWiring_a();
}
use of org.eclipse.osgi.service.resolver.State in project rt.equinox.framework by eclipse.
the class TestPropagation_003 method testTest_001.
public void testTest_001() {
State state = buildEmptyState();
StateObjectFactory sof = StateObjectFactory.defaultFactory;
bundle_1 = create_bundle_1(sof);
bundle_2 = create_bundle_2(sof);
bundle_3 = create_bundle_3(sof);
bundle_4 = create_bundle_4(sof);
// ***************************************************
// stage a
// expect to pass =true
// ***************************************************
addBundlesToState_a(state);
// ***************************************************
try {
state.resolve();
} catch (Throwable t) {
fail("unexpected exception class=" + t.getClass().getName() + " message=" + t.getMessage());
return;
}
checkBundlesResolved_a();
checkWiring_a();
}
use of org.eclipse.osgi.service.resolver.State in project rt.equinox.framework by eclipse.
the class TestRFC79_006 method testTest_006.
public void testTest_006() {
State state = buildEmptyState();
StateObjectFactory sof = StateObjectFactory.defaultFactory;
bundle_1 = create_bundle_1(sof);
bundle_2 = create_bundle_2(sof);
bundle_3 = create_bundle_3(sof);
bundle_4 = create_bundle_4(sof);
bundle_5 = create_bundle_5(sof);
bundle_6 = create_bundle_6(sof);
// ***************************************************
// stage a
// expect to pass =true
// ***************************************************
addBundlesToState_a(state);
// ***************************************************
try {
state.resolve();
} catch (Throwable t) {
fail("unexpected exception class=" + t.getClass().getName() + " message=" + t.getMessage());
return;
}
checkBundlesResolved_a();
checkWiring_a();
}
use of org.eclipse.osgi.service.resolver.State in project rt.equinox.framework by eclipse.
the class NewResolverTest method testBasicScenario1.
public void testBasicScenario1() throws BundleException {
State state = buildEmptyState();
final String MAN_A = "Bundle-SymbolicName: A\n" + "Export-Package: servlet; specification-version=2.1";
BundleDescription bA = state.getFactory().createBundleDescription(parseManifest(MAN_A), "org.eclipse.basic1A", 0);
state.addBundle(bA);
final String MAN_B = "Bundle-SymbolicName: B\n" + "Import-Package: servlet; specification-version=2.1";
BundleDescription bB = state.getFactory().createBundleDescription(parseManifest(MAN_B), "org.eclipse.basic1B", 1);
state.addBundle(bB);
state.resolve();
BundleDescription b0 = state.getBundle(0);
assertNotNull("0.1", b0);
assertFullyResolved("0.2", b0);
BundleDescription b1 = state.getBundle(1);
assertNotNull("0.3", b1);
assertFullyResolved("0.4", b1);
}
use of org.eclipse.osgi.service.resolver.State in project rt.equinox.framework by eclipse.
the class PlatformAdminImpl method createSystemState.
private State createSystemState() {
State state = factory.createState(true);
StateConverter converter = new StateConverter(state);
ModuleDatabase database = equinoxContainer.getStorage().getModuleDatabase();
database.readLock();
try {
ModuleContainer container = equinoxContainer.getStorage().getModuleContainer();
List<Module> modules = equinoxContainer.getStorage().getModuleContainer().getModules();
for (Module module : modules) {
ModuleRevision current = module.getCurrentRevision();
BundleDescription description = converter.createDescription(current);
state.addBundle(description);
}
state.setPlatformProperties(asDictionary(equinoxContainer.getConfiguration().getInitialConfig()));
synchronizer = new PlatformBundleListener(state, converter, database, container);
state.setResolverHookFactory(synchronizer);
bc.addBundleListener(synchronizer);
bc.addFrameworkListener(synchronizer);
state.resolve();
state.setTimeStamp(database.getRevisionsTimestamp());
} finally {
database.readUnlock();
}
return state;
}
Aggregations