aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-12-09 10:43:31 (EST)
committerJohn Ross2013-12-09 11:02:42 (EST)
commit657ca124941d2871ac0fc9d0146e1e645d4270ec (patch)
treec03380bf05eb914beceab12ecd70c16dd01a768f
parent72c26472b6269957b427fbc4b5251d5f3d047745 (diff)
downloadrt.equinox.framework-657ca124941d2871ac0fc9d0146e1e645d4270ec.zip
rt.equinox.framework-657ca124941d2871ac0fc9d0146e1e645d4270ec.tar.gz
rt.equinox.framework-657ca124941d2871ac0fc9d0146e1e645d4270ec.tar.bz2
[Bug 423479] Tests
-rw-r--r--bundles/org.eclipse.osgi.tests/.classpath2
-rw-r--r--bundles/org.eclipse.osgi.tests/build.properties8
-rwxr-xr-xbundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.a/META-INF/MANIFEST.MF6
-rwxr-xr-xbundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.b/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java22
5 files changed, 41 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi.tests/.classpath b/bundles/org.eclipse.osgi.tests/.classpath
index c7f40b6..a97e662 100644
--- a/bundles/org.eclipse.osgi.tests/.classpath
+++ b/bundles/org.eclipse.osgi.tests/.classpath
@@ -120,5 +120,7 @@
<classpathentry kind="src" output="bundle_tests/test.bug412228" path="bundles_src/test.bug412228"/>
<classpathentry kind="src" output="bundle_tests/test.uninstall.start1" path="bundles_src/test.uninstall.start1"/>
<classpathentry kind="src" output="bundle_tests/test.uninstall.start2" path="bundles_src/test.uninstall.start2"/>
+ <classpathentry kind="src" output="bundle_tests/ext.framework.osgiee.a.jar" path="bundles_src/ext.framework.osgiee.a"/>
+ <classpathentry kind="src" output="bundle_tests/ext.framework.osgiee.b.jar" path="bundles_src/ext.framework.osgiee.b"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.osgi.tests/build.properties b/bundles/org.eclipse.osgi.tests/build.properties
index 50e75ed..dfceef3 100644
--- a/bundles/org.eclipse.osgi.tests/build.properties
+++ b/bundles/org.eclipse.osgi.tests/build.properties
@@ -244,6 +244,10 @@ source.bundle_tests/test.uninstall.start1.jar = bundles_src/test.uninstall.start
manifest.bundle_tests/test.uninstall.start1.jar = META-INF/MANIFEST.MF
source.bundle_tests/test.uninstall.start2.jar = bundles_src/test.uninstall.start2/
manifest.bundle_tests/test.uninstall.start2.jar = META-INF/MANIFEST.MF
+source.bundle_tests/ext.framework.osgiee.a.jar = bundles_src/ext.framework.osgiee.a/
+manifest.bundle_tests/ext.framework.osgiee.a.jarr = META-INF/MANIFEST.MF
+source.bundle_tests/ext.framework.osgiee.b.jar = bundles_src/ext.framework.osgiee.b/
+manifest.bundle_tests/ext.framework.osgiee.b.jar = META-INF/MANIFEST.MF
jars.compile.order = bundle_tests/ext.framework.b.jar,\
osgitests.jar,\
@@ -362,4 +366,6 @@ jars.compile.order = bundle_tests/ext.framework.b.jar,\
bundle_tests/test.plugins.g.jar,\
bundle_tests/test.bug412228.jar,\
bundle_tests/test.uninstall.start1.jar,\
- bundle_tests/test.uninstall.start2.jar
+ bundle_tests/test.uninstall.start2.jar,\
+ bundle_tests/ext.framework.osgiee.a.jar,\
+ bundle_tests/ext.framework.osgiee.b.jar
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.a/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.a/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..5e4ac0b
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.a/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: ext.framework.osgiee.a
+Fragment-Host: system.bundle; extension:=framework
+Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.2))",
+ osgi.wiring.package;filter:="(osgi.wiring.package=org.osgi.framework)"
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.b/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.b/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..d86ed58
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/ext.framework.osgiee.b/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: ext.framework.osgiee.b
+Fragment-Host: system.bundle; extension:=framework
+Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.2))"
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java
index 5ed5de4..297b5d8 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ExtensionBundleTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 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
@@ -12,7 +12,10 @@ package org.eclipse.osgi.tests.bundles;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.osgi.internal.messages.Msg;
+import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
public class ExtensionBundleTests extends AbstractBundleTests {
public static Test suite() {
@@ -57,4 +60,21 @@ public class ExtensionBundleTests extends AbstractBundleTests {
assertEquals("1.1", "success", results[0]); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("1.2", "success", results[1]); //$NON-NLS-1$ //$NON-NLS-2$
}
+
+ public void testExtensionBundleWithRequireCapabilityOsgiEeInstalls() {
+ try {
+ installer.installBundle("ext.framework.osgiee.b");
+ } catch (BundleException e) {
+ fail("Extension bundle with Require-Capability only in osgi.ee. namespace failed to install", e);
+ }
+ }
+
+ public void testExtensionBundleWithRequireCapabilityOtherThanOsgiEeFailsToInstall() {
+ try {
+ installer.installBundle("ext.framework.osgiee.a");
+ fail("Extension bundle with Require-Capability not in osgi.ee namespace did not fail to install");
+ } catch (BundleException e) {
+ assertTrue(e.getMessage().equals(NLS.bind(Msg.OSGiManifestBuilderFactory_ExtensionReqCapError, "osgi.wiring.package")));
+ }
+ }
}