aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorSébastien Determe <sd378r@intl.att.com>2017-09-08 10:44:21 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-08 10:44:21 +0000
commitf0c6215103464e860b756d9e781b7e4d34b30541 (patch)
treefc0caded616831b2d1ab41db39fedcb7364df0f0 /src/test/java
parent72e904aa818b14e0f3d869c94cac3cb90930749e (diff)
parent4c14395a640b3f0f1d0422b5ff7f840ebee8e92d (diff)
Merge "Add Holmes to the Backend"
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java b/src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java
new file mode 100644
index 000000000..8ee60e745
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java
@@ -0,0 +1,34 @@
+package org.onap.clamp.clds.transform;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+
+import javax.xml.transform.TransformerException;
+
+import org.junit.Test;
+import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.skyscreamer.jsonassert.JSONAssert;
+
+public class XslTransformerTest {
+
+ /**
+ * This test validates the XSLT to convert BPMN xml to BPMN JSON.
+ *
+ * @throws TransformerException
+ * In case of issues
+ * @throws IOException
+ * In case of issues
+ */
+ @Test
+ public void xslTransformTest() throws TransformerException, IOException {
+ XslTransformer xslTransformer = new XslTransformer();
+ xslTransformer.setXslResourceName("xsl/clds-bpmn-transformer.xsl");
+
+ String bpmnJson = xslTransformer
+ .doXslTransformToString(ResourceFileUtil.getResourceAsString("example/xsl-validation/modelBpmn.xml"));
+ assertNotNull(bpmnJson);
+ JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("example/xsl-validation/modelBpmnForVerif.json"),
+ bpmnJson, true);
+ }
+}