camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1100505 - in /camel/trunk/components/camel-jing: pom.xml src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java
Date Sat, 07 May 2011 10:34:13 GMT
Author: davsclaus
Date: Sat May  7 10:34:13 2011
New Revision: 1100505

URL: http://svn.apache.org/viewvc?rev=1100505&view=rev
Log:
CAMEL-3032: Do not use test-jar in pom.xml.

Modified:
    camel/trunk/components/camel-jing/pom.xml
    camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java
    camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java

Modified: camel/trunk/components/camel-jing/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jing/pom.xml?rev=1100505&r1=1100504&r2=1100505&view=diff
==============================================================================
--- camel/trunk/components/camel-jing/pom.xml (original)
+++ camel/trunk/components/camel-jing/pom.xml Sat May  7 10:34:13 2011
@@ -56,14 +56,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-core</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-spring</artifactId>
-            <type>test-jar</type>
+            <artifactId>camel-test</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java?rev=1100505&r1=1100504&r2=1100505&view=diff
==============================================================================
--- camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java
(original)
+++ camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java
Sat May  7 10:34:13 2011
@@ -16,15 +16,41 @@
  */
 package org.apache.camel.component.validator.jing;
 
-import org.apache.camel.component.validator.ValidatorRouteTest;
+import org.apache.camel.test.junit4.CamelSpringTestSupport;
+import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
  * @version 
  */
-public class RNCRouteTest extends ValidatorRouteTest {
+public class RNCRouteTest extends CamelSpringTestSupport {
 
     protected ClassPathXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/camel/component/validator/jing/rnc-context.xml");
     }
+
+    @Test
+    public void testValidMessage() throws Exception {
+        getMockEndpoint("mock:valid").expectedMessageCount(1);
+        getMockEndpoint("mock:invalid").expectedMessageCount(0);
+        getMockEndpoint("mock:finally").expectedMessageCount(1);
+
+        template.sendBody("direct:start",
+                "<mail xmlns='http://foo.com/bar'><subject>Hey</subject><body>Hello
world!</body></mail>");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testInvalidMessage() throws Exception {
+        getMockEndpoint("mock:valid").expectedMessageCount(0);
+        getMockEndpoint("mock:invalid").expectedMessageCount(1);
+        getMockEndpoint("mock:finally").expectedMessageCount(1);
+
+        template.sendBody("direct:start",
+                "<mail xmlns='http://foo.com/bar'><body>Hello world!</body></mail>");
+
+        assertMockEndpointsSatisfied();
+    }
+
 }
\ No newline at end of file

Modified: camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java?rev=1100505&r1=1100504&r2=1100505&view=diff
==============================================================================
--- camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java
(original)
+++ camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java
Sat May  7 10:34:13 2011
@@ -16,15 +16,41 @@
  */
 package org.apache.camel.component.validator.jing;
 
-import org.apache.camel.component.validator.ValidatorRouteTest;
+import org.apache.camel.test.junit4.CamelSpringTestSupport;
+import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
  * @version 
  */
-public class RNGRouteTest extends ValidatorRouteTest {
+public class RNGRouteTest extends CamelSpringTestSupport {
 
     protected ClassPathXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/camel/component/validator/jing/rng-context.xml");
     }
+
+    @Test
+    public void testValidMessage() throws Exception {
+        getMockEndpoint("mock:valid").expectedMessageCount(1);
+        getMockEndpoint("mock:invalid").expectedMessageCount(0);
+        getMockEndpoint("mock:finally").expectedMessageCount(1);
+
+        template.sendBody("direct:start",
+                "<mail xmlns='http://foo.com/bar'><subject>Hey</subject><body>Hello
world!</body></mail>");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testInvalidMessage() throws Exception {
+        getMockEndpoint("mock:valid").expectedMessageCount(0);
+        getMockEndpoint("mock:invalid").expectedMessageCount(1);
+        getMockEndpoint("mock:finally").expectedMessageCount(1);
+
+        template.sendBody("direct:start",
+                "<mail xmlns='http://foo.com/bar'><body>Hello world!</body></mail>");
+
+        assertMockEndpointsSatisfied();
+    }
+
 }
\ No newline at end of file



Mime
View raw message