aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/test/java/com
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-07-19 13:40:35 +0200
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-07-20 13:15:21 +0200
commit43298ad59815c9731e0d2f0cd8604af08a119021 (patch)
treed8b3a52ec2d618e66f107181a5c791ba63ec5b07 /vespajlib/src/test/java/com
parent94e3449f4b57647b199a03e2e59f91ee902b35eb (diff)
Rewrite ProjectBundleClassPaths to Java
Diffstat (limited to 'vespajlib/src/test/java/com')
-rw-r--r--vespajlib/src/test/java/com/yahoo/osgi/maven/ProjectBundleClassPathsTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/osgi/maven/ProjectBundleClassPathsTest.java b/vespajlib/src/test/java/com/yahoo/osgi/maven/ProjectBundleClassPathsTest.java
new file mode 100644
index 00000000000..9bb66afd876
--- /dev/null
+++ b/vespajlib/src/test/java/com/yahoo/osgi/maven/ProjectBundleClassPathsTest.java
@@ -0,0 +1,35 @@
+package com.yahoo.osgi.maven;
+
+import com.yahoo.osgi.maven.ProjectBundleClassPaths.BundleClasspathMapping;
+import org.junit.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import static java.util.Arrays.asList;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author bjorncs
+ */
+public class ProjectBundleClassPathsTest {
+
+ @Test
+ public void bundle_classpaths_serializes_correctly_to_json() throws IOException {
+ ProjectBundleClassPaths projectBundleClassPaths =
+ new ProjectBundleClassPaths(
+ new BundleClasspathMapping("main-bundle-name", asList("classpath-elem-0-1", "classpath-elem-0-2")),
+ asList(
+ new BundleClasspathMapping(
+ "main-bundle-dep1",
+ asList("classpath-elem-1-1", "classpath-elem-1-2")),
+ new BundleClasspathMapping(
+ "main-bundle-dep2",
+ asList("classpath-elem-2-1", "classpath-elem-2-2"))));
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ProjectBundleClassPaths.save(out, projectBundleClassPaths);
+ ProjectBundleClassPaths deserialized = ProjectBundleClassPaths.load(out.toByteArray());
+ assertEquals(projectBundleClassPaths, deserialized);
+ }
+
+}