use of org.eclipse.osgi.service.resolver.StateObjectFactory 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.StateObjectFactory 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.StateObjectFactory 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.StateObjectFactory in project tycho by eclipse.
the class SourcesBundleDependencyMetadataGenerator method getPublisherActions.
@Override
protected List<IPublisherAction> getPublisherActions(IArtifactFacade artifact, List<TargetEnvironment> environments, OptionalResolutionAction optionalAction) {
ArrayList<IPublisherAction> actions = new ArrayList<>();
String id = artifact.getArtifactId();
String version = toCanonicalVersion(artifact.getVersion());
try {
// generated source bundle is not available at this point in filesystem yet, need to create
// in-memory BundleDescription instead
Dictionary<String, String> manifest = new Hashtable<>();
manifest.put("Manifest-Version", "1.0");
manifest.put("Bundle-ManifestVersion", "2");
String sourceBundleSymbolicName = id + ".source";
manifest.put("Bundle-SymbolicName", sourceBundleSymbolicName);
manifest.put("Bundle-Version", version);
manifest.put("Eclipse-SourceBundle", id + ";version=" + version + ";roots:=\".\"");
StateObjectFactory factory = StateObjectFactory.defaultFactory;
BundleDescription bundleDescription = factory.createBundleDescription(factory.createState(false), manifest, artifact.getLocation().getAbsolutePath(), createId(sourceBundleSymbolicName, version));
bundleDescription.setUserObject(manifest);
actions.add(new BundlesAction(new BundleDescription[] { bundleDescription }) {
@Override
protected void createAdviceFileAdvice(BundleDescription bundleDescription, IPublisherInfo publisherInfo) {
// 367255 p2.inf is not applicable to sources bundles
}
});
} catch (BundleException e) {
throw new RuntimeException(e);
}
return actions;
}
use of org.eclipse.osgi.service.resolver.StateObjectFactory in project rt.equinox.framework by eclipse.
the class TestDynamic_006 method testTest_005.
public void testTest_005() {
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();
// Dynamics
ExportPackageDescription exp = state.linkDynamicImport(bundle_1, "p.b");
assertNotNull("Package [p.b] is not wired when it should be ", exp);
assertEquals("Package [p.b] is wired incorrectly ", exp.getExporter(), bundle_3);
}
Aggregations