Bug 492890 - add test for native code attributes with special filter
chars
Change-Id: I2fcf8daf79130b1d351ffa1f549c04d8ccabf750
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 dc65907..e4e05e6 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
@@ -2101,6 +2101,32 @@
}
@Test
+ public void testNativeWithFitlerChars() throws BundleException, IOException {
+ DummyContainerAdaptor adaptor = createDummyAdaptor();
+ ModuleContainer container = adaptor.getContainer();
+
+ // install the system.bundle
+ String extraCapabilities = "osgi.native; osgi.native.osname=\"Windows NT (unknown)\"";
+ Module systemBundle = installDummyModule("system.bundle.MF", Constants.SYSTEM_BUNDLE_LOCATION, Constants.SYSTEM_BUNDLE_SYMBOLICNAME, null, extraCapabilities, container);
+ ResolutionReport report = container.resolve(Arrays.asList(systemBundle), true);
+ Assert.assertNull("Failed to resolve system.bundle.", report.getResolutionException());
+
+ // install bundle with Bundle-NativeCode
+ Map<String, String> nativeCodeManifest = new HashMap<String, String>();
+ nativeCodeManifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
+ nativeCodeManifest.put(Constants.BUNDLE_SYMBOLICNAME, "importer");
+ nativeCodeManifest.put(Constants.BUNDLE_NATIVECODE, //
+ "/lib/mylib.dll; osname=\"win32\"; osname=\"Windows NT (unknown)\"," + //
+ "/lib/mylib.lib; osname=\"Linux\"");
+
+ Module nativeCodeModule = installDummyModule(nativeCodeManifest, "nativeCodeBundle", container);
+
+ // unsatisfied optional and dynamic imports do not fail a resolve.
+ report = container.resolve(Arrays.asList(nativeCodeModule), true);
+ Assert.assertNull("Failed to resolve nativeCodeBundle.", report.getResolutionException());
+ }
+
+ @Test
public void testUTF8LineContinuation() throws BundleException, IOException {
DummyContainerAdaptor adaptor = createDummyAdaptor();
ModuleContainer container = adaptor.getContainer();