Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2014-04-03 19:06:58 +0000
committerThomas Watson2014-04-03 19:06:58 +0000
commitaafb65c052946456b5b05ea6b12b618e2eab201d (patch)
tree06c23ec98e0dc4d2795110c2be3f527b9ff3800f
parent848b9004c041433200cc93227ad95dafc1f83a82 (diff)
downloadrt.equinox.framework-aafb65c052946456b5b05ea6b12b618e2eab201d.tar.gz
rt.equinox.framework-aafb65c052946456b5b05ea6b12b618e2eab201d.tar.xz
rt.equinox.framework-aafb65c052946456b5b05ea6b12b618e2eab201d.zip
Bug 431951 - compatibility state does not support R3 bundles
- new test
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java22
-rw-r--r--bundles/org.eclipse.osgi.tests/test_files/platformAdmin/b1/META-INF/MANIFEST.MF4
2 files changed, 23 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java
index 5f7a678e0..c4860a2ca 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/PlatformAdminBundleTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -14,8 +14,8 @@ import java.util.Arrays;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.osgi.service.resolver.*;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
+import org.eclipse.osgi.tests.OSGiTestsActivator;
+import org.osgi.framework.*;
import org.osgi.framework.wiring.FrameworkWiring;
public class PlatformAdminBundleTests extends AbstractBundleTests {
@@ -115,4 +115,20 @@ public class PlatformAdminBundleTests extends AbstractBundleTests {
}
}
+ public void testR3Bundle() throws BundleException, InvalidSyntaxException {
+ PlatformAdmin pa = installer.getPlatformAdmin();
+ State systemState = pa.getState(false);
+ BundleInstaller r3Installer = new BundleInstaller("test_files/platformAdmin", OSGiTestsActivator.getContext());
+ try {
+ Bundle b = r3Installer.installBundle("b1");
+ BundleDescription bDesc = systemState.getBundle(b.getBundleId());
+ assertNotNull("No bundle description.", bDesc);
+ ExportPackageDescription[] exports = bDesc.getExportPackages();
+ ImportPackageSpecification[] imports = bDesc.getImportPackages();
+ assertEquals("Wrong number of exports", 1, exports.length);
+ assertEquals("Wrong number of imports.", 2, imports.length);
+ } finally {
+ r3Installer.shutdown();
+ }
+ }
}
diff --git a/bundles/org.eclipse.osgi.tests/test_files/platformAdmin/b1/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/test_files/platformAdmin/b1/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..d95b2547f
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/test_files/platformAdmin/b1/META-INF/MANIFEST.MF
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 1
+Export-Package: a
+Import-Package: b

Back to the top