You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2007/11/27 12:44:31 UTC
svn commit: r598606 -
/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java
Author: jstrachan
Date: Tue Nov 27 03:44:30 2007
New Revision: 598606
URL: http://svn.apache.org/viewvc?rev=598606&view=rev
Log:
added some snippets so we can document this more easily
Modified:
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java?rev=598606&r1=598605&r2=598606&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java Tue Nov 27 03:44:30 2007
@@ -28,6 +28,7 @@
*
* @version $Revision: 1.1 $
*/
+// START SNIPPET: example
public class MyAssertions implements InitializingBean {
@EndpointInject(uri="mock:matched")
private MockEndpoint matched;
@@ -36,15 +37,16 @@
private MockEndpoint notMatched;
public void afterPropertiesSet() throws Exception {
+ // lets add some expectations
matched.expectedMessageCount(1);
notMatched.expectedMessageCount(0);
}
public void assertEndpointsValid() throws Exception {
+ // now lets perform some assertions that the test worked as we expect
Assert.assertNotNull("Should have a matched endpoint", matched);
Assert.assertNotNull("Should have a notMatched endpoint", notMatched);
MockEndpoint.assertIsSatisfied(matched, notMatched);
}
-
-
}
+// END SNIPPET: example