diff options
author | Thomas Watson | 2013-02-11 16:00:29 +0000 |
---|---|---|
committer | Thomas Watson | 2013-02-11 16:00:29 +0000 |
commit | 4c1dde194099cc56c54e889e770e545836ae4246 (patch) | |
tree | d4eb0a96930e4b5599c1bd9460f3b71e69b923b7 /bundles | |
parent | 24ca1bf5477ce264c7ed40c57dce658c83fe8979 (diff) | |
download | rt.equinox.framework-4c1dde194099cc56c54e889e770e545836ae4246.tar.gz rt.equinox.framework-4c1dde194099cc56c54e889e770e545836ae4246.tar.xz rt.equinox.framework-4c1dde194099cc56c54e889e770e545836ae4246.zip |
Bug 400348 - [Headless Build] Unsatisfied native code filter error with multiple configurations and fragment Bundle-NativeCode directive in the Manifest
Diffstat (limited to 'bundles')
2 files changed, 58 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java index d3fd06637..6ce92713a 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -4075,6 +4075,60 @@ public class StateResolverTest extends AbstractStateTest { assertTrue("1.0", testNativeBundle.isResolved()); //$NON-NLS-1$ } + public void testNativeCodeResolution05() throws BundleException { + State state = buildEmptyState(); + Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable(), new Hashtable()}; + + props[0].put("osgi.ws", "win32"); //$NON-NLS-1$ //$NON-NLS-2$ + props[0].put("osgi.os", "win32"); //$NON-NLS-1$ //$NON-NLS-2$ + props[0].put("osgi.arch", "x86"); //$NON-NLS-1$ //$NON-NLS-2$ + props[0].put("osgi.nl", "en_US"); //$NON-NLS-1$ //$NON-NLS-2$ + + props[1].put("osgi.ws", "win32"); //$NON-NLS-1$ //$NON-NLS-2$ + props[1].put("osgi.os", "win32"); //$NON-NLS-1$ //$NON-NLS-2$ + props[1].put("osgi.arch", "x86_64"); //$NON-NLS-1$ //$NON-NLS-2$ + props[1].put("osgi.nl", "en_US"); //$NON-NLS-1$ //$NON-NLS-2$ + + props[2].put("osgi.ws", "win32"); //$NON-NLS-1$ //$NON-NLS-2$ + props[2].put("osgi.os", "win32"); //$NON-NLS-1$ //$NON-NLS-2$ + props[2].put("osgi.arch", "x86"); //$NON-NLS-1$ //$NON-NLS-2$ + props[2].put("osgi.nl", "fr_FR"); //$NON-NLS-1$ //$NON-NLS-2$ + + state.setPlatformProperties(props); + + Hashtable manifest = new Hashtable(); + long bundleID = 0; + + manifest.clear(); + manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle1"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=win32; language=en"); //$NON-NLS-1$ + BundleDescription testNativeBundle1 = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$ + + manifest.clear(); + manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle2"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86_64;osname=win32; language=en"); //$NON-NLS-1$ + BundleDescription testNativeBundle2 = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$ + + manifest.clear(); + manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle3"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$ + manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=win32; language=fr"); //$NON-NLS-1$ + BundleDescription testNativeBundle3 = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$ + + state.addBundle(testNativeBundle1); + state.addBundle(testNativeBundle2); + state.addBundle(testNativeBundle3); + state.resolve(); + assertTrue("1.0", testNativeBundle1.isResolved()); //$NON-NLS-1$ + assertTrue("2.0", testNativeBundle2.isResolved()); //$NON-NLS-1$ + assertTrue("3.0", testNativeBundle3.isResolved()); //$NON-NLS-1$ + } + public void testMultiStateAdd01() throws BundleException { State state1 = buildEmptyState(); diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java index 59d55d1d3..986f091ab 100644 --- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java +++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -108,7 +108,7 @@ public class NativeCodeSpecificationImpl extends VersionConstraintImpl implement } } if (!match) - return false; + continue; match = false; String[] languages = nativeSupplier.getLanguages(); @@ -123,7 +123,7 @@ public class NativeCodeSpecificationImpl extends VersionConstraintImpl implement } } if (!match) - return false; + continue; match = false; VersionRange[] osVersions = nativeSupplier.getOSVersions(); |