summaryrefslogtreecommitdiffstats
path: root/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/ExportPackagesIntegrationTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/ExportPackagesIntegrationTest.java')
-rw-r--r--jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/ExportPackagesIntegrationTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/ExportPackagesIntegrationTest.java b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/ExportPackagesIntegrationTest.java
new file mode 100644
index 00000000000..04fa085db17
--- /dev/null
+++ b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/ExportPackagesIntegrationTest.java
@@ -0,0 +1,36 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.jdisc.core;
+
+import com.yahoo.jdisc.test.TestDriver;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+
+/**
+ * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a>
+ */
+public class ExportPackagesIntegrationTest {
+
+ @Test
+ public void requireThatManifestContainsExportPackage() throws BundleException {
+ FelixFramework felix = TestDriver.newOsgiFramework();
+ felix.start();
+ List<Bundle> bundles = felix.installBundle("jdisc_core.jar");
+ assertEquals(1, bundles.size());
+ Object obj = bundles.get(0).getHeaders().get("Export-Package");
+ assertTrue(obj instanceof String);
+ String str = (String)obj;
+ assertTrue(str.contains(ExportPackages.getSystemPackages()));
+ assertTrue(str.contains("com.yahoo.jdisc"));
+ assertTrue(str.contains("com.yahoo.jdisc.application"));
+ assertTrue(str.contains("com.yahoo.jdisc.handler"));
+ assertTrue(str.contains("com.yahoo.jdisc.service"));
+ felix.stop();
+ }
+}