Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-09-10 18:29:55 +0000
committerThomas Watson2008-09-10 18:29:55 +0000
commitae26454abdaa8e2724e23c7eb3ec966ce02d0b19 (patch)
tree5ce8b6e751464c1623764769a4244299970bdcd0
parentdd9f2ba96a464ada6356684acaf1c0821cd64594 (diff)
downloadrt.equinox.framework-ae26454abdaa8e2724e23c7eb3ec966ce02d0b19.tar.gz
rt.equinox.framework-ae26454abdaa8e2724e23c7eb3ec966ce02d0b19.tar.xz
rt.equinox.framework-ae26454abdaa8e2724e23c7eb3ec966ce02d0b19.zip
Bug 246640 System packages only added to first system bundle
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java3753
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java4
2 files changed, 1933 insertions, 1824 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
index e5ea2f76b..d2c5dd681 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
@@ -39,59 +39,59 @@ public class StateResolverTest extends AbstractStateTest {
StateDelta delta = state.resolve();
BundleDelta[] deltas = delta.getChanges();
BundleDescription b0 = state.getBundle(0);
- assertNotNull("0.1", b0);
- assertFullyResolved("0.2", b0);
+ assertNotNull("0.1", b0); //$NON-NLS-1$
+ assertFullyResolved("0.2", b0); //$NON-NLS-1$
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p1; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p1; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b1 = null;
try {
- b1 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b1", 1);
+ b1 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b1", 1); //$NON-NLS-1$
state.removeBundle(1);
state.addBundle(b1);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p1");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p2; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p2; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b2 = null;
try {
- b2 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b2", 2);
+ b2 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b2", 2); //$NON-NLS-1$
state.removeBundle(2);
state.addBundle(b2);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p2");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p3; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p2"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p3; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b3 = null;
try {
- b3 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b3", 3);
+ b3 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b3", 3); //$NON-NLS-1$
state.removeBundle(3);
state.addBundle(b3);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
delta = state.resolve(new BundleDescription[] {state.getBundle(1)});
deltas = delta.getChanges();
- assertEquals("1.0", 3, deltas.length);
+ assertEquals("1.0", 3, deltas.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("1.1", deltasMap.get(new Long(1)));
- assertNotNull("1.2", deltasMap.get(new Long(2)));
- assertNotNull("1.3", deltasMap.get(new Long(3)));
- assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType());
- assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType());
- assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType());
+ assertNotNull("1.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
+ assertNotNull("1.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
+ assertNotNull("1.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
+ assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
+ assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
+ assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
}
public void testBasicResolution() throws BundleException {
@@ -100,67 +100,67 @@ public class StateResolverTest extends AbstractStateTest {
BundleDescription b1 = state.getBundle(1);
BundleDescription b2 = state.getBundle(2);
BundleDescription b3 = state.getBundle(3);
- assertNotNull("0.1", b1);
- assertNotNull("0.2", b2);
- assertNotNull("0.3", b3);
+ assertNotNull("0.1", b1); //$NON-NLS-1$
+ assertNotNull("0.2", b2); //$NON-NLS-1$
+ assertNotNull("0.3", b3); //$NON-NLS-1$
BundleDelta[] changes = delta.getChanges();
- assertEquals("1.0", 3, changes.length);
+ assertEquals("1.0", 3, changes.length); //$NON-NLS-1$
BundleDelta[] additions = delta.getChanges(BundleDelta.ADDED, false);
- assertEquals("2.0", 3, additions.length);
+ assertEquals("2.0", 3, additions.length); //$NON-NLS-1$
BundleDelta[] resolutions = delta.getChanges(BundleDelta.RESOLVED, false);
- assertEquals("3.0", 2, resolutions.length);
+ assertEquals("3.0", 2, resolutions.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < resolutions.length; i++)
deltasMap.put(resolutions[i].getBundle().getSymbolicName(), resolutions[i]);
- assertNotNull("3.1", deltasMap.get(b1.getSymbolicName()));
- assertNotNull("3.2", deltasMap.get(b2.getSymbolicName()));
+ assertNotNull("3.1", deltasMap.get(b1.getSymbolicName())); //$NON-NLS-1$
+ assertNotNull("3.2", deltasMap.get(b2.getSymbolicName())); //$NON-NLS-1$
// TODO why do we expect unresolved deltas here when the bundle was not resolved in the first place?
//BundleDelta[] unresolutions = delta.getChanges(BundleDelta.UNRESOLVED, false);
//assertEquals("4.0", 1, unresolutions.length);
//assertEquals("4.1", unresolutions[0].getBundle(), b3);
- assertFullyResolved("5.1", b1);
- assertFullyResolved("5.2", b2);
- assertFullyUnresolved("5.3", b3);
+ assertFullyResolved("5.1", b1); //$NON-NLS-1$
+ assertFullyResolved("5.2", b2); //$NON-NLS-1$
+ assertFullyUnresolved("5.3", b3); //$NON-NLS-1$
}
public void testComplexResolution() throws BundleException {
State state = buildComplexState();
StateDelta delta = state.resolve();
- BundleDescription b1 = state.getBundle("org.eclipse.b1", Version.parseVersion("1.0"));
- BundleDescription b2 = state.getBundle("org.eclipse.b2", Version.parseVersion("2.0"));
- BundleDescription b3 = state.getBundle("org.eclipse.b3", Version.parseVersion("2.0"));
- BundleDescription b4 = state.getBundle("org.eclipse.b4", Version.parseVersion("2.0"));
- BundleDescription b5 = state.getBundle("org.eclipse.b5", Version.parseVersion("1.0"));
- BundleDescription b6 = state.getBundle("org.eclipse.b6", Version.parseVersion("1.0"));
- assertNotNull("0.1", b1);
- assertNotNull("0.2", b2);
- assertNotNull("0.3", b3);
- assertNotNull("0.4", b4);
- assertNotNull("0.5", b5);
- assertNotNull("0.6", b6);
+ BundleDescription b1 = state.getBundle("org.eclipse.b1", Version.parseVersion("1.0")); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription b2 = state.getBundle("org.eclipse.b2", Version.parseVersion("2.0")); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription b3 = state.getBundle("org.eclipse.b3", Version.parseVersion("2.0")); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription b4 = state.getBundle("org.eclipse.b4", Version.parseVersion("2.0")); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription b5 = state.getBundle("org.eclipse.b5", Version.parseVersion("1.0")); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription b6 = state.getBundle("org.eclipse.b6", Version.parseVersion("1.0")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertNotNull("0.1", b1); //$NON-NLS-1$
+ assertNotNull("0.2", b2); //$NON-NLS-1$
+ assertNotNull("0.3", b3); //$NON-NLS-1$
+ assertNotNull("0.4", b4); //$NON-NLS-1$
+ assertNotNull("0.5", b5); //$NON-NLS-1$
+ assertNotNull("0.6", b6); //$NON-NLS-1$
BundleDelta[] changes = delta.getChanges();
- assertEquals("1.0", 6, changes.length);
+ assertEquals("1.0", 6, changes.length); //$NON-NLS-1$
BundleDelta[] additions = delta.getChanges(BundleDelta.ADDED, false);
- assertEquals("2.0", 6, additions.length);
+ assertEquals("2.0", 6, additions.length); //$NON-NLS-1$
BundleDelta[] resolutions = delta.getChanges(BundleDelta.RESOLVED, false);
- assertEquals("3.0", 6, resolutions.length);
+ assertEquals("3.0", 6, resolutions.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < resolutions.length; i++)
deltasMap.put(resolutions[i].getBundle().getSymbolicName(), resolutions[i]);
- assertNotNull("3.1", deltasMap.get(b1.getSymbolicName()));
- assertNotNull("3.2", deltasMap.get(b2.getSymbolicName()));
- assertNotNull("3.3", deltasMap.get(b3.getSymbolicName()));
- assertNotNull("3.4", deltasMap.get(b4.getSymbolicName()));
- assertNotNull("3.5", deltasMap.get(b5.getSymbolicName()));
- assertNotNull("3.6", deltasMap.get(b6.getSymbolicName()));
+ assertNotNull("3.1", deltasMap.get(b1.getSymbolicName())); //$NON-NLS-1$
+ assertNotNull("3.2", deltasMap.get(b2.getSymbolicName())); //$NON-NLS-1$
+ assertNotNull("3.3", deltasMap.get(b3.getSymbolicName())); //$NON-NLS-1$
+ assertNotNull("3.4", deltasMap.get(b4.getSymbolicName())); //$NON-NLS-1$
+ assertNotNull("3.5", deltasMap.get(b5.getSymbolicName())); //$NON-NLS-1$
+ assertNotNull("3.6", deltasMap.get(b6.getSymbolicName())); //$NON-NLS-1$
BundleDelta[] unresolutions = delta.getChanges(BundleDelta.UNRESOLVED, false);
- assertEquals("4.0", 0, unresolutions.length);
- assertFullyResolved("5.1", b1);
- assertFullyResolved("5.2", b2);
- assertFullyResolved("5.3", b3);
- assertFullyResolved("5.4", b4);
- assertFullyResolved("5.5", b5);
- assertFullyResolved("5.6", b6);
+ assertEquals("4.0", 0, unresolutions.length); //$NON-NLS-1$
+ assertFullyResolved("5.1", b1); //$NON-NLS-1$
+ assertFullyResolved("5.2", b2); //$NON-NLS-1$
+ assertFullyResolved("5.3", b3); //$NON-NLS-1$
+ assertFullyResolved("5.4", b4); //$NON-NLS-1$
+ assertFullyResolved("5.5", b5); //$NON-NLS-1$
+ assertFullyResolved("5.6", b6); //$NON-NLS-1$
}
public void testDependentBundles() throws BundleException {
@@ -168,14 +168,14 @@ public class StateResolverTest extends AbstractStateTest {
state.resolve();
BundleDescription[] dependent;
dependent = platformAdmin.getStateHelper().getDependentBundles(new BundleDescription[] {state.getBundle(2)});
- assertEquals("1.0", 1, dependent.length);
- assertEquals("1.1", state.getBundle(2), dependent[0]);
+ assertEquals("1.0", 1, dependent.length); //$NON-NLS-1$
+ assertEquals("1.1", state.getBundle(2), dependent[0]); //$NON-NLS-1$
dependent = platformAdmin.getStateHelper().getDependentBundles(new BundleDescription[] {state.getBundle(1)});
- assertEquals("2.0", 4, dependent.length);
- assertContains("2.1", dependent, state.getBundle(1));
- assertContains("2.2", dependent, state.getBundle(2));
- assertContains("2.3", dependent, state.getBundle(4));
- assertContains("2.4", dependent, state.getBundle(6));
+ assertEquals("2.0", 4, dependent.length); //$NON-NLS-1$
+ assertContains("2.1", dependent, state.getBundle(1)); //$NON-NLS-1$
+ assertContains("2.2", dependent, state.getBundle(2)); //$NON-NLS-1$
+ assertContains("2.3", dependent, state.getBundle(4)); //$NON-NLS-1$
+ assertContains("2.4", dependent, state.getBundle(6)); //$NON-NLS-1$
}
public void testPrerequisiteBundle() throws BundleException {
@@ -183,92 +183,92 @@ public class StateResolverTest extends AbstractStateTest {
state.resolve();
BundleDescription[] prereqs;
prereqs = platformAdmin.getStateHelper().getPrerequisites(state.getResolvedBundles());
- assertEquals("1.0", 6, prereqs.length);
+ assertEquals("1.0", 6, prereqs.length); //$NON-NLS-1$
prereqs = platformAdmin.getStateHelper().getPrerequisites(new BundleDescription[] {state.getBundle(1)});
- assertEquals("2.0", 2, prereqs.length);
- assertContains("2.1", prereqs, state.getBundle(1));
- assertContains("2.2", prereqs, state.getBundle(3));
+ assertEquals("2.0", 2, prereqs.length); //$NON-NLS-1$
+ assertContains("2.1", prereqs, state.getBundle(1)); //$NON-NLS-1$
+ assertContains("2.2", prereqs, state.getBundle(3)); //$NON-NLS-1$
prereqs = platformAdmin.getStateHelper().getPrerequisites(new BundleDescription[] {state.getBundle(2)});
- assertEquals("3.0", 3, prereqs.length);
- assertContains("3.1", prereqs, state.getBundle(1));
- assertContains("3.2", prereqs, state.getBundle(2));
- assertContains("3.3", prereqs, state.getBundle(3));
+ assertEquals("3.0", 3, prereqs.length); //$NON-NLS-1$
+ assertContains("3.1", prereqs, state.getBundle(1)); //$NON-NLS-1$
+ assertContains("3.2", prereqs, state.getBundle(2)); //$NON-NLS-1$
+ assertContains("3.3", prereqs, state.getBundle(3)); //$NON-NLS-1$
prereqs = platformAdmin.getStateHelper().getPrerequisites(new BundleDescription[] {state.getBundle(3)});
- assertEquals("4.0", 1, prereqs.length);
- assertContains("4.1", prereqs, state.getBundle(3));
+ assertEquals("4.0", 1, prereqs.length); //$NON-NLS-1$
+ assertContains("4.1", prereqs, state.getBundle(3)); //$NON-NLS-1$
prereqs = platformAdmin.getStateHelper().getPrerequisites(new BundleDescription[] {state.getBundle(4)});
- assertEquals("5.0", 3, prereqs.length);
- assertContains("5.1", prereqs, state.getBundle(1));
- assertContains("5.2", prereqs, state.getBundle(3));
- assertContains("5.3", prereqs, state.getBundle(4));
+ assertEquals("5.0", 3, prereqs.length); //$NON-NLS-1$
+ assertContains("5.1", prereqs, state.getBundle(1)); //$NON-NLS-1$
+ assertContains("5.2", prereqs, state.getBundle(3)); //$NON-NLS-1$
+ assertContains("5.3", prereqs, state.getBundle(4)); //$NON-NLS-1$
prereqs = platformAdmin.getStateHelper().getPrerequisites(new BundleDescription[] {state.getBundle(5)});
- assertEquals("6.0", 2, prereqs.length);
- assertContains("6.1", prereqs, state.getBundle(3));
- assertContains("6.2", prereqs, state.getBundle(5));
+ assertEquals("6.0", 2, prereqs.length); //$NON-NLS-1$
+ assertContains("6.1", prereqs, state.getBundle(3)); //$NON-NLS-1$
+ assertContains("6.2", prereqs, state.getBundle(5)); //$NON-NLS-1$
prereqs = platformAdmin.getStateHelper().getPrerequisites(new BundleDescription[] {state.getBundle(6)});
- assertEquals("6.0", 4, prereqs.length);
- assertContains("6.1", prereqs, state.getBundle(1));
- assertContains("6.2", prereqs, state.getBundle(3));
- assertContains("6.3", prereqs, state.getBundle(4));
- assertContains("6.4", prereqs, state.getBundle(6));
+ assertEquals("6.0", 4, prereqs.length); //$NON-NLS-1$
+ assertContains("6.1", prereqs, state.getBundle(1)); //$NON-NLS-1$
+ assertContains("6.2", prereqs, state.getBundle(3)); //$NON-NLS-1$
+ assertContains("6.3", prereqs, state.getBundle(4)); //$NON-NLS-1$
+ assertContains("6.4", prereqs, state.getBundle(6)); //$NON-NLS-1$
}
// temporarily disabled
public void testLinkageChange() throws BundleException {
State state = buildEmptyState();
// don't add b1 for now
- String B1_LOCATION = "org.eclipse.b1";
- final String B1_MANIFEST = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 1.0\n";
+ String B1_LOCATION = "org.eclipse.b1"; //$NON-NLS-1$
+ final String B1_MANIFEST = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 1.0\n"; //$NON-NLS-1$ //$NON-NLS-2$
BundleDescription b1 = state.getFactory().createBundleDescription(parseManifest(B1_MANIFEST), B1_LOCATION, (long) (Math.random() * Long.MAX_VALUE));
// b2 requires b1 optionally, so should resolve
- String B2_LOCATION = "org.eclipse.b2";
- final String B2_MANIFEST = "Bundle-SymbolicName: org.eclipse.b2\n" + "Bundle-Version: 2.0\n" + "Require-Bundle: org.eclipse.b1;optional=true";
+ String B2_LOCATION = "org.eclipse.b2"; //$NON-NLS-1$
+ final String B2_MANIFEST = "Bundle-SymbolicName: org.eclipse.b2\n" + "Bundle-Version: 2.0\n" + "Require-Bundle: org.eclipse.b1;optional=true"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
BundleDescription b2 = state.getFactory().createBundleDescription(parseManifest(B2_MANIFEST), B2_LOCATION, (long) (Math.random() * Long.MAX_VALUE));
// b3 requires b1, so should not resolve
- String B3_LOCATION = "org.eclipse.b3";
- final String B3_MANIFEST = "Bundle-SymbolicName: org.eclipse.b3\n" + "Bundle-Version: 2.0\n" + "Require-Bundle: org.eclipse.b1";
+ String B3_LOCATION = "org.eclipse.b3"; //$NON-NLS-1$
+ final String B3_MANIFEST = "Bundle-SymbolicName: org.eclipse.b3\n" + "Bundle-Version: 2.0\n" + "Require-Bundle: org.eclipse.b1"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
BundleDescription b3 = state.getFactory().createBundleDescription(parseManifest(B3_MANIFEST), B3_LOCATION, (long) (Math.random() * Long.MAX_VALUE));
// add b2 and b3
state.addBundle(b2);
state.addBundle(b3);
StateDelta delta = state.resolve();
// ensure we didn't add b1 yet
- assertFullyUnresolved("0.1", b1);
+ assertFullyUnresolved("0.1", b1); //$NON-NLS-1$
BundleDelta[] changes = delta.getChanges();
- assertEquals("1.0", 2, changes.length);
+ assertEquals("1.0", 2, changes.length); //$NON-NLS-1$
BundleDelta[] additions = delta.getChanges(BundleDelta.ADDED, false);
- assertEquals("2.0", 2, additions.length);
+ assertEquals("2.0", 2, additions.length); //$NON-NLS-1$
BundleDelta[] resolutions = delta.getChanges(BundleDelta.RESOLVED, false);
- assertEquals("3.0", 1, resolutions.length);
- assertEquals("3.1", b2, resolutions[0].getBundle());
+ assertEquals("3.0", 1, resolutions.length); //$NON-NLS-1$
+ assertEquals("3.1", b2, resolutions[0].getBundle()); //$NON-NLS-1$
BundleDelta[] addtionsNotResolved = delta.getChanges(BundleDelta.ADDED, true);
- assertEquals("4.0", 1, addtionsNotResolved.length);
- assertEquals("4.1", b3, addtionsNotResolved[0].getBundle());
+ assertEquals("4.0", 1, addtionsNotResolved.length); //$NON-NLS-1$
+ assertEquals("4.1", b3, addtionsNotResolved[0].getBundle()); //$NON-NLS-1$
state.addBundle(b1);
delta = state.resolve();
changes = delta.getChanges();
- assertEquals("5.0", 2, changes.length);
+ assertEquals("5.0", 2, changes.length); //$NON-NLS-1$
additions = delta.getChanges(BundleDelta.ADDED, false);
- assertEquals("6.0", 1, additions.length);
- assertEquals("6.1", b1, additions[0].getBundle());
+ assertEquals("6.0", 1, additions.length); //$NON-NLS-1$
+ assertEquals("6.1", b1, additions[0].getBundle()); //$NON-NLS-1$
resolutions = delta.getChanges(BundleDelta.RESOLVED, false);
- assertEquals("7.0", 2, resolutions.length);
+ assertEquals("7.0", 2, resolutions.length); //$NON-NLS-1$
BundleDelta[] existingResolved = delta.getChanges(BundleDelta.RESOLVED, true);
- assertEquals("8.0", 1, existingResolved.length);
- assertEquals("8.1", b3, existingResolved[0].getBundle());
+ assertEquals("8.0", 1, existingResolved.length); //$NON-NLS-1$
+ assertEquals("8.1", b3, existingResolved[0].getBundle()); //$NON-NLS-1$
// TODO linkage changed types are no longer valid
//BundleDelta[] optionalLinkageChanged = delta.getChanges(BundleDelta.OPTIONAL_LINKAGE_CHANGED, true);
//assertEquals("9.0", 1, optionalLinkageChanged.length);
//assertEquals("9.1", b2, optionalLinkageChanged[0].getBundle());
delta = state.resolve(new BundleDescription[] {b2});
changes = delta.getChanges();
- assertEquals("9.0", 1, changes.length);
+ assertEquals("9.0", 1, changes.length); //$NON-NLS-1$
resolutions = delta.getChanges(BundleDelta.RESOLVED, true);
- assertEquals("9.1", 1, resolutions.length);
- assertEquals("9.2", b2, resolutions[0].getBundle());
- assertFullyResolved("10.1", b1);
- assertFullyResolved("10.2", b2);
- assertFullyResolved("10.3", b3);
+ assertEquals("9.1", 1, resolutions.length); //$NON-NLS-1$
+ assertEquals("9.2", b2, resolutions[0].getBundle()); //$NON-NLS-1$
+ assertFullyResolved("10.1", b1); //$NON-NLS-1$
+ assertFullyResolved("10.2", b2); //$NON-NLS-1$
+ assertFullyResolved("10.3", b3); //$NON-NLS-1$
}
// temporarily disabled
@@ -278,25 +278,25 @@ public class StateResolverTest extends AbstractStateTest {
// remove bundle 4 - should cause 6 to be unresolved
state.removeBundle(4);
delta = state.resolve();
- assertEquals("1.0", 1, delta.getChanges(BundleDelta.REMOVED | BundleDelta.UNRESOLVED | BundleDelta.REMOVAL_COMPLETE, true).length);
- assertEquals("1.1", 4, delta.getChanges(BundleDelta.REMOVED | BundleDelta.UNRESOLVED | BundleDelta.REMOVAL_COMPLETE, true)[0].getBundle().getBundleId());
- assertEquals("2.0", 1, delta.getChanges(BundleDelta.UNRESOLVED, true).length);
- assertEquals("2.1", 6, delta.getChanges(BundleDelta.UNRESOLVED, true)[0].getBundle().getBundleId());
+ assertEquals("1.0", 1, delta.getChanges(BundleDelta.REMOVED | BundleDelta.UNRESOLVED | BundleDelta.REMOVAL_COMPLETE, true).length); //$NON-NLS-1$
+ assertEquals("1.1", 4, delta.getChanges(BundleDelta.REMOVED | BundleDelta.UNRESOLVED | BundleDelta.REMOVAL_COMPLETE, true)[0].getBundle().getBundleId()); //$NON-NLS-1$
+ assertEquals("2.0", 1, delta.getChanges(BundleDelta.UNRESOLVED, true).length); //$NON-NLS-1$
+ assertEquals("2.1", 6, delta.getChanges(BundleDelta.UNRESOLVED, true)[0].getBundle().getBundleId()); //$NON-NLS-1$
// reinstall bundle 4 - should cause 6 to be resolved again
BundleDescription b4 = delta.getChanges(BundleDelta.REMOVED | BundleDelta.UNRESOLVED | BundleDelta.REMOVAL_COMPLETE, true)[0].getBundle();
state.addBundle(b4);
delta = state.resolve();
- assertEquals("3.0", 1, delta.getChanges(BundleDelta.ADDED | BundleDelta.RESOLVED, true).length);
- assertEquals("3.1", 4, delta.getChanges(BundleDelta.ADDED | BundleDelta.RESOLVED, true)[0].getBundle().getBundleId());
- assertEquals("4.0", 1, delta.getChanges(BundleDelta.RESOLVED, true).length);
- assertEquals("4.1", 6, delta.getChanges(BundleDelta.RESOLVED, true)[0].getBundle().getBundleId());
+ assertEquals("3.0", 1, delta.getChanges(BundleDelta.ADDED | BundleDelta.RESOLVED, true).length); //$NON-NLS-1$
+ assertEquals("3.1", 4, delta.getChanges(BundleDelta.ADDED | BundleDelta.RESOLVED, true)[0].getBundle().getBundleId()); //$NON-NLS-1$
+ assertEquals("4.0", 1, delta.getChanges(BundleDelta.RESOLVED, true).length); //$NON-NLS-1$
+ assertEquals("4.1", 6, delta.getChanges(BundleDelta.RESOLVED, true)[0].getBundle().getBundleId()); //$NON-NLS-1$
}
public void testRemoval() throws BundleException {
- String B1_LOCATION = "org.eclipse.b1";
- final String B1_MANIFEST = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 1.0\n";
- String B2_LOCATION = "org.eclipse.b2";
- final String B2_MANIFEST = "Bundle-SymbolicName: org.eclipse.b2\n" + "Bundle-Version: 1.0\n";
+ String B1_LOCATION = "org.eclipse.b1"; //$NON-NLS-1$
+ final String B1_MANIFEST = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 1.0\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ String B2_LOCATION = "org.eclipse.b2"; //$NON-NLS-1$
+ final String B2_MANIFEST = "Bundle-SymbolicName: org.eclipse.b2\n" + "Bundle-Version: 1.0\n"; //$NON-NLS-1$ //$NON-NLS-2$
State state = platformAdmin.getState();
state.setResolver(platformAdmin.getResolver());
BundleDescription b1 = platformAdmin.getFactory().createBundleDescription(parseManifest(B1_MANIFEST), B1_LOCATION, 1);
@@ -304,28 +304,28 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(b1);
state.addBundle(b2);
StateDelta delta = state.resolve();
- assertTrue("1.1", contains(state.getResolvedBundles(), b1));
- assertTrue("1.2", contains(state.getResolvedBundles(), b2));
+ assertTrue("1.1", contains(state.getResolvedBundles(), b1)); //$NON-NLS-1$
+ assertTrue("1.2", contains(state.getResolvedBundles(), b2)); //$NON-NLS-1$
BundleDelta[] changes = delta.getChanges();
- assertEquals("1.3", 2, changes.length);
- assertEquals("1.4 - " + changes[0].getBundle(), (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[0].getType());
- assertEquals("1.5 - " + changes[1].getBundle(), (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[1].getType());
- assertFullyResolved("1.6", b1);
- assertFullyResolved("1.7", b2);
+ assertEquals("1.3", 2, changes.length); //$NON-NLS-1$
+ assertEquals("1.4 - " + changes[0].getBundle(), (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[0].getType()); //$NON-NLS-1$
+ assertEquals("1.5 - " + changes[1].getBundle(), (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[1].getType()); //$NON-NLS-1$
+ assertFullyResolved("1.6", b1); //$NON-NLS-1$
+ assertFullyResolved("1.7", b2); //$NON-NLS-1$
// remove a resolved bundle
state.removeBundle(b1);
- assertTrue("2.0", !contains(state.getResolvedBundles(), b1));
- assertTrue("2.1", contains(state.getResolvedBundles(), b2));
+ assertTrue("2.0", !contains(state.getResolvedBundles(), b1)); //$NON-NLS-1$
+ assertTrue("2.1", contains(state.getResolvedBundles(), b2)); //$NON-NLS-1$
delta = state.resolve();
changes = delta.getChanges();
- assertEquals("2.2", 1, changes.length);
- assertEquals("2.3", b1, changes[0].getBundle());
- assertEquals("2.4", BundleDelta.REMOVED | BundleDelta.UNRESOLVED, changes[0].getType());
+ assertEquals("2.2", 1, changes.length); //$NON-NLS-1$
+ assertEquals("2.3", b1, changes[0].getBundle()); //$NON-NLS-1$
+ assertEquals("2.4", BundleDelta.REMOVED | BundleDelta.UNRESOLVED, changes[0].getType()); //$NON-NLS-1$
}
public void testRemoveAndAdd() throws BundleException {
- String B_LOCATION = "org.eclipse.b";
- final String B_MANIFEST = "Bundle-SymbolicName: org.eclipse.b\n" + "Bundle-Version: 1.0\n";
+ String B_LOCATION = "org.eclipse.b"; //$NON-NLS-1$
+ final String B_MANIFEST = "Bundle-SymbolicName: org.eclipse.b\n" + "Bundle-Version: 1.0\n"; //$NON-NLS-1$ //$NON-NLS-2$
State state = platformAdmin.getState();
state.setResolver(platformAdmin.getResolver());
BundleDescription b1 = platformAdmin.getFactory().createBundleDescription(parseManifest(B_MANIFEST), B_LOCATION, 1);
@@ -333,18 +333,18 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(b1);
StateDelta delta = state.resolve();
BundleDelta[] changes = delta.getChanges();
- assertEquals("1.0", 1, changes.length);
- assertEquals("1.1", b1, changes[0].getBundle());
- assertEquals("1.2", (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[0].getType());
- assertFullyResolved("1.3", b1);
+ assertEquals("1.0", 1, changes.length); //$NON-NLS-1$
+ assertEquals("1.1", b1, changes[0].getBundle()); //$NON-NLS-1$
+ assertEquals("1.2", (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[0].getType()); //$NON-NLS-1$
+ assertFullyResolved("1.3", b1); //$NON-NLS-1$
state.removeBundle(b1);
state.addBundle(b2);
delta = state.resolve();
- assertEquals("2.0", 2, delta.getChanges().length);
- assertEquals("2.1", 1, delta.getChanges(BundleDelta.UNRESOLVED | BundleDelta.REMOVED, true).length);
- assertEquals("2.2", b1, delta.getChanges(BundleDelta.UNRESOLVED | BundleDelta.REMOVED, true)[0].getBundle());
- assertEquals("2.3", 1, delta.getChanges(BundleDelta.RESOLVED | BundleDelta.ADDED, true).length);
- assertEquals("2.3", b2, delta.getChanges(BundleDelta.RESOLVED | BundleDelta.ADDED, true)[0].getBundle());
+ assertEquals("2.0", 2, delta.getChanges().length); //$NON-NLS-1$
+ assertEquals("2.1", 1, delta.getChanges(BundleDelta.UNRESOLVED | BundleDelta.REMOVED, true).length); //$NON-NLS-1$
+ assertEquals("2.2", b1, delta.getChanges(BundleDelta.UNRESOLVED | BundleDelta.REMOVED, true)[0].getBundle()); //$NON-NLS-1$
+ assertEquals("2.3", 1, delta.getChanges(BundleDelta.RESOLVED | BundleDelta.ADDED, true).length); //$NON-NLS-1$
+ assertEquals("2.3", b2, delta.getChanges(BundleDelta.RESOLVED | BundleDelta.ADDED, true)[0].getBundle()); //$NON-NLS-1$
}
public void testRemovalResolve() throws BundleException {
@@ -352,66 +352,66 @@ public class StateResolverTest extends AbstractStateTest {
StateDelta delta = state.resolve();
BundleDelta[] deltas = delta.getChanges();
BundleDescription b0 = state.getBundle(0);
- assertNotNull("0.1", b0);
- assertFullyResolved("0.2", b0);
+ assertNotNull("0.1", b0); //$NON-NLS-1$
+ assertFullyResolved("0.2", b0); //$NON-NLS-1$
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p1; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p1; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b1 = null;
try {
- b1 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b1", 1);
+ b1 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b1", 1); //$NON-NLS-1$
state.removeBundle(1);
state.addBundle(b1);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p1");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p2; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p2; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b2 = null;
try {
- b2 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b2", 2);
+ b2 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b2", 2); //$NON-NLS-1$
state.removeBundle(2);
state.addBundle(b2);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p2");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p3; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p2"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p3; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b3 = null;
try {
- b3 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b3", 3);
+ b3 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b3", 3); //$NON-NLS-1$
state.removeBundle(3);
state.addBundle(b3);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
delta = state.resolve(false);
deltas = delta.getChanges();
- assertEquals("1.0", 4, deltas.length);
+ assertEquals("1.0", 4, deltas.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("1.1", deltasMap.get(new Long(1)));
- assertNotNull("1.2", deltasMap.get(new Long(2)));
- assertNotNull("1.3", deltasMap.get(new Long(3)));
- assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType());
- assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType());
- assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType());
+ assertNotNull("1.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
+ assertNotNull("1.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
+ assertNotNull("1.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
+ assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
+ assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
+ assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
state.removeBundle(1);
delta = state.resolve(false);
deltas = delta.getChanges();
b2 = state.getBundle(2);
b3 = state.getBundle(3);
- assertEquals("3.1", false, b2.isResolved());
- assertEquals("3.2", false, b3.isResolved());
+ assertEquals("3.1", false, b2.isResolved()); //$NON-NLS-1$
+ assertEquals("3.2", false, b3.isResolved()); //$NON-NLS-1$
}
/**
@@ -426,149 +426,149 @@ public class StateResolverTest extends AbstractStateTest {
StateDelta delta = state.resolve();
BundleDelta[] deltas = delta.getChanges();
BundleDescription b0 = state.getBundle(0);
- assertNotNull("0.1", b0);
- assertFullyResolved("0.2", b0);
+ assertNotNull("0.1", b0); //$NON-NLS-1$
+ assertFullyResolved("0.2", b0); //$NON-NLS-1$
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p1; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p1; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b1 = null;
try {
- b1 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b1", 1);
+ b1 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b1", 1); //$NON-NLS-1$
state.removeBundle(1);
state.addBundle(b1);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p1");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p2; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p2; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b2 = null;
try {
- b2 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b2", 2);
+ b2 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b2", 2); //$NON-NLS-1$
state.removeBundle(2);
state.addBundle(b2);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p2");
- manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p3; specification-version=1.0");
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.b3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "org.osgi.framework,org.eclipse.p2"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "org.eclipse.p3; specification-version=1.0"); //$NON-NLS-1$
BundleDescription b3 = null;
try {
- b3 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b3", 3);
+ b3 = state.getFactory().createBundleDescription(manifest, "org.eclipse.b3", 3); //$NON-NLS-1$
state.removeBundle(3);
state.addBundle(b3);
} catch (BundleException e) {
- fail("Failed to create BundleDescription: " + e.getMessage());
+ fail("Failed to create BundleDescription: " + e.getMessage()); //$NON-NLS-1$
}
delta = state.resolve(new BundleDescription[] {state.getBundle(1)});
deltas = delta.getChanges();
- assertEquals("1.0", 3, deltas.length);
+ assertEquals("1.0", 3, deltas.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("1.1", deltasMap.get(new Long(1)));
- assertNotNull("1.2", deltasMap.get(new Long(2)));
- assertNotNull("1.3", deltasMap.get(new Long(3)));
- assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType());
- assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType());
- assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType());
+ assertNotNull("1.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
+ assertNotNull("1.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
+ assertNotNull("1.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
+ assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
+ assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
+ assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
delta = state.resolve(new BundleDescription[] {state.getBundle(1)});
deltas = delta.getChanges();
- assertEquals("3.0", 3, deltas.length);
+ assertEquals("3.0", 3, deltas.length); //$NON-NLS-1$
deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("3.1", deltasMap.get(new Long(1)));
- assertNotNull("3.2", deltasMap.get(new Long(2)));
- assertNotNull("3.3", deltasMap.get(new Long(3)));
- assertEquals("3.4", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(1))).getType());
- assertEquals("3.5", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(2))).getType());
- assertEquals("3.6", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(3))).getType());
+ assertNotNull("3.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
+ assertNotNull("3.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
+ assertNotNull("3.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
+ assertEquals("3.4", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
+ assertEquals("3.5", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
+ assertEquals("3.6", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
}
public void testUpdate() throws BundleException {
State state = buildEmptyState();
- String B1_LOCATION = "org.eclipse.b";
- final String B1_RESOLVED = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 1.0\n";
- final String B1_UNRESOLVED = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 2.0\nRequire-Bundle: non.existant.bundle\n";
+ String B1_LOCATION = "org.eclipse.b"; //$NON-NLS-1$
+ final String B1_RESOLVED = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 1.0\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ final String B1_UNRESOLVED = "Bundle-SymbolicName: org.eclipse.b1\n" + "Bundle-Version: 2.0\nRequire-Bundle: non.existant.bundle\n"; //$NON-NLS-1$ //$NON-NLS-2$
BundleDescription b1 = state.getFactory().createBundleDescription(parseManifest(B1_RESOLVED), B1_LOCATION, 1);
- assertTrue("0.9", state.addBundle(b1));
+ assertTrue("0.9", state.addBundle(b1)); //$NON-NLS-1$
StateDelta delta = state.resolve();
b1 = state.getBundleByLocation(b1.getLocation());
BundleDelta[] changes = delta.getChanges();
- assertEquals("1.0", 1, changes.length);
- assertEquals("1.1", b1, changes[0].getBundle());
- assertEquals("1.2", (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[0].getType());
- assertFullyResolved("1.3", b1);
- assertTrue("1.8", contains(state.getResolvedBundles(), b1));
+ assertEquals("1.0", 1, changes.length); //$NON-NLS-1$
+ assertEquals("1.1", b1, changes[0].getBundle()); //$NON-NLS-1$
+ assertEquals("1.2", (BundleDelta.ADDED | BundleDelta.RESOLVED), changes[0].getType()); //$NON-NLS-1$
+ assertFullyResolved("1.3", b1); //$NON-NLS-1$
+ assertTrue("1.8", contains(state.getResolvedBundles(), b1)); //$NON-NLS-1$
BundleDescription b11 = state.getFactory().createBundleDescription(parseManifest(B1_UNRESOLVED), B1_LOCATION, 1);
- assertTrue("1.8b", state.updateBundle(b11));
+ assertTrue("1.8b", state.updateBundle(b11)); //$NON-NLS-1$
b11 = state.getBundle(b11.getBundleId());
- assertTrue("1.9", !contains(state.getResolvedBundles(), b11));
+ assertTrue("1.9", !contains(state.getResolvedBundles(), b11)); //$NON-NLS-1$
delta = state.resolve();
changes = delta.getChanges();
- assertEquals("2.0", 2, changes.length);
+ assertEquals("2.0", 2, changes.length); //$NON-NLS-1$
HashMap deltasMap = new HashMap();
for (int i = 0; i < changes.length; i++)
deltasMap.put(changes[i].getBundle(), changes[i]);
- assertNotNull("2.1", deltasMap.get(b1));
- assertNotNull("2.2", deltasMap.get(b11));
- assertEquals("2.3", BundleDelta.UNRESOLVED, ((BundleDelta) deltasMap.get(b1)).getType());
- assertEquals("2.4", BundleDelta.UPDATED, ((BundleDelta) deltasMap.get(b11)).getType());
+ assertNotNull("2.1", deltasMap.get(b1)); //$NON-NLS-1$
+ assertNotNull("2.2", deltasMap.get(b11)); //$NON-NLS-1$
+ assertEquals("2.3", BundleDelta.UNRESOLVED, ((BundleDelta) deltasMap.get(b1)).getType()); //$NON-NLS-1$
+ assertEquals("2.4", BundleDelta.UPDATED, ((BundleDelta) deltasMap.get(b11)).getType()); //$NON-NLS-1$
BundleDescription b111 = state.getFactory().createBundleDescription(parseManifest(B1_RESOLVED), B1_LOCATION, 1);
- assertTrue("3.0", state.updateBundle(b111));
+ assertTrue("3.0", state.updateBundle(b111)); //$NON-NLS-1$
b111 = state.getBundle(b111.getBundleId());
- assertTrue("3.1", !contains(state.getResolvedBundles(), b111));
+ assertTrue("3.1", !contains(state.getResolvedBundles(), b111)); //$NON-NLS-1$
delta = state.resolve();
changes = delta.getChanges();
- assertEquals("3.2", 1, changes.length);
- assertEquals("3.1", b111, changes[0].getBundle());
- assertEquals("3.2", BundleDelta.UPDATED | BundleDelta.RESOLVED, changes[0].getType());
- assertFullyResolved("3.3", b111);
+ assertEquals("3.2", 1, changes.length); //$NON-NLS-1$
+ assertEquals("3.1", b111, changes[0].getBundle()); //$NON-NLS-1$
+ assertEquals("3.2", BundleDelta.UPDATED | BundleDelta.RESOLVED, changes[0].getType()); //$NON-NLS-1$
+ assertFullyResolved("3.3", b111); //$NON-NLS-1$
}
public void testSingletons() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.1");
- BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.1"); //$NON-NLS-1$
+ BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.1");
- BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.1"); //$NON-NLS-1$
+ BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 3); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.dependent; singleton:=true");
- manifest.put(Constants.REQUIRE_BUNDLE, "test.host; bundle-version=\"[1.0.1,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testDependent = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.dependent; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "test.host; bundle-version=\"[1.0.1,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testDependent = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 4); //$NON-NLS-1$
state.addBundle(testHost100);
state.addBundle(testFrag100);
@@ -576,11 +576,11 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(testFrag101);
state.addBundle(testDependent);
state.resolve();
- assertFalse("1.0", testHost100.isResolved());
- assertTrue("1.1", testHost101.isResolved());
- assertFalse("1.2", testFrag100.isResolved());
- assertTrue("1.3", testFrag101.isResolved());
- assertTrue("1.4", testDependent.isResolved());
+ assertFalse("1.0", testHost100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", testHost101.isResolved()); //$NON-NLS-1$
+ assertFalse("1.2", testFrag100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", testFrag101.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", testDependent.isResolved()); //$NON-NLS-1$
}
public void testSingletonsSameVersion() throws BundleException {
@@ -588,30 +588,30 @@ public class StateResolverTest extends AbstractStateTest {
// with multiple singleton bundles installed with the same BSN and version
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 3); //$NON-NLS-1$
state.addBundle(testHost100);
state.addBundle(testFrag100);
@@ -619,10 +619,10 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(testHost101);
state.addBundle(testFrag101);
state.resolve();
- assertTrue("1.0", testHost100.isResolved());
- assertFalse("1.1", testHost101.isResolved());
- assertTrue("1.2", testFrag100.isResolved());
- assertFalse("1.3", testFrag101.isResolved());
+ assertTrue("1.0", testHost100.isResolved()); //$NON-NLS-1$
+ assertFalse("1.1", testHost101.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", testFrag100.isResolved()); //$NON-NLS-1$
+ assertFalse("1.3", testFrag101.isResolved()); //$NON-NLS-1$
}
public void testSingletonsSelection1() throws BundleException {
@@ -631,31 +631,31 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\"");
- BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 3); //$NON-NLS-1$
state.addBundle(sdk10);
state.addBundle(platform10);
@@ -663,43 +663,43 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(gef10);
state.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.3", gef10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", 4); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", 5);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", 5); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", 6);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", 6); //$NON-NLS-1$
state.addBundle(sdk20);
state.addBundle(platform20);
state.addBundle(rcp20);
state.resolve(false);
- assertTrue("2.0", sdk20.isResolved());
- assertTrue("2.1", platform20.isResolved());
- assertTrue("2.2", rcp10.isResolved());
- assertTrue("2.3", gef10.isResolved());
- assertFalse("2.4", sdk10.isResolved());
- assertFalse("2.5", platform10.isResolved());
- assertFalse("2.6", rcp20.isResolved());
+ assertTrue("2.0", sdk20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1", platform20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", gef10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.4", sdk10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.5", platform10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.6", rcp20.isResolved()); //$NON-NLS-1$
}
public void testSingletonsSelection2() throws BundleException {
@@ -708,38 +708,38 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles; test with cycle added
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\", cycle");
- BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\", cycle"); //$NON-NLS-1$
+ BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\", sdk");
- BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\", sdk"); //$NON-NLS-1$
+ BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 3); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "cycle; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "gef");
- BundleDescription cycle10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "cycle; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "gef"); //$NON-NLS-1$
+ BundleDescription cycle10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 4); //$NON-NLS-1$
state.addBundle(sdk10);
state.addBundle(platform10);
@@ -748,45 +748,45 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(cycle10);
state.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.3", gef10.isResolved());
- assertTrue("1.4", cycle10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", cycle10.isResolved()); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", 5);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", 5); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", 6);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", 6); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", 7);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", 7); //$NON-NLS-1$
state.addBundle(sdk20);
state.addBundle(platform20);
state.addBundle(rcp20);
state.resolve(false);
- assertTrue("2.0", sdk20.isResolved());
- assertTrue("2.1", platform20.isResolved());
- assertTrue("2.2", rcp10.isResolved());
- assertTrue("2.3", gef10.isResolved());
- assertTrue("2.4", cycle10.isResolved());
- assertFalse("2.5", sdk10.isResolved());
- assertFalse("2.6", platform10.isResolved());
- assertFalse("2.7", rcp20.isResolved());
+ assertTrue("2.0", sdk20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1", platform20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", gef10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.4", cycle10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.5", sdk10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.6", platform10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.7", rcp20.isResolved()); //$NON-NLS-1$
}
public void testSingletonsSelection3() throws BundleException {
@@ -795,73 +795,73 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles; with fragments
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "sdk");
- BundleDescription sdk_frag10 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "sdk"); //$NON-NLS-1$
+ BundleDescription sdk_frag10 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "sdk; bundle-version=2.0");
- BundleDescription sdk_frag210 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag210", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "sdk; bundle-version=2.0"); //$NON-NLS-1$
+ BundleDescription sdk_frag210 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag210", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "platform");
- BundleDescription platform_frag10 = state.getFactory().createBundleDescription(state, manifest, "platform.frag10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "platform"); //$NON-NLS-1$
+ BundleDescription platform_frag10 = state.getFactory().createBundleDescription(state, manifest, "platform.frag10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "platform; bundle-version=2.0");
- BundleDescription platform_frag210 = state.getFactory().createBundleDescription(state, manifest, "platform.frag210", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "platform; bundle-version=2.0"); //$NON-NLS-1$
+ BundleDescription platform_frag210 = state.getFactory().createBundleDescription(state, manifest, "platform.frag210", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "rcp");
- BundleDescription rcp_frag10 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "rcp"); //$NON-NLS-1$
+ BundleDescription rcp_frag10 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "rcp; bundle-version=2.0");
- BundleDescription rcp_frag210 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag210", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "rcp; bundle-version=2.0"); //$NON-NLS-1$
+ BundleDescription rcp_frag210 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag210", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\"");
- BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", bundleID++); //$NON-NLS-1$
state.addBundle(sdk10);
state.addBundle(sdk_frag10);
@@ -875,55 +875,55 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(gef10);
state.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.0.1", sdk_frag10.isResolved());
- assertFalse("1.0.2", sdk_frag210.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.1.1", platform_frag10.isResolved());
- assertFalse("1.1.2", platform_frag210.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.2.1", rcp_frag10.isResolved());
- assertFalse("1.2.2", rcp_frag210.isResolved());
- assertTrue("1.3", gef10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.0.1", sdk_frag10.isResolved()); //$NON-NLS-1$
+ assertFalse("1.0.2", sdk_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1.1", platform_frag10.isResolved()); //$NON-NLS-1$
+ assertFalse("1.1.2", platform_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2.1", rcp_frag10.isResolved()); //$NON-NLS-1$
+ assertFalse("1.2.2", rcp_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", bundleID++); //$NON-NLS-1$
state.addBundle(sdk20);
state.addBundle(platform20);
state.addBundle(rcp20);
state.resolve(false);
- assertTrue("2.0", sdk20.isResolved());
- assertTrue("2.0.1", sdk_frag10.isResolved());
- assertTrue("2.0.2", sdk_frag210.isResolved());
- assertTrue("2.1", platform20.isResolved());
- assertTrue("2.1.1", platform_frag10.isResolved());
- assertTrue("2.1.2", platform_frag210.isResolved());
- assertTrue("2.2", rcp10.isResolved());
- assertTrue("2.2.1", rcp_frag10.isResolved());
- assertTrue("2.3", gef10.isResolved());
- assertFalse("2.4", sdk10.isResolved());
- assertFalse("2.5", platform10.isResolved());
- assertFalse("2.6", rcp20.isResolved());
- assertFalse("2.2.2", rcp_frag210.isResolved());
+ assertTrue("2.0", sdk20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.0.1", sdk_frag10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.0.2", sdk_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1", platform20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1.1", platform_frag10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1.2", platform_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2.1", rcp_frag10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", gef10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.4", sdk10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.5", platform10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.6", rcp20.isResolved()); //$NON-NLS-1$
+ assertFalse("2.2.2", rcp_frag210.isResolved()); //$NON-NLS-1$
}
public void testSingletonsSelection4() throws BundleException {
@@ -932,76 +932,76 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles; with fragments using Import-Package
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "sdk; version=1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "platform; version=\"[1.0,2.0]\"");
- BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "sdk; version=1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "platform; version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "sdk");
- BundleDescription sdk_frag10 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "sdk"); //$NON-NLS-1$
+ BundleDescription sdk_frag10 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "sdk; bundle-version=2.0");
- BundleDescription sdk_frag210 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag210", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "sdk; bundle-version=2.0"); //$NON-NLS-1$
+ BundleDescription sdk_frag210 = state.getFactory().createBundleDescription(state, manifest, "sdk.frag210", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "platform; version=1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "rcp; version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "platform; version=1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "rcp; version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "platform");
- BundleDescription platform_frag10 = state.getFactory().createBundleDescription(state, manifest, "platform.frag10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "platform"); //$NON-NLS-1$
+ BundleDescription platform_frag10 = state.getFactory().createBundleDescription(state, manifest, "platform.frag10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "platform; bundle-version=2.0");
- BundleDescription platform_frag210 = state.getFactory().createBundleDescription(state, manifest, "platform.frag210", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "platform; bundle-version=2.0"); //$NON-NLS-1$
+ BundleDescription platform_frag210 = state.getFactory().createBundleDescription(state, manifest, "platform.frag210", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "rcp; version=1.0");
- BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "rcp; version=1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "rcp");
- BundleDescription rcp_frag10 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "rcp"); //$NON-NLS-1$
+ BundleDescription rcp_frag10 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag10", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "rcp; bundle-version=2.0");
- BundleDescription rcp_frag210 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag210", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp.frag2; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "rcp; bundle-version=2.0"); //$NON-NLS-1$
+ BundleDescription rcp_frag210 = state.getFactory().createBundleDescription(state, manifest, "rcp.frag210", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "rcp; version=\"[1.0,1.0]\"");
- BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "rcp; version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", bundleID++); //$NON-NLS-1$
state.addBundle(sdk10);
state.addBundle(sdk_frag10);
@@ -1015,58 +1015,58 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(gef10);
state.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.0.1", sdk_frag10.isResolved());
- assertFalse("1.0.2", sdk_frag210.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.1.1", platform_frag10.isResolved());
- assertFalse("1.1.2", platform_frag210.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.2.1", rcp_frag10.isResolved());
- assertFalse("1.2.2", rcp_frag210.isResolved());
- assertTrue("1.3", gef10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.0.1", sdk_frag10.isResolved()); //$NON-NLS-1$
+ assertFalse("1.0.2", sdk_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1.1", platform_frag10.isResolved()); //$NON-NLS-1$
+ assertFalse("1.1.2", platform_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2.1", rcp_frag10.isResolved()); //$NON-NLS-1$
+ assertFalse("1.2.2", rcp_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.EXPORT_PACKAGE, "sdk; version=2.0");
- manifest.put(Constants.IMPORT_PACKAGE, "platform; version=\"[1.0,2.0]\"");
- BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "sdk; version=2.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "platform; version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.EXPORT_PACKAGE, "platform; version=2.0");
- manifest.put(Constants.IMPORT_PACKAGE, "rcp; version=\"[1.0,2.0]\"");
- BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "platform; version=2.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "rcp; version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.EXPORT_PACKAGE, "rcp; version=2.0");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.EXPORT_PACKAGE, "rcp; version=2.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", bundleID++); //$NON-NLS-1$
state.addBundle(sdk20);
state.addBundle(platform20);
state.addBundle(rcp20);
state.resolve(false);
- assertTrue("2.0", sdk20.isResolved());
- assertTrue("2.0.1", sdk_frag10.isResolved());
- assertTrue("2.0.2", sdk_frag210.isResolved());
- assertTrue("2.1", platform20.isResolved());
- assertTrue("2.1.1", platform_frag10.isResolved());
- assertTrue("2.1.2", platform_frag210.isResolved());
- assertTrue("2.2", rcp10.isResolved());
- assertTrue("2.2.1", rcp_frag10.isResolved());
- assertTrue("2.3", gef10.isResolved());
- assertFalse("2.4", sdk10.isResolved());
- assertFalse("2.5", platform10.isResolved());
- assertFalse("2.6", rcp20.isResolved());
- assertFalse("2.2.2", rcp_frag210.isResolved());
+ assertTrue("2.0", sdk20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.0.1", sdk_frag10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.0.2", sdk_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1", platform20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1.1", platform_frag10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1.2", platform_frag210.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2.1", rcp_frag10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", gef10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.4", sdk10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.5", platform10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.6", rcp20.isResolved()); //$NON-NLS-1$
+ assertFalse("2.2.2", rcp_frag210.isResolved()); //$NON-NLS-1$
}
public void testSingletonsSelection5() throws BundleException {
@@ -1074,75 +1074,75 @@ public class StateResolverTest extends AbstractStateTest {
long id = 0;
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "base; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription base10 = state.getFactory().createBundleDescription(state, manifest, "base10", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "base; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription base10 = state.getFactory().createBundleDescription(state, manifest, "base10", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "base; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.1");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.6");
- BundleDescription base11 = state.getFactory().createBundleDescription(state, manifest, "base11", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "base; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.6"); //$NON-NLS-1$
+ BundleDescription base11 = state.getFactory().createBundleDescription(state, manifest, "base11", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "requires; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "base; bundle-version=\"[1.0,1.1)\"");
- BundleDescription requires10 = state.getFactory().createBundleDescription(state, manifest, "requires10", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "requires; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "base; bundle-version=\"[1.0,1.1)\""); //$NON-NLS-1$
+ BundleDescription requires10 = state.getFactory().createBundleDescription(state, manifest, "requires10", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "requires; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.1");
- manifest.put(Constants.REQUIRE_BUNDLE, "base; bundle-version=\"[1.1,1.2)\"");
- BundleDescription requires11 = state.getFactory().createBundleDescription(state, manifest, "requires11", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "requires; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.1"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "base; bundle-version=\"[1.1,1.2)\""); //$NON-NLS-1$
+ BundleDescription requires11 = state.getFactory().createBundleDescription(state, manifest, "requires11", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.0,1.1)\"");
- BundleDescription frag10 = state.getFactory().createBundleDescription(state, manifest, "frag10", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.0,1.1)\""); //$NON-NLS-1$
+ BundleDescription frag10 = state.getFactory().createBundleDescription(state, manifest, "frag10", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "frag; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.1");
- manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.1,1.2)\"");
- BundleDescription frag11 = state.getFactory().createBundleDescription(state, manifest, "frag11", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "frag; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.1"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.1,1.2)\""); //$NON-NLS-1$
+ BundleDescription frag11 = state.getFactory().createBundleDescription(state, manifest, "frag11", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "fragb; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.0,1.1)\"");
- manifest.put(Constants.EXPORT_PACKAGE, "fragb; version=1.0");
- BundleDescription fragb10 = state.getFactory().createBundleDescription(state, manifest, "frag10", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "fragb; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.0,1.1)\""); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "fragb; version=1.0"); //$NON-NLS-1$
+ BundleDescription fragb10 = state.getFactory().createBundleDescription(state, manifest, "frag10", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "fragb; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.1");
- manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.0,1.1)\"");
- manifest.put(Constants.EXPORT_PACKAGE, "fragb; version=1.1");
- BundleDescription fragb11 = state.getFactory().createBundleDescription(state, manifest, "frag11", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "fragb; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.1"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "requires; bundle-version=\"[1.0,1.1)\""); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "fragb; version=1.1"); //$NON-NLS-1$
+ BundleDescription fragb11 = state.getFactory().createBundleDescription(state, manifest, "frag11", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "import");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "fragb; version=\"[1.0,1.0]\"");
- BundleDescription import10 = state.getFactory().createBundleDescription(state, manifest, "import10", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "import"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "fragb; version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription import10 = state.getFactory().createBundleDescription(state, manifest, "import10", id++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "import");
- manifest.put(Constants.BUNDLE_VERSION, "1.1");
- manifest.put(Constants.IMPORT_PACKAGE, "fragb; version=\"[1.1,1.1]\"");
- BundleDescription import11 = state.getFactory().createBundleDescription(state, manifest, "import11", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "import"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.1"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "fragb; version=\"[1.1,1.1]\""); //$NON-NLS-1$
+ BundleDescription import11 = state.getFactory().createBundleDescription(state, manifest, "import11", id++); //$NON-NLS-1$
state.addBundle(base10);
state.addBundle(base11);
@@ -1156,16 +1156,16 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(import11);
state.resolve();
- assertTrue("1.0", base10.isResolved());
- assertTrue("1.1", requires10.isResolved());
- assertTrue("1.2", frag10.isResolved());
- assertTrue("1.3", fragb11.isResolved());
- assertTrue("1.4", import11.isResolved());
- assertFalse("1.5", base11.isResolved());
- assertFalse("1.6", requires11.isResolved());
- assertFalse("1.7", frag11.isResolved());
- assertFalse("1.8", fragb10.isResolved());
- assertFalse("1.9", import10.isResolved());
+ assertTrue("1.0", base10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", requires10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", frag10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", fragb11.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", import11.isResolved()); //$NON-NLS-1$
+ assertFalse("1.5", base11.isResolved()); //$NON-NLS-1$
+ assertFalse("1.6", requires11.isResolved()); //$NON-NLS-1$
+ assertFalse("1.7", frag11.isResolved()); //$NON-NLS-1$
+ assertFalse("1.8", fragb10.isResolved()); //$NON-NLS-1$
+ assertFalse("1.9", import10.isResolved()); //$NON-NLS-1$
}
public void testSingletonsSelection6() throws BundleException {
@@ -1174,31 +1174,31 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk10 = state.getFactory().createBundleDescription(state, manifest, "sdk10", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state.getFactory().createBundleDescription(state, manifest, "platform10", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state.getFactory().createBundleDescription(state, manifest, "rcp10", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\"");
- BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription gef10 = state.getFactory().createBundleDescription(state, manifest, "gef10", 3); //$NON-NLS-1$
state.addBundle(sdk10);
state.addBundle(platform10);
@@ -1206,30 +1206,30 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(gef10);
state.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.3", gef10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk20 = state.getFactory().createBundleDescription(state, manifest, "sdk20", 4); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", 5);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform20 = state.getFactory().createBundleDescription(state, manifest, "platform20", 5); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", 6);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ BundleDescription rcp20 = state.getFactory().createBundleDescription(state, manifest, "rcp20", 6); //$NON-NLS-1$
state.removeBundle(sdk10);
state.removeBundle(platform10);
@@ -1246,13 +1246,13 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(gef10);
state.resolve(false);
- assertTrue("2.0", sdk20.isResolved());
- assertTrue("2.1", platform20.isResolved());
- assertTrue("2.2", rcp10.isResolved());
- assertTrue("2.3", gef10.isResolved());
- assertFalse("2.4", sdk10.isResolved());
- assertFalse("2.5", platform10.isResolved());
- assertFalse("2.6", rcp20.isResolved());
+ assertTrue("2.0", sdk20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.1", platform20.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", gef10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.4", sdk10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.5", platform10.isResolved()); //$NON-NLS-1$
+ assertFalse("2.6", rcp20.isResolved()); //$NON-NLS-1$
}
public void testNonSingletonsSameVersion() throws BundleException {
@@ -1260,30 +1260,30 @@ public class StateResolverTest extends AbstractStateTest {
// with multiple singleton bundles installed with the same BSN and version
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", 3); //$NON-NLS-1$
state.addBundle(testHost100);
state.addBundle(testFrag100);
@@ -1291,50 +1291,50 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(testHost101);
state.addBundle(testFrag101);
state.resolve();
- assertTrue("1.0", testHost100.isResolved());
- assertTrue("1.1", testHost101.isResolved());
- assertTrue("1.2", testFrag100.isResolved());
- assertTrue("1.3", testFrag101.isResolved());
+ assertTrue("1.0", testHost100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", testHost101.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", testFrag100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", testFrag101.isResolved()); //$NON-NLS-1$
}
public void testTransitiveUses() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a");
- BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a");
- BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2");
- BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2"); //$NON-NLS-1$
+ BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b");
- manifest.put(Constants.IMPORT_PACKAGE, "b");
- BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b"); //$NON-NLS-1$
+ BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 3); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a, c");
- BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a, c"); //$NON-NLS-1$
+ BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 4); //$NON-NLS-1$
state.addBundle(a1_100);
state.addBundle(a2_100);
@@ -1346,62 +1346,62 @@ public class StateResolverTest extends AbstractStateTest {
ExportPackageDescription[] b1ResolvedImports = b1_100.getResolvedImports();
ExportPackageDescription[] d1ResolvedImports = d1_100.getResolvedImports();
ExportPackageDescription[] isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1");
- b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1"); //$NON-NLS-1$
+ b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2); //$NON-NLS-1$
state.updateBundle(b1_100);
state.resolve();
b1ResolvedImports = b1_100.getResolvedImports();
d1ResolvedImports = d1_100.getResolvedImports();
isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("1.2 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("1.2 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
}
public void testMultipleExportsUses01() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; version=2.0; uses:=d, d; version=2.0");
- BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; version=2.0; uses:=d, d; version=2.0"); //$NON-NLS-1$
+ BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; version=1.0; uses:=d, d; version=1.0");
- BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; version=1.0; uses:=d, d; version=1.0"); //$NON-NLS-1$
+ BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b, b; mandatory:=\"test\"; test=value; uses:=d");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2, d");
- BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b, b; mandatory:=\"test\"; test=value; uses:=d"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2, d"); //$NON-NLS-1$
+ BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b");
- manifest.put(Constants.IMPORT_PACKAGE, "b; test=value, d");
- BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b; test=value, d"); //$NON-NLS-1$
+ BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 3); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a, c, d");
- BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a, c, d"); //$NON-NLS-1$
+ BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 4); //$NON-NLS-1$
state.addBundle(a1_100);
state.addBundle(a2_100);
@@ -1413,120 +1413,120 @@ public class StateResolverTest extends AbstractStateTest {
ExportPackageDescription[] b1ResolvedImports = b1_100.getResolvedImports();
ExportPackageDescription[] d1ResolvedImports = d1_100.getResolvedImports();
ExportPackageDescription[] isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1");
- b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1"); //$NON-NLS-1$
+ b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2); //$NON-NLS-1$
state.updateBundle(b1_100);
state.resolve();
b1ResolvedImports = b1_100.getResolvedImports();
d1ResolvedImports = d1_100.getResolvedImports();
isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("1.2 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("1.2 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
}
public void testRequireBundleUses() throws BundleException {
State state = buildEmptyState();
int id = 0;
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a");
- BundleDescription a_100 = state.getFactory().createBundleDescription(state, manifest, "a_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription a_100 = state.getFactory().createBundleDescription(state, manifest, "a_100", id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "2.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a");
- BundleDescription a_200 = state.getFactory().createBundleDescription(state, manifest, "a_200", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription a_200 = state.getFactory().createBundleDescription(state, manifest, "a_200", id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.REQUIRE_BUNDLE, "A; visibility:=reexport");
- BundleDescription b_100 = state.getFactory().createBundleDescription(state, manifest, "b_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "A; visibility:=reexport"); //$NON-NLS-1$
+ BundleDescription b_100 = state.getFactory().createBundleDescription(state, manifest, "b_100", id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b");
- manifest.put(Constants.REQUIRE_BUNDLE, "A, B");
- BundleDescription c_100 = state.getFactory().createBundleDescription(state, manifest, "c_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "A, B"); //$NON-NLS-1$
+ BundleDescription c_100 = state.getFactory().createBundleDescription(state, manifest, "c_100", id++); //$NON-NLS-1$
state.addBundle(a_100);
state.addBundle(b_100);
// first resolve just A and B
state.resolve();
- assertTrue("0.1", a_100.isResolved());
- assertTrue("0.2", b_100.isResolved());
+ assertTrue("0.1", a_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", b_100.isResolved()); //$NON-NLS-1$
// now add A v2 and resolve it
state.addBundle(a_200);
state.resolve();
- assertTrue("1.1", a_200.isResolved());
+ assertTrue("1.1", a_200.isResolved()); //$NON-NLS-1$
// now add C and make sure it does not get packages from A v2
state.addBundle(c_100);
state.resolve();
- assertTrue("1.2", c_100.isResolved());
+ assertTrue("1.2", c_100.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] c1ResolvedImports = state.getStateHelper().getVisiblePackages(c_100);
- assertTrue("2.1", c1ResolvedImports.length == 2);
- int index = c1ResolvedImports[0].getName().equals("a") ? 0 : c1ResolvedImports[1].getName().equals("a") ? 1 : -1;
- assertTrue("2.2", index >= 0);
- assertEquals("2.2", c1ResolvedImports[index].getExporter(), a_100);
+ assertTrue("2.1", c1ResolvedImports.length == 2); //$NON-NLS-1$
+ int index = c1ResolvedImports[0].getName().equals("a") ? 0 : c1ResolvedImports[1].getName().equals("a") ? 1 : -1; //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("2.2", index >= 0); //$NON-NLS-1$
+ assertEquals("2.2", c1ResolvedImports[index].getExporter(), a_100); //$NON-NLS-1$
}
public void testCyclicTransitiveUses() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d");
- manifest.put(Constants.IMPORT_PACKAGE, "d");
- BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "d"); //$NON-NLS-1$
+ BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d");
- manifest.put(Constants.IMPORT_PACKAGE, "d");
- BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "d"); //$NON-NLS-1$
+ BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2");
- BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2"); //$NON-NLS-1$
+ BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b");
- manifest.put(Constants.IMPORT_PACKAGE, "b");
- BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b"); //$NON-NLS-1$
+ BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 3); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "d; uses:=c");
- manifest.put(Constants.IMPORT_PACKAGE, "a, c");
- BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "d; uses:=c"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a, c"); //$NON-NLS-1$
+ BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 4); //$NON-NLS-1$
state.addBundle(a1_100);
state.addBundle(a2_100);
@@ -1535,88 +1535,88 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(d1_100);
state.resolve();
- assertFalse("0.1", a1_100.isResolved());
- assertTrue("0.2", a2_100.isResolved());
- assertTrue("0.3", b1_100.isResolved());
- assertTrue("0.4", c1_100.isResolved());
- assertTrue("0.5", d1_100.isResolved());
+ assertFalse("0.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", a2_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", d1_100.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] b1ResolvedImports = b1_100.getResolvedImports();
ExportPackageDescription[] d1ResolvedImports = d1_100.getResolvedImports();
ExportPackageDescription[] isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1");
- b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1"); //$NON-NLS-1$
+ b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2); //$NON-NLS-1$
state.updateBundle(b1_100);
state.resolve();
- assertTrue("2.1", a1_100.isResolved());
- assertFalse("2.2", a2_100.isResolved());
- assertTrue("2.3", b1_100.isResolved());
- assertTrue("2.4", c1_100.isResolved());
- assertTrue("2.5", d1_100.isResolved());
+ assertTrue("2.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("2.2", a2_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.5", d1_100.isResolved()); //$NON-NLS-1$
b1ResolvedImports = b1_100.getResolvedImports();
d1ResolvedImports = d1_100.getResolvedImports();
isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("3.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("3.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
}
public void testFragmentTransitiveUses() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d");
- manifest.put(Constants.IMPORT_PACKAGE, "d");
- BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "d"); //$NON-NLS-1$
+ BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "A1");
- manifest.put(Constants.EXPORT_PACKAGE, "a.frag; uses:=a");
- BundleDescription a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a.frag; uses:=a"); //$NON-NLS-1$
+ BundleDescription a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d, a.frag; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "d");
- BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d, a.frag; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "d"); //$NON-NLS-1$
+ BundleDescription a2_100 = state.getFactory().createBundleDescription(state, manifest, "a2_100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2, a.frag");
- BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A2, a.frag"); //$NON-NLS-1$
+ BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 3); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b");
- manifest.put(Constants.IMPORT_PACKAGE, "b");
- BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 4);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c; uses:=b"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b"); //$NON-NLS-1$
+ BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", 4); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "d; uses:=c");
- manifest.put(Constants.IMPORT_PACKAGE, "a.frag, c");
- BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 5);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "d; uses:=c"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a.frag, c"); //$NON-NLS-1$
+ BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "d1_100", 5); //$NON-NLS-1$
state.addBundle(a1_100);
state.addBundle(a1frag_100);
@@ -1626,71 +1626,71 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(d1_100);
state.resolve();
- assertFalse("0.1", a1_100.isResolved());
- assertTrue("0.2", a2_100.isResolved());
- assertTrue("0.3", b1_100.isResolved());
- assertTrue("0.4", c1_100.isResolved());
- assertTrue("0.5", d1_100.isResolved());
+ assertFalse("0.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", a2_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", d1_100.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] b1ResolvedImports = b1_100.getResolvedImports();
ExportPackageDescription[] d1ResolvedImports = d1_100.getResolvedImports();
ExportPackageDescription[] isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("1.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a");
- manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1");
- b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; uses:=a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a;bundle-symbolic-name=A1"); //$NON-NLS-1$
+ b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", 2); //$NON-NLS-1$
state.updateBundle(b1_100);
state.resolve();
- assertTrue("2.1", a1_100.isResolved());
- assertFalse("2.2", a2_100.isResolved());
- assertTrue("2.3", b1_100.isResolved());
- assertTrue("2.4", c1_100.isResolved());
- assertTrue("2.5", d1_100.isResolved());
+ assertTrue("2.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("2.2", a2_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.5", d1_100.isResolved()); //$NON-NLS-1$
b1ResolvedImports = b1_100.getResolvedImports();
d1ResolvedImports = d1_100.getResolvedImports();
isConsistent = isConsistent(b1ResolvedImports, d1ResolvedImports);
- assertNull("3.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("3.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
}
public void testCyclicUsesExportDrop() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "W");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; b; version=1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "c, a, b");
- BundleDescription w1_100 = state.getFactory().createBundleDescription(state, manifest, "w1_100", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "W"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; b; version=1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "c, a, b"); //$NON-NLS-1$
+ BundleDescription w1_100 = state.getFactory().createBundleDescription(state, manifest, "w1_100", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "X");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c");
- manifest.put(Constants.IMPORT_PACKAGE, "d");
- BundleDescription x1_100 = state.getFactory().createBundleDescription(state, manifest, "x1_100", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "X"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "d"); //$NON-NLS-1$
+ BundleDescription x1_100 = state.getFactory().createBundleDescription(state, manifest, "x1_100", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "Y");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "d");
- manifest.put(Constants.IMPORT_PACKAGE, "a");
- BundleDescription y1_100 = state.getFactory().createBundleDescription(state, manifest, "y1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "Y"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "d"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription y1_100 = state.getFactory().createBundleDescription(state, manifest, "y1_100", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "Z");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; version = 2.0");
- BundleDescription z1_100 = state.getFactory().createBundleDescription(state, manifest, "z1_100", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "Z"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; version = 2.0"); //$NON-NLS-1$
+ BundleDescription z1_100 = state.getFactory().createBundleDescription(state, manifest, "z1_100", 3); //$NON-NLS-1$
state.addBundle(w1_100);
state.addBundle(x1_100);
@@ -1698,38 +1698,38 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(z1_100);
state.resolve();
- assertTrue("0.1", w1_100.isResolved());
- assertTrue("0.2", x1_100.isResolved());
- assertTrue("0.3", y1_100.isResolved());
- assertTrue("0.4", z1_100.isResolved());
+ assertTrue("0.1", w1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", x1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.3", y1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", z1_100.isResolved()); //$NON-NLS-1$
- assertEquals("1.1", 1, w1_100.getSelectedExports().length);
- assertEquals("1.2", "b", w1_100.getSelectedExports()[0].getName());
+ assertEquals("1.1", 1, w1_100.getSelectedExports().length); //$NON-NLS-1$
+ assertEquals("1.2", "b", w1_100.getSelectedExports()[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testRemovalPending() throws BundleException {
State state = buildEmptyState();
Hashtable wManifest = new Hashtable();
- wManifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- wManifest.put(Constants.BUNDLE_SYMBOLICNAME, "W");
- wManifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- wManifest.put(Constants.EXPORT_PACKAGE, "a; b; version=1.0");
- wManifest.put(Constants.IMPORT_PACKAGE, "a, b");
- BundleDescription w1_100 = state.getFactory().createBundleDescription(state, wManifest, "w1_100", 0);
+ wManifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ wManifest.put(Constants.BUNDLE_SYMBOLICNAME, "W"); //$NON-NLS-1$
+ wManifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ wManifest.put(Constants.EXPORT_PACKAGE, "a; b; version=1.0"); //$NON-NLS-1$
+ wManifest.put(Constants.IMPORT_PACKAGE, "a, b"); //$NON-NLS-1$
+ BundleDescription w1_100 = state.getFactory().createBundleDescription(state, wManifest, "w1_100", 0); //$NON-NLS-1$
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "X");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a");
- BundleDescription x1_100 = state.getFactory().createBundleDescription(state, manifest, "x1_100", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "X"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription x1_100 = state.getFactory().createBundleDescription(state, manifest, "x1_100", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "Y");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a");
- BundleDescription y1_100 = state.getFactory().createBundleDescription(state, manifest, "y1_100", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "Y"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription y1_100 = state.getFactory().createBundleDescription(state, manifest, "y1_100", 2); //$NON-NLS-1$
state.addBundle(w1_100);
state.addBundle(x1_100);
@@ -1737,32 +1737,32 @@ public class StateResolverTest extends AbstractStateTest {
state.resolve();
- assertTrue("0.1", w1_100.isResolved());
- assertTrue("0.2", x1_100.isResolved());
- assertTrue("0.3", y1_100.isResolved());
+ assertTrue("0.1", w1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", x1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.3", y1_100.isResolved()); //$NON-NLS-1$
- BundleDescription w1_100_prime = state.getFactory().createBundleDescription(state, wManifest, "w1_100", 0);
+ BundleDescription w1_100_prime = state.getFactory().createBundleDescription(state, wManifest, "w1_100", 0); //$NON-NLS-1$
state.updateBundle(w1_100_prime);
state.resolve(new BundleDescription[0]);
- assertTrue("1.1", w1_100_prime.isResolved());
- assertTrue("1.2", x1_100.isResolved());
- assertTrue("1.3", y1_100.isResolved());
+ assertTrue("1.1", w1_100_prime.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", x1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", y1_100.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] exports_w1_100 = w1_100.getSelectedExports();
ExportPackageDescription[] imports_w1_100_prime = w1_100_prime.getResolvedImports();
ExportPackageDescription[] isConsistent = isConsistent(exports_w1_100, imports_w1_100_prime);
- assertNull("2.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("2.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
state.resolve(new BundleDescription[] {w1_100});
- assertTrue("3.1", w1_100_prime.isResolved());
- assertTrue("3.2", x1_100.isResolved());
- assertTrue("3.3", y1_100.isResolved());
+ assertTrue("3.1", w1_100_prime.isResolved()); //$NON-NLS-1$
+ assertTrue("3.2", x1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("3.3", y1_100.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] exports_w1_100_prime = w1_100_prime.getSelectedExports();
imports_w1_100_prime = w1_100_prime.getResolvedImports();
isConsistent = isConsistent(exports_w1_100_prime, imports_w1_100_prime);
- assertNull("4.1 Packages are not consistent: " + isConsistent, isConsistent);
+ assertNull("4.1 Packages are not consistent: " + isConsistent, isConsistent); //$NON-NLS-1$
}
public void testFragmentConstraints01() throws BundleException {
@@ -1771,43 +1771,43 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a.frag");
- BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a.frag"); //$NON-NLS-1$
+ BundleDescription d1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", id++); //$NON-NLS-1$
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d");
- manifest.put(Constants.IMPORT_PACKAGE, "b; version=2.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[2.0, 3.0)\"");
- BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a; uses:=d"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b; version=2.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[2.0, 3.0)\""); //$NON-NLS-1$
+ BundleDescription a1_100 = state.getFactory().createBundleDescription(state, manifest, "a1_100", id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "A1");
- manifest.put(Constants.EXPORT_PACKAGE, "a.frag");
- manifest.put(Constants.IMPORT_PACKAGE, "b; version=1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[2.0, 3.0)\"");
- BundleDescription a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a.frag"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b; version=1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[2.0, 3.0)\""); //$NON-NLS-1$
+ BundleDescription a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b; version=2.1");
- BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b; version=2.1"); //$NON-NLS-1$
+ BundleDescription b1_100 = state.getFactory().createBundleDescription(state, manifest, "b1_100", id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1");
- manifest.put(Constants.BUNDLE_VERSION, "2.0.1");
- manifest.put(Constants.EXPORT_PACKAGE, "c");
- BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0.1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c"); //$NON-NLS-1$
+ BundleDescription c1_100 = state.getFactory().createBundleDescription(state, manifest, "c1_100", id++); //$NON-NLS-1$
state.addBundle(d1_100);
state.addBundle(a1_100);
@@ -1816,65 +1816,65 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(c1_100);
state.resolve();
- assertTrue("0.1", a1_100.isResolved());
- assertTrue("0.2", a1frag_100.isResolved());
- assertTrue("0.3", b1_100.isResolved());
- assertTrue("0.4", c1_100.isResolved());
- assertTrue("0.5", d1_100.isResolved());
+ assertTrue("0.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", a1frag_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", d1_100.isResolved()); //$NON-NLS-1$
// now use a fragment that has conflicting imports/requires with the host
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "A1");
- manifest.put(Constants.EXPORT_PACKAGE, "a.frag");
- manifest.put(Constants.IMPORT_PACKAGE, "b; version=2.1");
- manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[2.5, 4.0)\"");
- a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", a1frag_100.getBundleId());
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a.frag"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b; version=2.1"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[2.5, 4.0)\""); //$NON-NLS-1$
+ a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", a1frag_100.getBundleId()); //$NON-NLS-1$
state.updateBundle(a1frag_100);
state.resolve(new BundleDescription[] {a1frag_100});
- assertTrue("1.1", a1_100.isResolved());
- assertFalse("1.2", a1frag_100.isResolved());
- assertTrue("1.3", b1_100.isResolved());
- assertTrue("1.4", c1_100.isResolved());
- assertFalse("1.5", d1_100.isResolved());
+ assertTrue("1.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("1.2", a1frag_100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("1.5", d1_100.isResolved()); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "A1");
- manifest.put(Constants.EXPORT_PACKAGE, "a.frag");
- manifest.put(Constants.IMPORT_PACKAGE, "b; version=\"[1.0,2.0)\"");
- a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", a1frag_100.getBundleId());
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a.frag"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b; version=\"[1.0,2.0)\""); //$NON-NLS-1$
+ a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", a1frag_100.getBundleId()); //$NON-NLS-1$
state.updateBundle(a1frag_100);
state.resolve(new BundleDescription[] {a1frag_100});
- assertTrue("2.1", a1_100.isResolved());
- assertFalse("2.2", a1frag_100.isResolved());
- assertTrue("2.3", b1_100.isResolved());
- assertTrue("2.4", c1_100.isResolved());
- assertFalse("2.5", d1_100.isResolved());
+ assertTrue("2.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("2.2", a1frag_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("2.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("2.5", d1_100.isResolved()); //$NON-NLS-1$
// now use a fragment that has conflicting imports/requires with the host
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "A1");
- manifest.put(Constants.EXPORT_PACKAGE, "a.frag");
- manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[1.0, 1.5)\"");
- a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", a1frag_100.getBundleId());
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A1.Frag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A1"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a.frag"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "C1; bundle-version=\"[1.0, 1.5)\""); //$NON-NLS-1$
+ a1frag_100 = state.getFactory().createBundleDescription(state, manifest, "a1frag_100", a1frag_100.getBundleId()); //$NON-NLS-1$
state.updateBundle(a1frag_100);
state.resolve(new BundleDescription[] {a1frag_100});
- assertTrue("3.1", a1_100.isResolved());
- assertFalse("3.2", a1frag_100.isResolved());
- assertTrue("3.3", b1_100.isResolved());
- assertTrue("3.4", c1_100.isResolved());
- assertFalse("3.5", d1_100.isResolved());
+ assertTrue("3.1", a1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("3.2", a1frag_100.isResolved()); //$NON-NLS-1$
+ assertTrue("3.3", b1_100.isResolved()); //$NON-NLS-1$
+ assertTrue("3.4", c1_100.isResolved()); //$NON-NLS-1$
+ assertFalse("3.5", d1_100.isResolved()); //$NON-NLS-1$
}
public void testFragmentConstraints02() throws BundleException {
@@ -1883,42 +1883,42 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, d");
- BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, d"); //$NON-NLS-1$
+ BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, e");
- BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, e"); //$NON-NLS-1$
+ BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c");
- BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c"); //$NON-NLS-1$
+ BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a, b, c");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a, b, c"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
state.addBundle(a);
state.addBundle(aFrag1);
@@ -1927,17 +1927,17 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(b);
state.resolve();
- assertTrue("0.1", a.isResolved());
- assertFalse("0.2", aFrag1.isResolved());
- assertFalse("0.3", aFrag2.isResolved());
- assertTrue("0.4", aFrag3.isResolved());
- assertTrue("0.5", b.isResolved());
+ assertTrue("0.1", a.isResolved()); //$NON-NLS-1$
+ assertFalse("0.2", aFrag1.isResolved()); //$NON-NLS-1$
+ assertFalse("0.3", aFrag2.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", aFrag3.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", b.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] aResolvedImports = a.getResolvedImports();
ExportPackageDescription[] bSelectedExports = b.getSelectedExports();
- assertEquals("1.0", 3, aResolvedImports.length);
- assertEquals("1.1", 3, bSelectedExports.length);
+ assertEquals("1.0", 3, aResolvedImports.length); //$NON-NLS-1$
+ assertEquals("1.1", 3, bSelectedExports.length); //$NON-NLS-1$
for (int i = 0; i < aResolvedImports.length; i++) {
assertEquals(bSelectedExports[i], aResolvedImports[i]);
}
@@ -1950,44 +1950,44 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "x");
- manifest.put(Constants.IMPORT_PACKAGE, "a");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "x"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, d");
- BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, d"); //$NON-NLS-1$
+ BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, e");
- BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, e"); //$NON-NLS-1$
+ BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c");
- BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c"); //$NON-NLS-1$
+ BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a, b, c");
- manifest.put(Constants.IMPORT_PACKAGE, "x");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a, b, c"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "x"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
state.addBundle(a);
state.addBundle(aFrag1);
@@ -1996,24 +1996,24 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(b);
state.resolve();
- assertTrue("0.1", a.isResolved());
- assertFalse("0.2", aFrag1.isResolved());
- assertFalse("0.3", aFrag2.isResolved());
- assertTrue("0.4", aFrag3.isResolved());
- assertTrue("0.5", b.isResolved());
+ assertTrue("0.1", a.isResolved()); //$NON-NLS-1$
+ assertFalse("0.2", aFrag1.isResolved()); //$NON-NLS-1$
+ assertFalse("0.3", aFrag2.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", aFrag3.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", b.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] aResolvedImports = a.getResolvedImports();
ExportPackageDescription[] aSelectedExports = a.getSelectedExports();
ExportPackageDescription[] bResolvedImports = b.getResolvedImports();
ExportPackageDescription[] bSelectedExports = b.getSelectedExports();
- assertEquals("1.0", 3, aResolvedImports.length);
- assertEquals("1.1", 3, bSelectedExports.length);
+ assertEquals("1.0", 3, aResolvedImports.length); //$NON-NLS-1$
+ assertEquals("1.1", 3, bSelectedExports.length); //$NON-NLS-1$
for (int i = 0; i < aResolvedImports.length; i++)
- assertEquals("1.2", bSelectedExports[i], aResolvedImports[i]);
- assertEquals("2.0", 1, aSelectedExports.length);
- assertEquals("2.1", 1, bResolvedImports.length);
- assertEquals("2.2", aSelectedExports[0], bResolvedImports[0]);
+ assertEquals("1.2", bSelectedExports[i], aResolvedImports[i]); //$NON-NLS-1$
+ assertEquals("2.0", 1, aSelectedExports.length); //$NON-NLS-1$
+ assertEquals("2.1", 1, bResolvedImports.length); //$NON-NLS-1$
+ assertEquals("2.2", aSelectedExports[0], bResolvedImports[0]); //$NON-NLS-1$
}
public void testFragmentConstraints04() throws BundleException {
@@ -2022,56 +2022,56 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "b");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "b"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e");
- BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e"); //$NON-NLS-1$
+ BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f");
- BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f"); //$NON-NLS-1$
+ BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d");
- BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d"); //$NON-NLS-1$
+ BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b1, b2, b3");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b1, b2, b3"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3");
- BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3"); //$NON-NLS-1$
+ BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3");
- BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3"); //$NON-NLS-1$
+ BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
state.addBundle(a);
state.addBundle(aFrag1);
@@ -2082,19 +2082,19 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(d);
state.resolve();
- assertTrue("0.1", a.isResolved());
- assertFalse("0.2", aFrag1.isResolved());
- assertFalse("0.3", aFrag2.isResolved());
- assertTrue("0.4", aFrag3.isResolved());
- assertTrue("0.5", b.isResolved());
- assertTrue("0.6", c.isResolved());
- assertTrue("0.7", d.isResolved());
+ assertTrue("0.1", a.isResolved()); //$NON-NLS-1$
+ assertFalse("0.2", aFrag1.isResolved()); //$NON-NLS-1$
+ assertFalse("0.3", aFrag2.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", aFrag3.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", b.isResolved()); //$NON-NLS-1$
+ assertTrue("0.6", c.isResolved()); //$NON-NLS-1$
+ assertTrue("0.7", d.isResolved()); //$NON-NLS-1$
BundleDescription[] aResolvedRequires = a.getResolvedRequires();
- assertEquals("1.0", 3, aResolvedRequires.length);
- assertEquals("1.1", b, aResolvedRequires[0]);
- assertEquals("1.2", c, aResolvedRequires[1]);
- assertEquals("1.3", d, aResolvedRequires[2]);
+ assertEquals("1.0", 3, aResolvedRequires.length); //$NON-NLS-1$
+ assertEquals("1.1", b, aResolvedRequires[0]); //$NON-NLS-1$
+ assertEquals("1.2", c, aResolvedRequires[1]); //$NON-NLS-1$
+ assertEquals("1.3", d, aResolvedRequires[2]); //$NON-NLS-1$
}
public void testFragmentConstraints05() throws BundleException {
@@ -2104,57 +2104,57 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "b");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "b"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e");
- BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e"); //$NON-NLS-1$
+ BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f");
- BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f"); //$NON-NLS-1$
+ BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d");
- BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d"); //$NON-NLS-1$
+ BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "b1, b2, b3");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "b1, b2, b3"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3");
- BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3"); //$NON-NLS-1$
+ BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "a");
- manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3");
- BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "a"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3"); //$NON-NLS-1$
+ BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
state.addBundle(a);
state.addBundle(aFrag1);
@@ -2165,22 +2165,22 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(d);
state.resolve();
- assertTrue("0.1", a.isResolved());
- assertFalse("0.2", aFrag1.isResolved());
- assertFalse("0.3", aFrag2.isResolved());
- assertTrue("0.4", aFrag3.isResolved());
- assertTrue("0.5", b.isResolved());
- assertTrue("0.6", c.isResolved());
- assertTrue("0.7", d.isResolved());
+ assertTrue("0.1", a.isResolved()); //$NON-NLS-1$
+ assertFalse("0.2", aFrag1.isResolved()); //$NON-NLS-1$
+ assertFalse("0.3", aFrag2.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", aFrag3.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", b.isResolved()); //$NON-NLS-1$
+ assertTrue("0.6", c.isResolved()); //$NON-NLS-1$
+ assertTrue("0.7", d.isResolved()); //$NON-NLS-1$
BundleDescription[] aResolvedRequires = a.getResolvedRequires();
- assertEquals("1.0", 3, aResolvedRequires.length);
- assertEquals("1.1", b, aResolvedRequires[0]);
- assertEquals("1.2", c, aResolvedRequires[1]);
- assertEquals("1.3", d, aResolvedRequires[2]);
+ assertEquals("1.0", 3, aResolvedRequires.length); //$NON-NLS-1$
+ assertEquals("1.1", b, aResolvedRequires[0]); //$NON-NLS-1$
+ assertEquals("1.2", c, aResolvedRequires[1]); //$NON-NLS-1$
+ assertEquals("1.3", d, aResolvedRequires[2]); //$NON-NLS-1$
BundleDescription[] dResolvedRequires = d.getResolvedRequires();
- assertEquals("2.0", 1, dResolvedRequires.length);
- assertEquals("2.1", a, dResolvedRequires[0]);
+ assertEquals("2.0", 1, dResolvedRequires.length); //$NON-NLS-1$
+ assertEquals("2.1", a, dResolvedRequires[0]); //$NON-NLS-1$
}
public void testFragmentConstraints06() throws BundleException {
@@ -2189,60 +2189,60 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "b");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "b"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, d");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e");
- BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, d"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e"); //$NON-NLS-1$
+ BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, e");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f");
- BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, e"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f"); //$NON-NLS-1$
+ BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d");
- BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d"); //$NON-NLS-1$
+ BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a, b, c");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a, b, c"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3");
- BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3"); //$NON-NLS-1$
+ BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3");
- BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3"); //$NON-NLS-1$
+ BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
state.addBundle(a);
state.addBundle(aFrag1);
@@ -2253,28 +2253,28 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(d);
state.resolve();
- assertTrue("0.1", a.isResolved());
- assertFalse("0.2", aFrag1.isResolved());
- assertFalse("0.3", aFrag2.isResolved());
- assertTrue("0.4", aFrag3.isResolved());
- assertTrue("0.5", b.isResolved());
- assertTrue("0.6", c.isResolved());
- assertTrue("0.7", d.isResolved());
+ assertTrue("0.1", a.isResolved()); //$NON-NLS-1$
+ assertFalse("0.2", aFrag1.isResolved()); //$NON-NLS-1$
+ assertFalse("0.3", aFrag2.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", aFrag3.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", b.isResolved()); //$NON-NLS-1$
+ assertTrue("0.6", c.isResolved()); //$NON-NLS-1$
+ assertTrue("0.7", d.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] aResolvedImports = a.getResolvedImports();
ExportPackageDescription[] bSelectedExports = b.getSelectedExports();
- assertEquals("1.0", 3, aResolvedImports.length);
- assertEquals("1.1", 3, bSelectedExports.length);
+ assertEquals("1.0", 3, aResolvedImports.length); //$NON-NLS-1$
+ assertEquals("1.1", 3, bSelectedExports.length); //$NON-NLS-1$
for (int i = 0; i < aResolvedImports.length; i++) {
assertEquals(bSelectedExports[i], aResolvedImports[i]);
}
BundleDescription[] aResolvedRequires = a.getResolvedRequires();
- assertEquals("1.0", 3, aResolvedRequires.length);
- assertEquals("1.1", b, aResolvedRequires[0]);
- assertEquals("1.2", c, aResolvedRequires[1]);
- assertEquals("1.3", d, aResolvedRequires[2]);
+ assertEquals("1.0", 3, aResolvedRequires.length); //$NON-NLS-1$
+ assertEquals("1.1", b, aResolvedRequires[0]); //$NON-NLS-1$
+ assertEquals("1.2", c, aResolvedRequires[1]); //$NON-NLS-1$
+ assertEquals("1.3", d, aResolvedRequires[2]); //$NON-NLS-1$
}
public void testFragmentConstraints07() throws BundleException {
@@ -2284,63 +2284,63 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "x");
- manifest.put(Constants.IMPORT_PACKAGE, "a");
- manifest.put(Constants.REQUIRE_BUNDLE, "b");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "x"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "b"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, d");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e");
- BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, d"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, e"); //$NON-NLS-1$
+ BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c, e");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f");
- BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c, e"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d, f"); //$NON-NLS-1$
+ BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.FRAGMENT_HOST, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "b, c");
- manifest.put(Constants.REQUIRE_BUNDLE, "c, d");
- BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "aFrag3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "b, c"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "c, d"); //$NON-NLS-1$
+ BundleDescription aFrag3 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a, b, c");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a, b, c"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3");
- BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "c"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c1, c2, c3"); //$NON-NLS-1$
+ BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3");
- manifest.put(Constants.IMPORT_PACKAGE, "x");
- manifest.put(Constants.REQUIRE_BUNDLE, "a");
- BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "d"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "d1, d2, d3"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "x"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "a"); //$NON-NLS-1$
+ BundleDescription d = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + manifest.get(Constants.BUNDLE_VERSION), id++); //$NON-NLS-1$
state.addBundle(a);
state.addBundle(aFrag1);
@@ -2351,33 +2351,33 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(d);
state.resolve();
- assertTrue("0.1", a.isResolved());
- assertFalse("0.2", aFrag1.isResolved());
- assertFalse("0.3", aFrag2.isResolved());
- assertTrue("0.4", aFrag3.isResolved());
- assertTrue("0.5", b.isResolved());
- assertTrue("0.6", c.isResolved());
- assertTrue("0.7", d.isResolved());
+ assertTrue("0.1", a.isResolved()); //$NON-NLS-1$
+ assertFalse("0.2", aFrag1.isResolved()); //$NON-NLS-1$
+ assertFalse("0.3", aFrag2.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", aFrag3.isResolved()); //$NON-NLS-1$
+ assertTrue("0.5", b.isResolved()); //$NON-NLS-1$
+ assertTrue("0.6", c.isResolved()); //$NON-NLS-1$
+ assertTrue("0.7", d.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] aResolvedImports = a.getResolvedImports();
ExportPackageDescription[] aSelectedExports = a.getSelectedExports();
ExportPackageDescription[] bSelectedExports = b.getSelectedExports();
ExportPackageDescription[] dResolvedImports = d.getResolvedImports();
- assertEquals("1.0", 3, aResolvedImports.length);
- assertEquals("1.1", 3, bSelectedExports.length);
+ assertEquals("1.0", 3, aResolvedImports.length); //$NON-NLS-1$
+ assertEquals("1.1", 3, bSelectedExports.length); //$NON-NLS-1$
for (int i = 0; i < aResolvedImports.length; i++) {
assertEquals(bSelectedExports[i], aResolvedImports[i]);
}
BundleDescription[] aResolvedRequires = a.getResolvedRequires();
- assertEquals("1.0", 3, aResolvedRequires.length);
- assertEquals("1.1", b, aResolvedRequires[0]);
- assertEquals("1.2", c, aResolvedRequires[1]);
- assertEquals("1.3", d, aResolvedRequires[2]);
- assertEquals("2.0", 1, aSelectedExports.length);
- assertEquals("2.1", 1, dResolvedImports.length);
- assertEquals("2.2", aSelectedExports[0], dResolvedImports[0]);
+ assertEquals("1.0", 3, aResolvedRequires.length); //$NON-NLS-1$
+ assertEquals("1.1", b, aResolvedRequires[0]); //$NON-NLS-1$
+ assertEquals("1.2", c, aResolvedRequires[1]); //$NON-NLS-1$
+ assertEquals("1.3", d, aResolvedRequires[2]); //$NON-NLS-1$
+ assertEquals("2.0", 1, aSelectedExports.length); //$NON-NLS-1$
+ assertEquals("2.1", 1, dResolvedImports.length); //$NON-NLS-1$
+ assertEquals("2.2", aSelectedExports[0], dResolvedImports[0]); //$NON-NLS-1$
}
public void testFragmentsBug188199() throws BundleException {
@@ -2387,64 +2387,64 @@ public class StateResolverTest extends AbstractStateTest {
// resolve the largest set of bundles; with fragments using Import-Package
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "a");
- manifest.put(Constants.IMPORT_PACKAGE, "c");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "c"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "AFrag");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "A");
- manifest.put(Constants.EXPORT_PACKAGE, "a.frag");
- BundleDescription aFrag = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "AFrag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "a.frag"); //$NON-NLS-1$
+ BundleDescription aFrag = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "a, a.frag");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "a, a.frag"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "c");
- BundleDescription c = state.getFactory().createBundleDescription(state, manifest, "C", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "c"); //$NON-NLS-1$
+ BundleDescription c = state.getFactory().createBundleDescription(state, manifest, "C", bundleID++); //$NON-NLS-1$
state.addBundle(a);
state.addBundle(aFrag);
state.addBundle(b);
state.addBundle(c);
state.resolve();
- assertTrue("0.1", a.isResolved());
- assertTrue("0.2", aFrag.isResolved());
- assertTrue("0.3", b.isResolved());
- assertTrue("0.4", c.isResolved());
+ assertTrue("0.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", aFrag.isResolved()); //$NON-NLS-1$
+ assertTrue("0.3", b.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", c.isResolved()); //$NON-NLS-1$
state.removeBundle(c);
state.resolve(false);
- assertFalse("1.1", a.isResolved());
- assertFalse("1.2", aFrag.isResolved());
- assertFalse("1.3", b.isResolved());
+ assertFalse("1.1", a.isResolved()); //$NON-NLS-1$
+ assertFalse("1.2", aFrag.isResolved()); //$NON-NLS-1$
+ assertFalse("1.3", b.isResolved()); //$NON-NLS-1$
state.addBundle(c);
state.resolve();
- assertTrue("2.1", a.isResolved());
- assertTrue("2.2", aFrag.isResolved());
- assertTrue("2.3", b.isResolved());
- assertTrue("2.4", c.isResolved());
+ assertTrue("2.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", aFrag.isResolved()); //$NON-NLS-1$
+ assertTrue("2.3", b.isResolved()); //$NON-NLS-1$
+ assertTrue("2.4", c.isResolved()); //$NON-NLS-1$
ExportPackageDescription[] aExports = a.getSelectedExports();
ExportPackageDescription[] bImports = b.getResolvedImports();
- assertTrue("3.1", aExports.length == 2);
- assertTrue("3.2", bImports.length == 2);
- assertTrue("3.3", aExports[0] == bImports[0]);
- assertTrue("3.4", aExports[1] == bImports[1]);
+ assertTrue("3.1", aExports.length == 2); //$NON-NLS-1$
+ assertTrue("3.2", bImports.length == 2); //$NON-NLS-1$
+ assertTrue("3.3", aExports[0] == bImports[0]); //$NON-NLS-1$
+ assertTrue("3.4", aExports[1] == bImports[1]); //$NON-NLS-1$
}
public void testFragmentsMultipleVersion() throws BundleException {
@@ -2454,29 +2454,29 @@ public class StateResolverTest extends AbstractStateTest {
// resolve the largest set of bundles; with fragments using Import-Package
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
BundleDescription a1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + '_' + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "AFrag");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "A");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "AFrag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A"); //$NON-NLS-1$
BundleDescription aFrag1 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + '_' + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
BundleDescription a2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + '_' + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "AFrag");
- manifest.put(Constants.BUNDLE_VERSION, "2.0");
- manifest.put(Constants.FRAGMENT_HOST, "A");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "AFrag"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "A"); //$NON-NLS-1$
BundleDescription aFrag2 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + '_' + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
state.addBundle(a1);
@@ -2484,17 +2484,17 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(a2);
state.addBundle(aFrag2);
state.resolve();
- assertTrue("0.1", a1.isResolved());
- assertTrue("0.2", aFrag1.isResolved());
- assertTrue("0.3", a2.isResolved());
- assertTrue("0.4", aFrag2.isResolved());
+ assertTrue("0.1", a1.isResolved()); //$NON-NLS-1$
+ assertTrue("0.2", aFrag1.isResolved()); //$NON-NLS-1$
+ assertTrue("0.3", a2.isResolved()); //$NON-NLS-1$
+ assertTrue("0.4", aFrag2.isResolved()); //$NON-NLS-1$
state.removeBundle(a2);
state.resolve(false);
- assertTrue("1.1", a1.isResolved());
- assertTrue("1.2", aFrag2.isResolved());
- assertFalse("1.3", aFrag1.isResolved());
- assertEquals("1.4", a1, aFrag2.getHost().getSupplier());
+ assertTrue("1.1", a1.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", aFrag2.isResolved()); //$NON-NLS-1$
+ assertFalse("1.3", aFrag1.isResolved()); //$NON-NLS-1$
+ assertEquals("1.4", a1, aFrag2.getHost().getSupplier()); //$NON-NLS-1$
}
public void testPlatformProperties01() throws BundleException {
@@ -2503,38 +2503,38 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles; with fragments using Import-Package
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.osgi");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription systemBundle = state.getFactory().createBundleDescription(state, manifest, "org.eclipse.osgi", bundleID++);
-
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.b, pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.4");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
-
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "pkg.b");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
-
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "system.b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2");
- BundleDescription systemB = state.getFactory().createBundleDescription(state, manifest, "system.b", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.osgi"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription systemBundle = state.getFactory().createBundleDescription(state, manifest, "org.eclipse.osgi", bundleID++); //$NON-NLS-1$
+
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.b, pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.4"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
+
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "pkg.b"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++); //$NON-NLS-1$
+
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription systemB = state.getFactory().createBundleDescription(state, manifest, "system.b", bundleID++); //$NON-NLS-1$
Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable()};
- props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.c");
- props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2");
- props[1].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b, pkg.system.c");
- props[1].put("org.osgi.framework.executionenvironment", "J2SE-1.4");
+ props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.executionenvironment", "J2SE-1.4"); //$NON-NLS-1$ //$NON-NLS-2$
state.setPlatformProperties(props);
state.addBundle(systemBundle);
@@ -2543,33 +2543,33 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(systemB);
state.resolve();
- assertTrue("1.0", systemBundle.isResolved());
- assertTrue("1.1", a.isResolved());
- assertTrue("1.2", b.isResolved());
- assertTrue("1.3", systemB.isResolved());
+ assertTrue("1.0", systemBundle.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", b.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", systemB.isResolved()); //$NON-NLS-1$
- assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemBundle);
- assertTrue("2.1", b.getResolvedImports()[0].getExporter() == systemB);
+ assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.1", b.getResolvedImports()[0].getExporter() == systemB); //$NON-NLS-1$
// now test the uses clause for pkg.b such that bundle 'A' will be forced to used
// pkg.system from bundle 'system.b'
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "pkg.b; uses:=\"pkg.system.b\"");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2");
- BundleDescription b_updated = state.getFactory().createBundleDescription(state, manifest, "B", b.getBundleId());
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "pkg.b; uses:=\"pkg.system.b\""); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription b_updated = state.getFactory().createBundleDescription(state, manifest, "B", b.getBundleId()); //$NON-NLS-1$
state.updateBundle(b_updated);
state.resolve(new BundleDescription[] {b_updated});
- assertTrue("3.0", systemBundle.isResolved());
- assertTrue("3.1", a.isResolved());
- assertTrue("3.2", b_updated.isResolved());
- assertTrue("3.3", systemB.isResolved());
+ assertTrue("3.0", systemBundle.isResolved()); //$NON-NLS-1$
+ assertTrue("3.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("3.2", b_updated.isResolved()); //$NON-NLS-1$
+ assertTrue("3.3", systemB.isResolved()); //$NON-NLS-1$
- assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemB);
- assertTrue("2.1", b_updated.getResolvedImports()[0].getExporter() == systemB);
+ assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemB); //$NON-NLS-1$
+ assertTrue("2.1", b_updated.getResolvedImports()[0].getExporter() == systemB); //$NON-NLS-1$
}
public void testPlatformProperties02() throws BundleException {
@@ -2579,39 +2579,39 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles; with fragments using Import-Package
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.system.bundle");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription systemBundle = state.getFactory().createBundleDescription(state, manifest, "test.system.bundle", bundleID++);
-
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.b, pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.4");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
-
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "pkg.b");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
-
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "system.b");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2");
- BundleDescription systemB = state.getFactory().createBundleDescription(state, manifest, "system.b", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.system.bundle"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription systemBundle = state.getFactory().createBundleDescription(state, manifest, "test.system.bundle", bundleID++); //$NON-NLS-1$
+
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.b, pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.4"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
+
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "pkg.b"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++); //$NON-NLS-1$
+
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription systemB = state.getFactory().createBundleDescription(state, manifest, "system.b", bundleID++); //$NON-NLS-1$
Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable()};
- props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.c");
- props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2");
- props[0].put("osgi.system.bundle", "test.system.bundle"); // set the system.bundle to another system bundle (other than org.eclipse.osgi)
- props[1].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b, pkg.system.c");
- props[1].put("org.osgi.framework.executionenvironment", "J2SE-1.4");
+ props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.system.bundle", "test.system.bundle"); // set the system.bundle to another system bundle (other than org.eclipse.osgi) //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.executionenvironment", "J2SE-1.4"); //$NON-NLS-1$ //$NON-NLS-2$
state.setPlatformProperties(props);
state.addBundle(systemBundle);
@@ -2620,108 +2620,108 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(systemB);
state.resolve();
- assertTrue("1.0", systemBundle.isResolved());
- assertTrue("1.1", a.isResolved());
- assertTrue("1.2", b.isResolved());
- assertTrue("1.3", systemB.isResolved());
+ assertTrue("1.0", systemBundle.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", b.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", systemB.isResolved()); //$NON-NLS-1$
- assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemBundle);
- assertTrue("2.1", b.getResolvedImports()[0].getExporter() == systemB);
+ assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.1", b.getResolvedImports()[0].getExporter() == systemB); //$NON-NLS-1$
// now test the uses clause for pkg.b such that bundle 'A' will be forced to used
// pkg.system from bundle 'system.b'
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.EXPORT_PACKAGE, "pkg.b; uses:=\"pkg.system.b\"");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b");
- manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2");
- BundleDescription b_updated = state.getFactory().createBundleDescription(state, manifest, "B", b.getBundleId());
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.EXPORT_PACKAGE, "pkg.b; uses:=\"pkg.system.b\""); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription b_updated = state.getFactory().createBundleDescription(state, manifest, "B", b.getBundleId()); //$NON-NLS-1$
state.updateBundle(b_updated);
state.resolve(new BundleDescription[] {b_updated});
- assertTrue("3.0", systemBundle.isResolved());
- assertTrue("3.1", a.isResolved());
- assertTrue("3.2", b_updated.isResolved());
- assertTrue("3.3", systemB.isResolved());
+ assertTrue("3.0", systemBundle.isResolved()); //$NON-NLS-1$
+ assertTrue("3.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("3.2", b_updated.isResolved()); //$NON-NLS-1$
+ assertTrue("3.3", systemB.isResolved()); //$NON-NLS-1$
- assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemB);
- assertTrue("2.1", b_updated.getResolvedImports()[0].getExporter() == systemB);
+ assertTrue("2.0", a.getResolvedImports()[1].getExporter() == systemB); //$NON-NLS-1$
+ assertTrue("2.1", b_updated.getResolvedImports()[0].getExporter() == systemB); //$NON-NLS-1$
}
public void testPlatformProperties03() throws BundleException {
// test that require-bundle, fragment-host, and import-package of system.bundle can be aliased properly
State state = buildEmptyState();
int bundleID = 0;
- String configuredSystemBundle = "org.eclipse.osgi";
+ String configuredSystemBundle = "org.eclipse.osgi"; //$NON-NLS-1$
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles; with fragments using Import-Package
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
manifest.put(Constants.BUNDLE_SYMBOLICNAME, configuredSystemBundle);
- manifest.put(Constants.EXPORT_PACKAGE, "system.bundle.exported.pkg");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
+ manifest.put(Constants.EXPORT_PACKAGE, "system.bundle.exported.pkg"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
BundleDescription systemBundle = state.getFactory().createBundleDescription(state, manifest, configuredSystemBundle, bundleID++);
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "system.bundle");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "system.bundle"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
manifest.put(Constants.REQUIRE_BUNDLE, configuredSystemBundle);
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"system.bundle\"");
- BundleDescription c = state.getFactory().createBundleDescription(state, manifest, "C", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"system.bundle\""); //$NON-NLS-1$
+ BundleDescription c = state.getFactory().createBundleDescription(state, manifest, "C", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"" + configuredSystemBundle + "\"");
- BundleDescription d = state.getFactory().createBundleDescription(state, manifest, "D", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"" + configuredSystemBundle + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription d = state.getFactory().createBundleDescription(state, manifest, "D", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "E");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"system.bundle\"");
- BundleDescription e = state.getFactory().createBundleDescription(state, manifest, "E", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "E"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"system.bundle\""); //$NON-NLS-1$
+ BundleDescription e = state.getFactory().createBundleDescription(state, manifest, "E", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "F");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"" + configuredSystemBundle + "\"");
- BundleDescription f = state.getFactory().createBundleDescription(state, manifest, "F", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "F"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"" + configuredSystemBundle + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription f = state.getFactory().createBundleDescription(state, manifest, "F", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "G");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "system.bundle");
- BundleDescription g = state.getFactory().createBundleDescription(state, manifest, "G", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "G"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "system.bundle"); //$NON-NLS-1$
+ BundleDescription g = state.getFactory().createBundleDescription(state, manifest, "G", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "H");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "H"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
manifest.put(Constants.FRAGMENT_HOST, configuredSystemBundle);
- BundleDescription h = state.getFactory().createBundleDescription(state, manifest, "H", bundleID++);
+ BundleDescription h = state.getFactory().createBundleDescription(state, manifest, "H", bundleID++); //$NON-NLS-1$
Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable()};
- props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b");
- props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2");
+ props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2"); //$NON-NLS-1$ //$NON-NLS-2$
state.setPlatformProperties(props);
state.addBundle(systemBundle);
@@ -2735,24 +2735,24 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(h);
state.resolve();
- assertTrue("1.0", systemBundle.isResolved());
- assertTrue("1.1", a.isResolved());
- assertTrue("1.2", b.isResolved());
- assertTrue("1.3", c.isResolved());
- assertTrue("1.4", d.isResolved());
- assertTrue("1.5", e.isResolved());
- assertTrue("1.6", f.isResolved());
- assertTrue("1.7", g.isResolved());
- assertTrue("1.8", h.isResolved());
-
- assertTrue("2.0", a.getResolvedRequires()[0] == systemBundle);
- assertTrue("2.1", b.getResolvedRequires()[0] == systemBundle);
- assertTrue("2.2", c.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.3", d.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.4", e.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.5", f.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.6", g.getHost().getHosts()[0] == systemBundle);
- assertTrue("2.7", h.getHost().getHosts()[0] == systemBundle);
+ assertTrue("1.0", systemBundle.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", b.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", c.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", d.isResolved()); //$NON-NLS-1$
+ assertTrue("1.5", e.isResolved()); //$NON-NLS-1$
+ assertTrue("1.6", f.isResolved()); //$NON-NLS-1$
+ assertTrue("1.7", g.isResolved()); //$NON-NLS-1$
+ assertTrue("1.8", h.isResolved()); //$NON-NLS-1$
+
+ assertTrue("2.0", a.getResolvedRequires()[0] == systemBundle); //$NON-NLS-1$
+ assertTrue("2.1", b.getResolvedRequires()[0] == systemBundle); //$NON-NLS-1$
+ assertTrue("2.2", c.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.3", d.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.4", e.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.5", f.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.6", g.getHost().getHosts()[0] == systemBundle); //$NON-NLS-1$
+ assertTrue("2.7", h.getHost().getHosts()[0] == systemBundle); //$NON-NLS-1$
}
public void testPlatformProperties04() throws BundleException {
@@ -2760,76 +2760,76 @@ public class StateResolverTest extends AbstractStateTest {
// test that require-bundle, fragment-host, and import-package of system.bundle can be aliased properly
State state = buildEmptyState();
int bundleID = 0;
- String configuredSystemBundle = "test.system.bundle";
+ String configuredSystemBundle = "test.system.bundle"; //$NON-NLS-1$
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles; with fragments using Import-Package
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
manifest.put(Constants.BUNDLE_SYMBOLICNAME, configuredSystemBundle);
- manifest.put(Constants.EXPORT_PACKAGE, "system.bundle.exported.pkg");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
+ manifest.put(Constants.EXPORT_PACKAGE, "system.bundle.exported.pkg"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
BundleDescription systemBundle = state.getFactory().createBundleDescription(state, manifest, configuredSystemBundle, bundleID++);
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "system.bundle");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "system.bundle"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
manifest.put(Constants.REQUIRE_BUNDLE, configuredSystemBundle);
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"system.bundle\"");
- BundleDescription c = state.getFactory().createBundleDescription(state, manifest, "C", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"system.bundle\""); //$NON-NLS-1$
+ BundleDescription c = state.getFactory().createBundleDescription(state, manifest, "C", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"" + configuredSystemBundle + "\"");
- BundleDescription d = state.getFactory().createBundleDescription(state, manifest, "D", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "system.bundle.exported.pkg; bundle-symbolic-name=\"" + configuredSystemBundle + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription d = state.getFactory().createBundleDescription(state, manifest, "D", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "E");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"system.bundle\"");
- BundleDescription e = state.getFactory().createBundleDescription(state, manifest, "E", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "E"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"system.bundle\""); //$NON-NLS-1$
+ BundleDescription e = state.getFactory().createBundleDescription(state, manifest, "E", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "F");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"" + configuredSystemBundle + "\"");
- BundleDescription f = state.getFactory().createBundleDescription(state, manifest, "F", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "F"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.a; bundle-symbolic-name=\"" + configuredSystemBundle + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription f = state.getFactory().createBundleDescription(state, manifest, "F", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "G");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.FRAGMENT_HOST, "system.bundle");
- BundleDescription g = state.getFactory().createBundleDescription(state, manifest, "G", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "G"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "system.bundle"); //$NON-NLS-1$
+ BundleDescription g = state.getFactory().createBundleDescription(state, manifest, "G", bundleID++); //$NON-NLS-1$
manifest.clear();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "H");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "H"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
manifest.put(Constants.FRAGMENT_HOST, configuredSystemBundle);
- BundleDescription h = state.getFactory().createBundleDescription(state, manifest, "H", bundleID++);
+ BundleDescription h = state.getFactory().createBundleDescription(state, manifest, "H", bundleID++); //$NON-NLS-1$
Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable()};
- props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b");
- props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2");
- props[0].put("osgi.system.bundle", configuredSystemBundle); // set the system.bundle to another system bundle (other than org.eclipse.osgi)
+ props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.system.bundle", configuredSystemBundle); // set the system.bundle to another system bundle (other than org.eclipse.osgi) //$NON-NLS-1$
state.setPlatformProperties(props);
state.addBundle(systemBundle);
@@ -2843,24 +2843,24 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(h);
state.resolve();
- assertTrue("1.0", systemBundle.isResolved());
- assertTrue("1.1", a.isResolved());
- assertTrue("1.2", b.isResolved());
- assertTrue("1.3", c.isResolved());
- assertTrue("1.4", d.isResolved());
- assertTrue("1.5", e.isResolved());
- assertTrue("1.6", f.isResolved());
- assertTrue("1.7", g.isResolved());
- assertTrue("1.8", h.isResolved());
-
- assertTrue("2.0", a.getResolvedRequires()[0] == systemBundle);
- assertTrue("2.1", b.getResolvedRequires()[0] == systemBundle);
- assertTrue("2.2", c.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.3", d.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.4", e.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.5", f.getResolvedImports()[0].getExporter() == systemBundle);
- assertTrue("2.6", g.getHost().getHosts()[0] == systemBundle);
- assertTrue("2.7", h.getHost().getHosts()[0] == systemBundle);
+ assertTrue("1.0", systemBundle.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", b.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", c.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", d.isResolved()); //$NON-NLS-1$
+ assertTrue("1.5", e.isResolved()); //$NON-NLS-1$
+ assertTrue("1.6", f.isResolved()); //$NON-NLS-1$
+ assertTrue("1.7", g.isResolved()); //$NON-NLS-1$
+ assertTrue("1.8", h.isResolved()); //$NON-NLS-1$
+
+ assertTrue("2.0", a.getResolvedRequires()[0] == systemBundle); //$NON-NLS-1$
+ assertTrue("2.1", b.getResolvedRequires()[0] == systemBundle); //$NON-NLS-1$
+ assertTrue("2.2", c.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.3", d.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.4", e.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.5", f.getResolvedImports()[0].getExporter() == systemBundle); //$NON-NLS-1$
+ assertTrue("2.6", g.getHost().getHosts()[0] == systemBundle); //$NON-NLS-1$
+ assertTrue("2.7", h.getHost().getHosts()[0] == systemBundle); //$NON-NLS-1$
}
public void testPlatformPropertiesBug188075() throws BundleException, IOException {
@@ -2869,40 +2869,40 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put("Eclipse-PlatformFilter", "(!(test=value))");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put("Eclipse-PlatformFilter", "(!(test=value))"); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put("Eclipse-PlatformFilter", "(test=value)");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put("Eclipse-PlatformFilter", "(test=value)"); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++); //$NON-NLS-1$
Dictionary props = new Hashtable();
- props.put("test", "value");
+ props.put("test", "value"); //$NON-NLS-1$ //$NON-NLS-2$
state.setPlatformProperties(props);
state.addBundle(a);
state.addBundle(b);
state.resolve();
- assertFalse("1.1", a.isResolved());
- assertTrue("1.2", b.isResolved());
+ assertFalse("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", b.isResolved()); //$NON-NLS-1$
BundleContext context = OSGiTestsActivator.getContext();
- File stateCache = context.getDataFile("statecache");
+ File stateCache = context.getDataFile("statecache"); //$NON-NLS-1$
stateCache.mkdirs();
StateObjectFactory.defaultFactory.writeState(state, stateCache);
state = StateObjectFactory.defaultFactory.readState(stateCache);
props = state.getPlatformProperties()[0];
- assertEquals("2.0", "value", props.get("test"));
- BundleDescription aCache = state.getBundle("A", null);
- BundleDescription bCache = state.getBundle("B", null);
- assertFalse("2.1", aCache.isResolved());
- assertTrue("2.2", bCache.isResolved());
+ assertEquals("2.0", "value", props.get("test")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ BundleDescription aCache = state.getBundle("A", null); //$NON-NLS-1$
+ BundleDescription bCache = state.getBundle("B", null); //$NON-NLS-1$
+ assertFalse("2.1", aCache.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", bCache.isResolved()); //$NON-NLS-1$
}
public void testPlatformPropertiesBug207500a() throws BundleException, IOException {
@@ -2911,20 +2911,20 @@ public class StateResolverTest extends AbstractStateTest {
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put("Eclipse-PlatformFilter", "(test=value1)");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put("Eclipse-PlatformFilter", "(test=value1)"); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put("Eclipse-PlatformFilter", "(test=value2)");
- BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put("Eclipse-PlatformFilter", "(test=value2)"); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription b = state.getFactory().createBundleDescription(state, manifest, "B", bundleID++); //$NON-NLS-1$
Dictionary props = new Hashtable();
- props.put("test", new CatchAllValue("*"));
+ props.put("test", new CatchAllValue("*")); //$NON-NLS-1$ //$NON-NLS-2$
state.setPlatformProperties(props);
state.addBundle(a);
@@ -2932,28 +2932,28 @@ public class StateResolverTest extends AbstractStateTest {
state.resolve();
// Both should resolve
- assertTrue("1.1", a.isResolved());
- assertTrue("1.2", b.isResolved());
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", b.isResolved()); //$NON-NLS-1$
BundleContext context = OSGiTestsActivator.getContext();
- File stateCache = context.getDataFile("statecache");
+ File stateCache = context.getDataFile("statecache"); //$NON-NLS-1$
stateCache.mkdirs();
StateObjectFactory.defaultFactory.writeState(state, stateCache);
state = StateObjectFactory.defaultFactory.readState(stateCache);
props = state.getPlatformProperties()[0];
// we do not persist custom properties
- assertNull("2.0", props.get("test"));
- BundleDescription aCache = state.getBundle("A", null);
- BundleDescription bCache = state.getBundle("B", null);
- assertTrue("2.1", aCache.isResolved());
- assertTrue("2.2", bCache.isResolved());
+ assertNull("2.0", props.get("test")); //$NON-NLS-1$ //$NON-NLS-2$
+ BundleDescription aCache = state.getBundle("A", null); //$NON-NLS-1$
+ BundleDescription bCache = state.getBundle("B", null); //$NON-NLS-1$
+ assertTrue("2.1", aCache.isResolved()); //$NON-NLS-1$
+ assertTrue("2.2", bCache.isResolved()); //$NON-NLS-1$
// re-resolve without the custom value
state.setResolver(platformAdmin.getResolver());
state.resolve(false);
// both should fail to resolve
- assertFalse("3.1", aCache.isResolved());
- assertFalse("3.2", bCache.isResolved());
+ assertFalse("3.1", aCache.isResolved()); //$NON-NLS-1$
+ assertFalse("3.2", bCache.isResolved()); //$NON-NLS-1$
}
public void testPlatformPropertiesBug207500b() throws BundleException, IOException {
@@ -2961,24 +2961,133 @@ public class StateResolverTest extends AbstractStateTest {
int bundleID = 0;
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.BUNDLE_NATIVECODE, "libwrapper-linux-x86-32.so; wrapper-linux-x86-32; osname=linux; processor=x86");
- BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "a"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "libwrapper-linux-x86-32.so; wrapper-linux-x86-32; osname=linux; processor=x86"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
Dictionary props = new Hashtable();
- props.put("osgi.os", new CatchAllValue("*"));
- props.put("osgi.arch", new CatchAllValue("*"));
- props.put("osgi.lang", new CatchAllValue("*"));
- props.put("osgi.ws", new CatchAllValue("*"));
+ props.put("osgi.os", new CatchAllValue("*")); //$NON-NLS-1$ //$NON-NLS-2$
+ props.put("osgi.arch", new CatchAllValue("*")); //$NON-NLS-1$ //$NON-NLS-2$
+ props.put("osgi.lang", new CatchAllValue("*")); //$NON-NLS-1$ //$NON-NLS-2$
+ props.put("osgi.ws", new CatchAllValue("*")); //$NON-NLS-1$ //$NON-NLS-2$
state.setPlatformProperties(props);
state.addBundle(a);
state.resolve();
// should resolve
- assertTrue("1.1", a.isResolved());
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ }
+
+ public void testPlatformPropertiesBug246640a() throws BundleException {
+ State state = buildEmptyState();
+ int bundleID = 0;
+ String configuredSystemBundle = "org.eclipse.osgi; singleton:=true"; //$NON-NLS-1$
+ // test the selection algorithm of the resolver to pick the bundles which
+ // resolve the largest set of bundles; with fragments using Import-Package
+ Hashtable manifest = new Hashtable();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, configuredSystemBundle);
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription systemBundle1 = state.getFactory().createBundleDescription(state, manifest, configuredSystemBundle + manifest.get(Constants.BUNDLE_VERSION), bundleID++);
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, configuredSystemBundle);
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ BundleDescription systemBundle2 = state.getFactory().createBundleDescription(state, manifest, configuredSystemBundle + manifest.get(Constants.BUNDLE_VERSION), bundleID++);
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "require.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "org.eclipse.osgi; bundle-version=2.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription requireSystemBundle = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++);
+
+ Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable()};
+ props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.executionenvironment", "J2SE-1.4"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ state.setPlatformProperties(props);
+ state.addBundle(systemBundle1);
+ state.addBundle(systemBundle2);
+ state.addBundle(a);
+ state.addBundle(requireSystemBundle);
+ state.resolve();
+
+ assertFalse("1.0", systemBundle1.isResolved()); //$NON-NLS-1$
+ assertTrue("1.0.1", systemBundle2.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", requireSystemBundle.isResolved()); //$NON-NLS-1$
+
+ assertTrue("2.0", a.getResolvedImports()[0].getExporter() == systemBundle2); //$NON-NLS-1$
+ }
+
+ public void testPlatformPropertiesBug246640b() throws BundleException {
+ State state = buildEmptyState();
+ int bundleID = 0;
+ String configuredSystemBundle = "test.system.bundle; singleton:=true"; //$NON-NLS-1$
+ // test the selection algorithm of the resolver to pick the bundles which
+ // resolve the largest set of bundles; with fragments using Import-Package
+ Hashtable manifest = new Hashtable();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, configuredSystemBundle);
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription systemBundle1 = state.getFactory().createBundleDescription(state, manifest, configuredSystemBundle + manifest.get(Constants.BUNDLE_VERSION), bundleID++);
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, configuredSystemBundle);
+ manifest.put(Constants.BUNDLE_VERSION, "2.0"); //$NON-NLS-1$
+ BundleDescription systemBundle2 = state.getFactory().createBundleDescription(state, manifest, configuredSystemBundle + manifest.get(Constants.BUNDLE_VERSION), bundleID++);
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.IMPORT_PACKAGE, "pkg.system.b"); //$NON-NLS-1$
+ BundleDescription a = state.getFactory().createBundleDescription(state, manifest, "A", bundleID++); //$NON-NLS-1$
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "require.system.b"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "test.system.bundle; bundle-version=2.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "J2SE-1.2"); //$NON-NLS-1$
+ BundleDescription requireSystemBundle = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++);
+
+ Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable()};
+ props[0].put("osgi.system.bundle", "test.system.bundle"); // set the system.bundle to another system bundle (other than org.eclipse.osgi) //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("org.osgi.framework.executionenvironment", "J2SE-1.2"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.system.packages", "pkg.system.a, pkg.system.b, pkg.system.c"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("org.osgi.framework.executionenvironment", "J2SE-1.4"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ state.setPlatformProperties(props);
+ state.addBundle(systemBundle1);
+ state.addBundle(systemBundle2);
+ state.addBundle(a);
+ state.addBundle(requireSystemBundle);
+ state.resolve();
+
+ assertFalse("1.0", systemBundle1.isResolved()); //$NON-NLS-1$
+ assertTrue("1.0.1", systemBundle2.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", a.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", requireSystemBundle.isResolved()); //$NON-NLS-1$
+
+ assertTrue("2.0", a.getResolvedImports()[0].getExporter() == systemBundle2); //$NON-NLS-1$
}
private ExportPackageDescription[] isConsistent(ExportPackageDescription[] pkgs1, ExportPackageDescription[] pkgs2) {
@@ -3013,37 +3122,37 @@ public class StateResolverTest extends AbstractStateTest {
});
Hashtable manifest = new Hashtable();
long bundleID = 0;
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.1");
- BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.1"); //$NON-NLS-1$
+ BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.1");
- BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.1"); //$NON-NLS-1$
+ BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.dependent; singleton:=true");
- manifest.put(Constants.REQUIRE_BUNDLE, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testDependent = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.dependent; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testDependent = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++); //$NON-NLS-1$
state.addBundle(testHost100);
state.addBundle(testFrag100);
@@ -3051,48 +3160,48 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(testFrag101);
state.addBundle(testDependent);
state.resolve();
- assertTrue("1.0", testHost100.isResolved());
- assertFalse("1.1", testHost101.isResolved());
- assertTrue("1.2", testFrag100.isResolved());
- assertFalse("1.3", testFrag101.isResolved());
- assertTrue("1.4", testDependent.isResolved());
+ assertTrue("1.0", testHost100.isResolved()); //$NON-NLS-1$
+ assertFalse("1.1", testHost101.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", testFrag100.isResolved()); //$NON-NLS-1$
+ assertFalse("1.3", testFrag101.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", testDependent.isResolved()); //$NON-NLS-1$
}
public void testBug187616() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
long bundleID = 0;
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.1");
- BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.1"); //$NON-NLS-1$
+ BundleDescription testHost101 = state.getFactory().createBundleDescription(state, manifest, "test.host101", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.1");
- BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.1"); //$NON-NLS-1$
+ BundleDescription testFrag101 = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.dependent; singleton:=true");
- manifest.put(Constants.REQUIRE_BUNDLE, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testDependent = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.dependent; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testDependent = state.getFactory().createBundleDescription(state, manifest, "test.frag101", bundleID++); //$NON-NLS-1$
state.addBundle(testHost100);
state.addBundle(testFrag100);
@@ -3100,119 +3209,119 @@ public class StateResolverTest extends AbstractStateTest {
state.addBundle(testFrag101);
state.addBundle(testDependent);
StateDelta stateDelta = state.resolve();
- assertFalse("1.0", testHost100.isResolved());
- assertTrue("1.1", testHost101.isResolved());
- assertFalse("1.2", testFrag100.isResolved());
- assertTrue("1.3", testFrag101.isResolved());
- assertTrue("1.4", testDependent.isResolved());
+ assertFalse("1.0", testHost100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", testHost101.isResolved()); //$NON-NLS-1$
+ assertFalse("1.2", testFrag100.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", testFrag101.isResolved()); //$NON-NLS-1$
+ assertTrue("1.4", testDependent.isResolved()); //$NON-NLS-1$
BundleDelta[] bDelta = stateDelta.getChanges(BundleDelta.ADDED | BundleDelta.RESOLVED, false);
- assertTrue("2.0", bDelta.length == 5);
+ assertTrue("2.0", bDelta.length == 5); //$NON-NLS-1$
}
public void testBug217150() throws BundleException {
State state = buildEmptyState();
Hashtable manifest = new Hashtable();
long bundleID = 0;
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.host; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testHost100 = state.getFactory().createBundleDescription(state, manifest, "test.host100", bundleID++); //$NON-NLS-1$
try {
testHost100.getFragments();
- fail("Expected to get an exception here!!!");
+ fail("Expected to get an exception here!!!"); //$NON-NLS-1$
} catch (IllegalStateException e) {
// Expected exception.
}
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true");
- manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\"");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.frag; singleton:=true"); //$NON-NLS-1$
+ manifest.put(Constants.FRAGMENT_HOST, "test.host; bundle-version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ BundleDescription testFrag100 = state.getFactory().createBundleDescription(state, manifest, "test.frag100", bundleID++); //$NON-NLS-1$
BundleDescription[] hosts = testFrag100.getHost().getHosts();
- assertNotNull("hosts is null", hosts);
- assertEquals("Unexpected number of hosts", 0, hosts.length);
+ assertNotNull("hosts is null", hosts); //$NON-NLS-1$
+ assertEquals("Unexpected number of hosts", 0, hosts.length); //$NON-NLS-1$
}
public void testNativeCodeResolution01() throws BundleException {
State state = buildEmptyState();
Dictionary[] props = new Dictionary[] {new Hashtable()};
- props[0].put("osgi.ws", "win32");
- props[0].put("osgi.os", "win32");
- props[0].put("osgi.arch", "x86");
- props[0].put("osgi.nl", "en_US");
+ props[0].put("osgi.ws", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.os", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.arch", "x86"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.nl", "en_US"); //$NON-NLS-1$ //$NON-NLS-2$
state.setPlatformProperties(props);
Hashtable manifest = new Hashtable();
long bundleID = 0;
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=Windows2000;osname=\"Windows 2003\";osname=Windows95;osname=Windows98;osname=WindowsNT;osname=WindowsXP;osname=\"Windows NT (unknown)\";osname=\"Windows Vista\"; language=en");
- BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=Windows2000;osname=\"Windows 2003\";osname=Windows95;osname=Windows98;osname=WindowsNT;osname=WindowsXP;osname=\"Windows NT (unknown)\";osname=\"Windows Vista\"; language=en"); //$NON-NLS-1$
+ BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$
state.addBundle(testNativeBundle);
state.resolve();
- assertTrue("1.0", testNativeBundle.isResolved());
+ assertTrue("1.0", testNativeBundle.isResolved()); //$NON-NLS-1$
}
public void testNativeCodeResolution02() throws BundleException {
State state = buildEmptyState();
Dictionary[] props = new Dictionary[] {new Hashtable()};
- props[0].put(Constants.FRAMEWORK_OS_NAME, "WIN32"); // Use different case for osname
- props[0].put(Constants.FRAMEWORK_PROCESSOR, "x86");
+ props[0].put(Constants.FRAMEWORK_OS_NAME, "WIN32"); // Use different case for osname //$NON-NLS-1$
+ props[0].put(Constants.FRAMEWORK_PROCESSOR, "x86"); //$NON-NLS-1$
state.setPlatformProperties(props);
Hashtable manifest = new Hashtable();
long bundleID = 0;
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=Windows2000;osname=\"Windows 2003\";osname=Windows95;osname=Windows98;osname=WindowsNT;osname=WindowsXP;osname=\"Windows NT (unknown)\";osname=\"Windows Vista\"");
- BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=Windows2000;osname=\"Windows 2003\";osname=Windows95;osname=Windows98;osname=WindowsNT;osname=WindowsXP;osname=\"Windows NT (unknown)\";osname=\"Windows Vista\""); //$NON-NLS-1$
+ BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$
state.addBundle(testNativeBundle);
state.resolve();
- assertTrue("1.0", testNativeBundle.isResolved());
+ assertTrue("1.0", testNativeBundle.isResolved()); //$NON-NLS-1$
}
public void testNativeCodeResolution03() throws BundleException {
State state = buildEmptyState();
Dictionary[] props = new Dictionary[] {new Hashtable()};
- props[0].put(Constants.FRAMEWORK_OS_NAME, "win32");
- props[0].put(Constants.FRAMEWORK_PROCESSOR, "X86"); // Use different case for processor
+ props[0].put(Constants.FRAMEWORK_OS_NAME, "win32"); //$NON-NLS-1$
+ props[0].put(Constants.FRAMEWORK_PROCESSOR, "X86"); // Use different case for processor //$NON-NLS-1$
state.setPlatformProperties(props);
Hashtable manifest = new Hashtable();
long bundleID = 0;
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=Windows2000;osname=\"Windows 2003\";osname=Windows95;osname=Windows98;osname=WindowsNT;osname=WindowsXP;osname=\"Windows NT (unknown)\";osname=\"Windows Vista\"");
- BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=Windows2000;osname=\"Windows 2003\";osname=Windows95;osname=Windows98;osname=WindowsNT;osname=WindowsXP;osname=\"Windows NT (unknown)\";osname=\"Windows Vista\""); //$NON-NLS-1$
+ BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$
state.addBundle(testNativeBundle);
state.resolve();
- assertTrue("1.0", testNativeBundle.isResolved());
+ assertTrue("1.0", testNativeBundle.isResolved()); //$NON-NLS-1$
}
public void testNativeCodeResolution04() throws BundleException {
State state = buildEmptyState();
Dictionary[] props = new Dictionary[] {new Hashtable()};
- props[0].put(Constants.FRAMEWORK_OS_NAME, "DoesNotExist"); // Use different case for osname
- props[0].put(Constants.FRAMEWORK_PROCESSOR, "InVaLid"); // Use different case for processor
+ props[0].put(Constants.FRAMEWORK_OS_NAME, "DoesNotExist"); // Use different case for osname //$NON-NLS-1$
+ props[0].put(Constants.FRAMEWORK_PROCESSOR, "InVaLid"); // Use different case for processor //$NON-NLS-1$
state.setPlatformProperties(props);
Hashtable manifest = new Hashtable();
long bundleID = 0;
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle");
- manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=iNvAlid;osname=doeSnoTexist");
- BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=iNvAlid;osname=doeSnoTexist"); //$NON-NLS-1$
+ BundleDescription testNativeBundle = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$
state.addBundle(testNativeBundle);
state.resolve();
- assertTrue("1.0", testNativeBundle.isResolved());
+ assertTrue("1.0", testNativeBundle.isResolved()); //$NON-NLS-1$
}
public void testMultiStateAdd01() throws BundleException {
@@ -3221,46 +3330,46 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk10 = state1.getFactory().createBundleDescription(state1, manifest, "sdk10", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk10 = state1.getFactory().createBundleDescription(state1, manifest, "sdk10", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state1.getFactory().createBundleDescription(state1, manifest, "platform10", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state1.getFactory().createBundleDescription(state1, manifest, "platform10", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription rcp10 = state1.getFactory().createBundleDescription(state1, manifest, "rcp10", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state1.getFactory().createBundleDescription(state1, manifest, "rcp10", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\"");
- BundleDescription gef10 = state1.getFactory().createBundleDescription(state1, manifest, "gef10", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription gef10 = state1.getFactory().createBundleDescription(state1, manifest, "gef10", 3); //$NON-NLS-1$
state1.addBundle(sdk10);
state1.addBundle(platform10);
state1.addBundle(rcp10);
state1.addBundle(gef10);
state1.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.3", gef10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
State state2 = buildEmptyState();
try {
state2.addBundle(rcp10);
- fail("Expected IllegalStateException on adding to multiple states");
+ fail("Expected IllegalStateException on adding to multiple states"); //$NON-NLS-1$
} catch (IllegalStateException e) {
// expected
}
@@ -3272,41 +3381,41 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk10 = state1.getFactory().createBundleDescription(state1, manifest, "sdk10", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk10 = state1.getFactory().createBundleDescription(state1, manifest, "sdk10", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state1.getFactory().createBundleDescription(state1, manifest, "platform10", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state1.getFactory().createBundleDescription(state1, manifest, "platform10", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription rcp10 = state1.getFactory().createBundleDescription(state1, manifest, "rcp10", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state1.getFactory().createBundleDescription(state1, manifest, "rcp10", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\"");
- BundleDescription gef10 = state1.getFactory().createBundleDescription(state1, manifest, "gef10", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription gef10 = state1.getFactory().createBundleDescription(state1, manifest, "gef10", 3); //$NON-NLS-1$
state1.addBundle(sdk10);
state1.addBundle(platform10);
state1.addBundle(rcp10);
state1.addBundle(gef10);
state1.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.3", gef10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
// remove the rcp10 bundle. The bundle will be removal pending
// this should still throw an exception until the removal is no longer pending
@@ -3314,7 +3423,7 @@ public class StateResolverTest extends AbstractStateTest {
State state2 = buildEmptyState();
try {
state2.addBundle(rcp10);
- fail("Expected IllegalStateException on adding to multiple states");
+ fail("Expected IllegalStateException on adding to multiple states"); //$NON-NLS-1$
} catch (IllegalStateException e) {
// expected
}
@@ -3326,41 +3435,41 @@ public class StateResolverTest extends AbstractStateTest {
// test the selection algorithm of the resolver to pick the bundles which
// resolve the largest set of bundles
Hashtable manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\"");
- BundleDescription sdk10 = state1.getFactory().createBundleDescription(state1, manifest, "sdk10", 0);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "sdk; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "platform; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription sdk10 = state1.getFactory().createBundleDescription(state1, manifest, "sdk10", 0); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\"");
- BundleDescription platform10 = state1.getFactory().createBundleDescription(state1, manifest, "platform10", 1);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "platform; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,2.0]\""); //$NON-NLS-1$
+ BundleDescription platform10 = state1.getFactory().createBundleDescription(state1, manifest, "platform10", 1); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- BundleDescription rcp10 = state1.getFactory().createBundleDescription(state1, manifest, "rcp10", 2);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "rcp; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ BundleDescription rcp10 = state1.getFactory().createBundleDescription(state1, manifest, "rcp10", 2); //$NON-NLS-1$
manifest = new Hashtable();
- manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true");
- manifest.put(Constants.BUNDLE_VERSION, "1.0");
- manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\"");
- BundleDescription gef10 = state1.getFactory().createBundleDescription(state1, manifest, "gef10", 3);
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "gef; " + Constants.SINGLETON_DIRECTIVE + ":=true"); //$NON-NLS-1$ //$NON-NLS-2$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0"); //$NON-NLS-1$
+ manifest.put(Constants.REQUIRE_BUNDLE, "rcp; bundle-version=\"[1.0,1.0]\""); //$NON-NLS-1$
+ BundleDescription gef10 = state1.getFactory().createBundleDescription(state1, manifest, "gef10", 3); //$NON-NLS-1$
state1.addBundle(sdk10);
state1.addBundle(platform10);
state1.addBundle(rcp10);
state1.addBundle(gef10);
state1.resolve();
- assertTrue("1.0", sdk10.isResolved());
- assertTrue("1.1", platform10.isResolved());
- assertTrue("1.2", rcp10.isResolved());
- assertTrue("1.3", gef10.isResolved());
+ assertTrue("1.0", sdk10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.1", platform10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.2", rcp10.isResolved()); //$NON-NLS-1$
+ assertTrue("1.3", gef10.isResolved()); //$NON-NLS-1$
// remove the rcp10 bundle. The bundle will be removal pending
// this should still throw an exception until the removal is no longer pending
@@ -3371,7 +3480,7 @@ public class StateResolverTest extends AbstractStateTest {
try {
state2.addBundle(rcp10);
} catch (IllegalStateException e) {
- fail("Unexpected IllegalStateException on adding to state", e);
+ fail("Unexpected IllegalStateException on adding to state", e); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
index 3d6db2cb7..eccd394bb 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
@@ -678,8 +678,8 @@ public abstract class StateImpl implements State {
private void resetSystemExports() {
BundleDescription[] systemBundles = getBundles(Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
- if (systemBundles.length > 0) {
- BundleDescriptionImpl systemBundle = (BundleDescriptionImpl) systemBundles[0];
+ for (int idx = 0; idx < systemBundles.length; idx++) {
+ BundleDescriptionImpl systemBundle = (BundleDescriptionImpl) systemBundles[idx];
ExportPackageDescription[] exports = systemBundle.getExportPackages();
ArrayList newExports = new ArrayList(exports.length);
for (int i = 0; i < exports.length; i++)

Back to the top