Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2014-05-27 19:38:35 +0000
committerThomas Watson2014-05-27 19:38:35 +0000
commita56163f313a4a471620cc143f6fbbfbae4352de6 (patch)
tree82a0ea67f8ada31688ec09c8b786c0ef69a2d365
parenteb89224d54c2b3dcf129bf67acdb11daa231c6f3 (diff)
downloadrt.equinox.framework-a56163f313a4a471620cc143f6fbbfbae4352de6.tar.gz
rt.equinox.framework-a56163f313a4a471620cc143f6fbbfbae4352de6.tar.xz
rt.equinox.framework-a56163f313a4a471620cc143f6fbbfbae4352de6.zip
Bug 435796 - IndexOutOfBoundsException in ResolverImpl
- add new testcase Change-Id: Id1625c99f09c1fbd95bb90c5024e5bbfbbe6caed Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java38
-rw-r--r--bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.l.MF6
-rw-r--r--bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.m.MF6
-rw-r--r--bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.MF5
-rw-r--r--bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.static.MF5
5 files changed, 60 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 0e3c98230..bcfb46950 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
@@ -1565,6 +1565,44 @@ public class TestModuleContainer extends AbstractTest {
}
@Test
+ public void testOptionalSubstituted() 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 sub_n = installDummyModule("sub.n.MF", "n", container);
+ Module sub_l = installDummyModule("sub.l.MF", "l", container);
+ Module sub_m = installDummyModule("sub.m.MF", "m", container);
+
+ container.resolve(null, false);
+
+ Assert.assertEquals("l should resolve.", State.RESOLVED, sub_l.getState());
+ Assert.assertEquals("m should resolve.", State.RESOLVED, sub_m.getState());
+ Assert.assertEquals("n should resolve.", State.RESOLVED, sub_n.getState());
+ }
+
+ @Test
+ public void testStaticSubstituted() 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 sub_n = installDummyModule("sub.n.static.MF", "n", container);
+ Module sub_l = installDummyModule("sub.l.MF", "l", container);
+ Module sub_m = installDummyModule("sub.m.MF", "m", container);
+
+ container.resolve(null, false);
+
+ Assert.assertEquals("l should resolve.", State.RESOLVED, sub_l.getState());
+ Assert.assertEquals("m should resolve.", State.RESOLVED, sub_m.getState());
+ Assert.assertEquals("n should resolve.", State.RESOLVED, sub_n.getState());
+ }
+
+ @Test
public void testMultiCardinalityUses() throws BundleException, IOException {
DummyContainerAdaptor adaptor = createDummyAdaptor();
ModuleContainer container = adaptor.getContainer();
diff --git a/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.l.MF b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.l.MF
new file mode 100644
index 000000000..09503715d
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.l.MF
@@ -0,0 +1,6 @@
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: sub.l
+Bundle-Version: 1.0.0
+Export-Package: substituted; version=1.0
+Import-Package: substituted; version=1.0
+
diff --git a/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.m.MF b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.m.MF
new file mode 100644
index 000000000..b4adbe2fb
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.m.MF
@@ -0,0 +1,6 @@
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: sub.m
+Bundle-Version: 1.0.0
+Export-Package: substituted; version=1.1
+Import-Package: substituted; version=1.1
+
diff --git a/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.MF b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.MF
new file mode 100644
index 000000000..7af58de60
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.MF
@@ -0,0 +1,5 @@
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: sub.n
+Bundle-Version: 1.0.0
+Import-Package: substituted; version="[1.0,1.1)"; resolution:=optional
+
diff --git a/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.static.MF b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.static.MF
new file mode 100644
index 000000000..714088569
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/test_files/containerTests/sub.n.static.MF
@@ -0,0 +1,5 @@
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: sub.n
+Bundle-Version: 1.0.0
+Import-Package: substituted; version="[1.0,1.1)"
+

Back to the top