Bug 507703 - Add toString to ModuleWiring

Change-Id: I4067437e5da201f472c48173a2595e63bb589177
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
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 ef48e85..e26a78c 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 @@
 	}
 
 	@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 @@
 	}
 
 	@Test
-	public void testUnresolvedHostWithFragmentCycle() throws BundleException, IOException {
+	public void testUnresolvedHostWithFragmentCycle() throws BundleException {
 		DummyContainerAdaptor adaptor = createDummyAdaptor();
 		ModuleContainer container = adaptor.getContainer();
 
@@ -2662,7 +2662,26 @@
 
 		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 18d17b9..035bdff 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 @@
 			misses.removeAll(packageNames);
 		}
 	}
+
+	@Override
+	public String toString() {
+		return revision.toString();
+	}
 }