summaryrefslogtreecommitdiffstats
path: root/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2019-10-05 00:06:55 +0200
committergjoranv <gv@verizonmedia.com>2019-10-16 11:41:33 +0200
commitaf771506b97cf996dd7c25053c07e1cc8f9eba99 (patch)
treee77bdc57d861ee747f4211e638a163f394472238 /jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java
parent685704ab391abc6efdb9577c24bdf7ed48333f8e (diff)
Allow duplicate bsn+version for a given set of bundles.
- Set 'org.osgi.framework.bsnversion' to 'managed' - Add bundle collision/event hook to handle duplicates and their lifecycle. - Add unit tests for duplicate bundles. o Add bundle 'l1-dup' which is a duplicate of the existing 'l1', but returns a different value from its implemented class. o Add bundle 'ml-dup' that is exactly the same as 'ml'
Diffstat (limited to 'jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java')
-rw-r--r--jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java
index e8551b44a3c..9b7453d2d6b 100644
--- a/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java
+++ b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/FelixFrameworkIntegrationTest.java
@@ -111,8 +111,11 @@ public class FelixFrameworkIntegrationTest {
Bundle bundleL = startBundle(felix, "cert-l1.jar");
Bundle bundleM = startBundle(felix, "cert-ml.jar");
assertEquals(1, callClass(bundleM, "com.yahoo.jdisc.bundle.m.CertificateM"));
+
+ // Switch from l1 to l2 (identical bundles, except for bsn)
bundleL.uninstall();
startBundle(felix, "cert-l2.jar");
+
felix.refreshPackages();
assertEquals(2, callClass(bundleM, "com.yahoo.jdisc.bundle.m.CertificateM"));
felix.stop();
@@ -185,7 +188,7 @@ public class FelixFrameworkIntegrationTest {
"com.yahoo.vespa.jdisc_core.cert-q-frag");
}
- private static Bundle startBundle(FelixFramework felix, String bundleLocation) throws BundleException {
+ static Bundle startBundle(FelixFramework felix, String bundleLocation) throws BundleException {
List<Bundle> lst = felix.installBundle(bundleLocation);
assertEquals(1, lst.size());
felix.startBundles(lst, false);