summaryrefslogtreecommitdiffstats
path: root/bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java')
-rw-r--r--bundle-plugin/src/test/java/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.java9
1 files changed, 9 insertions, 0 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 8cccf0598ab..a09604b842b 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
@@ -11,8 +11,10 @@ import org.junit.rules.ExpectedException;
import java.io.File;
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;
@@ -28,6 +30,7 @@ import static org.junit.Assert.assertThat;
*/
public class AnalyzeBundleTest {
private final List<ExportPackages.Export> exports;
+ private final Set<String> exportedPackageNames;
private final Map<String, ExportPackages.Export> exportsByPackageName;
File jarDir = new File("src/test/resources/jar");
@@ -37,6 +40,7 @@ public class AnalyzeBundleTest {
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);
}
@@ -55,6 +59,11 @@ public class AnalyzeBundleTest {
assertThat(exportsByPackageName.keySet(), hasItem("com.yahoo.sample.exported.package"));
}
+ @Test
+ public void exported_class_names_can_be_retrieved() {
+ assertThat(exportedPackageNames, is(new HashSet<>(exports.get(0).getPackageNames())));
+ }
+
@Rule
public ExpectedException exception = ExpectedException.none();