diff options
author | gjoranv <gv@verizonmedia.com> | 2022-08-24 16:00:35 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-08-25 17:34:02 +0200 |
commit | b0a398eaeadfaf12e31bcfef2e41892439db1149 (patch) | |
tree | 34f6d7bf053cb8fb31cfd9b73e37e979bd392a39 /jdisc_core_test | |
parent | c05ab2660c017cb54ee9a591e2e02434e78bd176 (diff) |
Clean up bundles and allowed duplicates after a failed reconfig.
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()); |