camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hekon...@apache.org
Subject git commit: DRYied test.
Date Wed, 09 Apr 2014 18:51:56 GMT
Repository: camel
Updated Branches:
  refs/heads/master abb03ae23 -> 5e7ae6928


DRYied test.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5e7ae692
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5e7ae692
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5e7ae692

Branch: refs/heads/master
Commit: 5e7ae69281142dd3e3a36f94367cc6fe293c735a
Parents: abb03ae
Author: Henryk Konsek <hekonsek@gmail.com>
Authored: Wed Apr 9 20:51:34 2014 +0200
Committer: Henryk Konsek <hekonsek@gmail.com>
Committed: Wed Apr 9 20:51:34 2014 +0200

----------------------------------------------------------------------
 .../camel/dataformat/xstream/MarshalListTest.java      | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5e7ae692/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
----------------------------------------------------------------------
diff --git a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
index 2d49ac5..31e7dcf 100644
--- a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
+++ b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
@@ -32,9 +33,11 @@ import org.junit.Test;
  */
 public class MarshalListTest extends CamelTestSupport {
 
+    @EndpointInject(uri = "mock:result")
+    MockEndpoint mock;
+
     @Test
     public void testMarshalList() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
         mock.expectedBodiesReceived("<?xml version='1.0' encoding='ISO-8859-1'?>"
             + "<list><string>Hello World</string></list>");
@@ -49,7 +52,6 @@ public class MarshalListTest extends CamelTestSupport {
 
     @Test
     public void testMarshalListWithMap() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
         mock.expectedBodiesReceived(
             "<?xml version='1.0' encoding='UTF-8'?><list><map><entry><string>city</string>"
@@ -64,10 +66,9 @@ public class MarshalListTest extends CamelTestSupport {
 
         mock.assertIsSatisfied();
     }
-    
+
     @Test
     public void testSetEncodingOnXstream() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
         mock.expectedBodiesReceived(
             "<?xml version='1.0' encoding='UTF-8'?><list><map><entry><string>city</string>"
@@ -86,8 +87,8 @@ public class MarshalListTest extends CamelTestSupport {
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("direct:in").marshal().xstream().to("mock:result");
-                from("direct:in-UTF-8").marshal().xstream("UTF-8").to("mock:result");
+                from("direct:in").marshal().xstream().to(mock);
+                from("direct:in-UTF-8").marshal().xstream("UTF-8").to(mock);
             }
         };
     }


Mime
View raw message