diff options
author | gjoranv <gv@verizonmedia.com> | 2020-06-22 16:01:41 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2020-06-22 16:01:41 +0200 |
commit | 063a90c0f067340a7ce4104da9dbaf232b9ded76 (patch) | |
tree | 584561fc021c9a9b65f4c2844888a7d9148e888e /bundle-plugin/src/test/java/com/yahoo/container/plugin | |
parent | f8ca44ae9570a3e5241ad64a3d62334cd4877ff6 (diff) |
Remove all traces of global packages and rename public -> exported
- The Global-Package header was unused.
- "public" used to mean global + exported packages
Diffstat (limited to 'bundle-plugin/src/test/java/com/yahoo/container/plugin')
-rw-r--r-- | bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java b/bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java index a09604b842b..133cca164f8 100644 --- a/bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java +++ b/bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java @@ -1,8 +1,8 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.plugin.bundle; -import com.yahoo.container.plugin.bundle.AnalyzeBundle.PublicPackages; import com.yahoo.container.plugin.osgi.ExportPackages; +import com.yahoo.container.plugin.osgi.ExportPackages.Export; import org.hamcrest.Description; import org.hamcrest.TypeSafeMatcher; import org.junit.Rule; @@ -14,7 +14,6 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import static com.yahoo.container.plugin.classanalysis.TestUtilities.throwableMessage; import static org.hamcrest.CoreMatchers.containsString; @@ -29,19 +28,16 @@ import static org.junit.Assert.assertThat; * @author ollivir */ public class AnalyzeBundleTest { - private final List<ExportPackages.Export> exports; - private final Set<String> exportedPackageNames; - private final Map<String, ExportPackages.Export> exportsByPackageName; + private final List<Export> exports; + private final Map<String, Export> exportsByPackageName; File jarDir = new File("src/test/resources/jar"); public AnalyzeBundleTest() { File notOsgi = new File(jarDir, "notAOsgiBundle.jar"); File simple = new File(jarDir, "simple1.jar"); - PublicPackages pp = AnalyzeBundle.publicPackagesAggregated(Arrays.asList(notOsgi, simple)); - this.exports = pp.exports; - this.exportedPackageNames = pp.exportedPackageNames(); - this.exportsByPackageName = ExportPackages.exportsByPackageName(exports); + exports = AnalyzeBundle.exportedPackagesAggregated(Arrays.asList(notOsgi, simple)); + exportsByPackageName = ExportPackages.exportsByPackageName(this.exports); } private File jarFile(String name) { @@ -61,7 +57,7 @@ public class AnalyzeBundleTest { @Test public void exported_class_names_can_be_retrieved() { - assertThat(exportedPackageNames, is(new HashSet<>(exports.get(0).getPackageNames()))); + assertThat(ExportPackages.packageNames(exports), is(new HashSet<>(exports.get(0).getPackageNames()))); } @Rule @@ -75,7 +71,7 @@ public class AnalyzeBundleTest { exception.expectMessage(matchesPattern("Invalid manifest in bundle '.*errorExport.jar'")); exception.expectCause(throwableMessage(startsWith("Failed parsing Export-Package"))); - AnalyzeBundle.publicPackages(jarFile("errorExport.jar")); + AnalyzeBundle.exportedPackages(jarFile("errorExport.jar")); } private TypeSafeMatcher<String> matchesPattern(String pattern) { |