Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2014-04-17 16:12:17 +0000
committerThomas Watson2014-04-17 16:33:28 +0000
commit660c78161150f4fe6ed6c11469d9e225b7fab6ec (patch)
treeb9e4b38a401abaf7060444ab970549ad3e6b56cb /bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
parentf0d437ad53ad0c0cab0b27d1c8299078deb03bd6 (diff)
downloadrt.equinox.framework-660c78161150f4fe6ed6c11469d9e225b7fab6ec.tar.gz
rt.equinox.framework-660c78161150f4fe6ed6c11469d9e225b7fab6ec.tar.xz
rt.equinox.framework-660c78161150f4fe6ed6c11469d9e225b7fab6ec.zip
Bug 433023 - Resolver does not allow optional reqs to resolve if they
introduce class space inconsistencies - Add a new testcase
Diffstat (limited to 'bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java')
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
index 9835303d2..0e3c98230 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
@@ -1524,6 +1524,46 @@ public class TestModuleContainer extends AbstractTest {
}
}
+ /**
+ * Test optional constraints
+ * @throws BundleException
+ * @throws IOException
+ */
+ @Test
+ public void testUses5Importer() throws BundleException, IOException {
+ doTestUses5("uses.k.importer.MF");
+ }
+
+ @Test
+ public void testUses5ReqCap() throws BundleException, IOException {
+ doTestUses5("uses.k.reqCap.MF");
+ }
+
+ @Test
+ public void testUses5Requirer() throws BundleException, IOException {
+ doTestUses5("uses.k.requirer.MF");
+ }
+
+ public void doTestUses5(String kManifest) throws BundleException, IOException {
+ DummyContainerAdaptor adaptor = createDummyAdaptor();
+ ModuleContainer container = adaptor.getContainer();
+
+ Module systemBundle = installDummyModule("system.bundle.MF", Constants.SYSTEM_BUNDLE_LOCATION, container);
+
+ container.resolve(Arrays.asList(systemBundle), true);
+ Module uses_k = installDummyModule(kManifest, "k", container);
+ Module uses_l = installDummyModule("uses.l.MF", "l", container);
+ Module uses_m_conflict1 = installDummyModule("uses.m.conflict1.MF", "m.conflict1", container);
+ Module uses_m_conflict2 = installDummyModule("uses.m.conflict2.MF", "m.conflict2", container);
+
+ container.resolve(null, false);
+
+ Assert.assertEquals("k should resolve.", State.RESOLVED, uses_k.getState());
+ Assert.assertEquals("l should resolve.", State.RESOLVED, uses_l.getState());
+ Assert.assertEquals("m.conflict1 should resolve.", State.RESOLVED, uses_m_conflict1.getState());
+ Assert.assertEquals("m.conflict2 should resolve.", State.RESOLVED, uses_m_conflict2.getState());
+ }
+
@Test
public void testMultiCardinalityUses() throws BundleException, IOException {
DummyContainerAdaptor adaptor = createDummyAdaptor();

Back to the top