diff options
author | gjoranv <gv@verizonmedia.com> | 2022-09-01 08:43:56 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-09-01 08:43:56 +0200 |
commit | cf928294be0c0d3a5be9137f4882fe02db6986ac (patch) | |
tree | 9ccccc9ae351e5fcee87f69d4c18c969de7ef65d /jdisc_core_test | |
parent | 35e134e209ac8cec8d4643e1eee691a6e3f32bdf (diff) |
Reapply "Clean up bundles and allowed duplicates after a failed reconfig."
This reverts commit f869fa7fc3fbce76bc19745201bb62484dfc8efe.
Diffstat (limited to 'jdisc_core_test')
-rw-r--r-- | jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/BundleCollisionHookIntegrationTest.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/BundleCollisionHookIntegrationTest.java b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/BundleCollisionHookIntegrationTest.java index 07797838a4b..713f0397984 100644 --- a/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/BundleCollisionHookIntegrationTest.java +++ b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/BundleCollisionHookIntegrationTest.java @@ -81,14 +81,18 @@ public class BundleCollisionHookIntegrationTest { } @Test - public void duplicates_whitelist_can_be_updated_with_additional_bundles() throws Exception { + public void duplicates_whitelist_is_reset_upon_each_call() throws Exception { Bundle bundleL = startBundle(felix, "cert-l1.jar"); Bundle bundleMl = startBundle(felix, "cert-ml.jar"); felix.allowDuplicateBundles(Collections.singleton(bundleL)); felix.allowDuplicateBundles(Collections.singleton(bundleMl)); - startBundle(felix, "cert-l1-dup.jar"); - startBundle(felix, "cert-ml-dup.jar"); + try { + startBundle(felix, "cert-l1-dup.jar"); + fail("Expected exception due to duplicate bundles"); + } catch (BundleException e) { + assertTrue(e.getMessage().contains("Bundle symbolic name and version are not unique")); + } } @Test @@ -97,8 +101,7 @@ public class BundleCollisionHookIntegrationTest { Bundle bundleB = startBundle(felix, "cert-b.jar"); // Makes A and B visible to each other - felix.allowDuplicateBundles(Set.of(bundleA)); - felix.allowDuplicateBundles(Set.of(bundleB)); + felix.allowDuplicateBundles(Set.of(bundleA, bundleB)); List<Bundle> visibleBundles = felix.getBundles(bundleA); @@ -117,8 +120,7 @@ public class BundleCollisionHookIntegrationTest { Bundle bundleB = startBundle(felix, "cert-b.jar"); // Makes A and B visible to each other - felix.allowDuplicateBundles(Set.of(bundleA)); - felix.allowDuplicateBundles(Set.of(bundleB)); + felix.allowDuplicateBundles(Set.of(bundleA, bundleB)); List<Bundle> visibleBundles = felix.getBundles(bundleA); assertEquals(3, visibleBundles.size()); |