Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2016-11-17 14:18:11 -0500
committerThomas Watson2016-11-17 14:18:11 -0500
commit352908fa44436a6421b938347ed745e23d6a441d (patch)
treef6e14c3a8f421281e3165ee7462202edde66e371
parent33ad3dfc7cca7bab93f67c53c8b288bafb251347 (diff)
downloadrt.equinox.framework-352908fa44436a6421b938347ed745e23d6a441d.tar.gz
rt.equinox.framework-352908fa44436a6421b938347ed745e23d6a441d.tar.xz
rt.equinox.framework-352908fa44436a6421b938347ed745e23d6a441d.zip
Change-Id: I4067437e5da201f472c48173a2595e63bb589177 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java23
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java5
2 files changed, 26 insertions, 2 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 ef48e85a8..e26a78c0d 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
@@ -2563,7 +2563,7 @@ public class TestModuleContainer extends AbstractTest {
}
@Test
- public void testStartLevelDeadlock() throws BundleException, IOException, InterruptedException {
+ public void testStartLevelDeadlock() throws BundleException, IOException {
DummyContainerAdaptor adaptor = createDummyAdaptor();
ModuleContainer container = adaptor.getContainer();
container.getFrameworkStartLevel().setInitialBundleStartLevel(2);
@@ -2625,7 +2625,7 @@ public class TestModuleContainer extends AbstractTest {
}
@Test
- public void testUnresolvedHostWithFragmentCycle() throws BundleException, IOException {
+ public void testUnresolvedHostWithFragmentCycle() throws BundleException {
DummyContainerAdaptor adaptor = createDummyAdaptor();
ModuleContainer container = adaptor.getContainer();
@@ -2662,7 +2662,26 @@ public class TestModuleContainer extends AbstractTest {
ResolutionReport report = container.resolve(Arrays.asList(hostImporter), true);
Assert.assertNull("Failed to resolve test.", report.getResolutionException());
+ }
+
+ @Test
+ public void testModuleWiringToString() throws BundleException {
+ DummyContainerAdaptor adaptor = createDummyAdaptor();
+ ModuleContainer container = adaptor.getContainer();
+
+ // install a test module
+ Map<String, String> testManifest = new HashMap<String, String>();
+ testManifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+ testManifest.put(Constants.BUNDLE_SYMBOLICNAME, "test.name");
+ testManifest.put(Constants.BUNDLE_VERSION, "1.0");
+ Module testModule = installDummyModule(testManifest, "host10", container);
+
+ ResolutionReport report = container.resolve(Arrays.asList(testModule), true);
+ Assert.assertNull("Failed to resolve test.", report.getResolutionException());
+ ModuleRevision revision = testModule.getCurrentRevision();
+ ModuleWiring wiring = revision.getWiring();
+ Assert.assertEquals("Unexpected wiring.toString()", revision.toString(), wiring.toString());
}
@Test
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
index 18d17b902..035bdffaf 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
@@ -453,4 +453,9 @@ public final class ModuleWiring implements BundleWiring {
misses.removeAll(packageNames);
}
}
+
+ @Override
+ public String toString() {
+ return revision.toString();
+ }
}

Back to the top