X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Fimpl%2FTransformationPathsTest.java;h=18e065fb2405c86ac7991c48119f6a75202e7592;hb=13b475f8216ad5d74d64df4122ea6812554f7a14;hp=a45853272272806d0441b8958c12796b1868919f;hpb=f70baadfd579f4d3aa2e8c9ee7d758fb37d7872f;p=xmlrouter diff --git a/impl/src/test/java/org/wamblee/xmlrouter/impl/TransformationPathsTest.java b/impl/src/test/java/org/wamblee/xmlrouter/impl/TransformationPathsTest.java index a458532..18e065f 100644 --- a/impl/src/test/java/org/wamblee/xmlrouter/impl/TransformationPathsTest.java +++ b/impl/src/test/java/org/wamblee/xmlrouter/impl/TransformationPathsTest.java @@ -18,12 +18,12 @@ package org.wamblee.xmlrouter.impl; import static junit.framework.Assert.*; import java.util.Collection; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import javax.xml.transform.dom.DOMSource; -import org.junit.Before; import org.junit.Test; import org.wamblee.xmlrouter.common.Id; import org.wamblee.xmlrouter.config.Transformation; @@ -68,11 +68,6 @@ public class TransformationPathsTest { private TransformationPaths transformations; - @Before - public void setUp() { - transformations = new TransformationPaths(); - } - private Map, Transformation> createTransformations( long aStartId, Transformation... aTransformations) { Map, Transformation> res = new LinkedHashMap, Transformation>(); @@ -86,7 +81,7 @@ public class TransformationPathsTest { @Test public void testOneTransformation() { - transformations.replaceTransformations(createTransformations(10L, + transformations = new TransformationPaths(createTransformations(10L, new MyTransformation("A", "B"))); System.out.println(transformations.toString()); @@ -106,14 +101,14 @@ public class TransformationPathsTest { @Test public void testMultipleTransformations() { - transformations.replaceTransformations(createTransformations(10L, + transformations = new TransformationPaths(createTransformations(10L, new MyTransformation("A", "B"), new MyTransformation("B", "C"), new MyTransformation("C", "A"))); System.out.println(transformations); assertEquals(2, transformations.getPath("C", "B").size()); - transformations.replaceTransformations(createTransformations(10L, + transformations = new TransformationPaths(createTransformations(10L, new MyTransformation("B", "C"), new MyTransformation("C", "A"))); assertNull(transformations.getPath("C", "B")); @@ -121,13 +116,15 @@ public class TransformationPathsTest { @Test public void testUnknownDestination() { - transformations.replaceTransformations(createTransformations(10L, + transformations = new TransformationPaths(createTransformations(10L, new MyTransformation("A", "B"))); assertNull(transformations.getPath("A", "D")); } @Test public void testWithoutTransformations() { + transformations = new TransformationPaths( + new HashMap, Transformation>()); Collection res = transformations.getPossibleTargetTypes("a"); assertEquals(1, res.size());