X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Fimpl%2FXMLRouterTest.java;h=baa63a16c7a6de2cc7121ce85407a8131fbf4a13;hb=f70baadfd579f4d3aa2e8c9ee7d758fb37d7872f;hp=eeb05aa3452707091410f9c65d3e9531a4c48f3d;hpb=d96c59e2c9e5b15c4ce2023ac93d70b4c0ddf568;p=xmlrouter diff --git a/impl/src/test/java/org/wamblee/xmlrouter/impl/XMLRouterTest.java b/impl/src/test/java/org/wamblee/xmlrouter/impl/XMLRouterTest.java index eeb05aa..baa63a1 100644 --- a/impl/src/test/java/org/wamblee/xmlrouter/impl/XMLRouterTest.java +++ b/impl/src/test/java/org/wamblee/xmlrouter/impl/XMLRouterTest.java @@ -67,6 +67,7 @@ public class XMLRouterTest { } private ExtendedRouterConfig routerConfig; + private XMLRouterConfiguration config; private XMLRouter router; private DOMSource source1; private DOMSource source2; @@ -79,9 +80,10 @@ public class XMLRouterTest { @Before public void setUp() { routerConfig = new SingleRouterConfig(new AtomicLong(1L)); + config = new XMLRouterConfigurationImpl(routerConfig); EventListener logListener = new LoggingEventListener(Level.INFO); listener = spy(logListener); - router = new XMLRouter(new SystemClock(), routerConfig, listener); + router = new XMLRouter(new SystemClock(), config, listener); source1 = mock(DOMSource.class); source2 = mock(DOMSource.class); source3 = mock(DOMSource.class); @@ -273,6 +275,8 @@ public class XMLRouterTest { when(transformation.getToType()).thenReturn("bla"); when(transformation.transform(same(source1))).thenReturn(source2); routerConfig.transformationConfig().add(transformation); + config.getTransformations().replaceTransformations( + routerConfig.transformationConfig().map()); Destination destination = mock(Destination.class); when( @@ -335,6 +339,8 @@ public class XMLRouterTest { source1, null); routerConfig.transformationConfig().add(transformation); + config.getTransformations().replaceTransformations( + routerConfig.transformationConfig().map()); Destination destination = mock(Destination.class); when( @@ -353,6 +359,8 @@ public class XMLRouterTest { source1, source2); routerConfig.transformationConfig().add(transformation2); + config.getTransformations().replaceTransformations( + routerConfig.transformationConfig().map()); when( destination.chooseFromTargetTypes((Collection) anyObject())) .thenReturn(Arrays.asList("bla", "bla2")); @@ -397,6 +405,8 @@ public class XMLRouterTest { Transformation transformation = createTransformation("any", "other", source1, source2); routerConfig.transformationConfig().add(transformation); + config.getTransformations().replaceTransformations( + routerConfig.transformationConfig().map()); router.publish("source", source1); verify(listener, times(2)).delivered(any(EventInfo.class), @@ -418,6 +428,8 @@ public class XMLRouterTest { Transformation t2 = createTransformation("intermediate", "other", source2, source3); routerConfig.transformationConfig().add(t2); + config.getTransformations().replaceTransformations( + routerConfig.transformationConfig().map()); router.publish("source", source1); verify(listener).delivered(any(EventInfo.class),