svn commit: r595703 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r595703 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java

jstrachan-2
Author: jstrachan
Date: Fri Nov 16 07:31:26 2007
New Revision: 595703

URL: http://svn.apache.org/viewvc?rev=595703&view=rev
Log:
tidied up the test case

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java?rev=595703&r1=595702&r2=595703&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java Fri Nov 16 07:31:26 2007
@@ -17,42 +17,28 @@
 package org.apache.camel.processor;
 
 import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
 
 /**
  * @version $Revision: 1.1 $
  */
 public class XPathFilterTest extends ContextTestSupport {
-    protected Endpoint<Exchange> startEndpoint;
-    protected MockEndpoint resultEndpoint;
-    protected String matchingBody = "<person name='James' city='London'/>";
-    protected String notMatchingBody = "<person name='Hiram' city='Tampa'/>";
-
     public void testSendMatchingMessage() throws Exception {
-        resultEndpoint.expectedMessageCount(1);
+        String body = "<person name='James' city='London'/>";
+        getMockEndpoint("mock:result").expectedBodiesReceived(body);
 
-        sendBody("direct:start", matchingBody);
+        sendBody("direct:start", body);
 
-        resultEndpoint.assertIsSatisfied();
+        assertMockEndpointsSatisifed();
     }
 
     public void testSendNotMatchingMessage() throws Exception {
-        resultEndpoint.expectedMessageCount(0);
-
-        sendBody("direct:start", notMatchingBody);
-
-        resultEndpoint.assertIsSatisfied();
-    }
+        String body = "<person name='Hiram' city='Tampa'/>";
+        getMockEndpoint("mock:result").expectedMessageCount(0);
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+        sendBody("direct:start", body);
 
-        startEndpoint = resolveMandatoryEndpoint("direct:start");
-        resultEndpoint = getMockEndpoint("mock:result");
+        assertMockEndpointsSatisifed();
     }
 
     protected RouteBuilder createRouteBuilder() {