Now using RouterConfig internally inside the XML Router.
[xmlrouter] / impl / src / test / java / org / wamblee / xmlrouter / impl / XMLRouterTest.java
index 9ee2645a58f8029de45cfae296f4685540790f81..4bcf2a46929b734e060e9b009b548585d86202ca 100644 (file)
@@ -99,7 +99,7 @@ public class XMLRouterTest {
         DocumentType type = mock(DocumentType.class);
         doThrow(new RuntimeException("x")).when(type).isInstance(
             any(DOMSource.class));
-        router.getDocumentTypeConfig().add(type);
+        router.documentTypeConfig().add(type);
         router.publish("xx", mock(DOMSource.class));
         verify(listener).notDelivered(any(EventInfo.class));
         // no exception should occur.
@@ -111,7 +111,7 @@ public class XMLRouterTest {
         Filter filter = mock(Filter.class);
         doThrow(new RuntimeException("x")).when(filter).isAllowed(anyString(),
             any(DOMSource.class));
-        router.getFilterConfig().add(filter);
+        router.filterConfig().add(filter);
         router.publish("xx", mock(DOMSource.class));
         verify(listener).notDelivered(any(EventInfo.class));
         // no exception should occur.
@@ -144,14 +144,14 @@ public class XMLRouterTest {
         DocumentType type = mock(DocumentType.class);
         when(type.isInstance(any(DOMSource.class))).thenReturn(true);
         when(type.getName()).thenReturn(aType);
-        Id<DocumentType> typeId = router.getDocumentTypeConfig().add(type);
+        Id<DocumentType> typeId = router.documentTypeConfig().add(type);
     }
 
     private void registerDocumentType(String aType, DOMSource aSource) {
         DocumentType type = mock(DocumentType.class);
         when(type.isInstance(same(aSource))).thenReturn(true);
         when(type.getName()).thenReturn(aType);
-        Id<DocumentType> typeId = router.getDocumentTypeConfig().add(type);
+        Id<DocumentType> typeId = router.documentTypeConfig().add(type);
     }
 
     private Destination registerDestination(boolean aResult, String... types) {
@@ -269,7 +269,7 @@ public class XMLRouterTest {
         when(transformation.getFromType()).thenReturn("any");
         when(transformation.getToType()).thenReturn("bla");
         when(transformation.transform(same(source1))).thenReturn(source2);
-        router.getTransformationConfig().add(transformation);
+        router.transformationConfig().add(transformation);
 
         Destination destination = mock(Destination.class);
         when(
@@ -301,7 +301,7 @@ public class XMLRouterTest {
         when(transformation.getToType()).thenReturn("bla");
         doThrow(new RuntimeException("x")).when(transformation).transform(
             same(source1));
-        router.getTransformationConfig().add(transformation);
+        router.transformationConfig().add(transformation);
 
         Destination destination = mock(Destination.class);
         when(
@@ -331,7 +331,7 @@ public class XMLRouterTest {
         Transformation transformation = createTransformation("any", "bla",
             source1, null);
 
-        router.getTransformationConfig().add(transformation);
+        router.transformationConfig().add(transformation);
 
         Destination destination = mock(Destination.class);
         when(
@@ -349,7 +349,7 @@ public class XMLRouterTest {
         Transformation transformation2 = createTransformation("any", "bla2",
             source1, source2);
 
-        router.getTransformationConfig().add(transformation2);
+        router.transformationConfig().add(transformation2);
         when(
             destination.chooseFromTargetTypes((Collection<String>) anyObject()))
             .thenReturn(Arrays.asList("bla", "bla2"));
@@ -393,7 +393,7 @@ public class XMLRouterTest {
         registerDocumentType("other", source2);
         Transformation transformation = createTransformation("any", "other",
             source1, source2);
-        router.getTransformationConfig().add(transformation);
+        router.transformationConfig().add(transformation);
 
         router.publish("source", source1);
         verify(listener, times(2)).delivered(any(EventInfo.class),
@@ -411,10 +411,10 @@ public class XMLRouterTest {
 
         Transformation t1 = createTransformation("any", "intermediate",
             source1, source2);
-        router.getTransformationConfig().add(t1);
+        router.transformationConfig().add(t1);
         Transformation t2 = createTransformation("intermediate", "other",
             source2, source3);
-        router.getTransformationConfig().add(t2);
+        router.transformationConfig().add(t2);
 
         router.publish("source", source1);
         verify(listener).delivered(any(EventInfo.class),