Author: jstrachan
Date: Tue Dec 2 09:06:40 2008
New Revision: 722526
URL: http://svn.apache.org/viewvc?rev=722526&view=rev
Log:
replace the inheritence of a template field with explicit injection to simplify
understanding
Modified:
activemq/camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java
Modified:
activemq/camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java?rev=722526&r1=722525&r2=722526&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java
(original)
+++
activemq/camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java
Tue Dec 2 09:06:40 2008
@@ -17,6 +17,8 @@
package org.apache.camel.test.patterns;
import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
import org.apache.camel.test.CamelTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
@@ -29,10 +31,15 @@
@EndpointInject(uri="mock:result")
protected MockEndpoint resultEndpoint;
+ @Produce(uri="direct:start")
+ protected ProducerTemplate template;
+
public void testSendMatchingMessage() throws Exception {
- resultEndpoint.expectedMessageCount(1);
+ String expectedBody = "<matched/>";
+
+ resultEndpoint.expectedBodiesReceived(expectedBody);
- template.sendBodyAndHeader("direct:start", "<matched/>", "foo", "bar");
+ template.sendBodyAndHeader(expectedBody, "foo", "bar");
resultEndpoint.assertIsSatisfied();
}
@@ -40,7 +47,7 @@
public void testSendNotMatchingMessage() throws Exception {
resultEndpoint.expectedMessageCount(0);
- template.sendBodyAndHeader("direct:start", "<notMatched/>", "foo",
"notMatchedHeaderValue");
+ template.sendBodyAndHeader("<notMatched/>", "foo",
"notMatchedHeaderValue");
resultEndpoint.assertIsSatisfied();
}