Author: davsclaus
Date: Tue Aug 31 13:57:55 2010
New Revision: 991194

URL: http://svn.apache.org/viewvc?rev=991194&view=rev
Log:
Added spring based unit test of quartz with cron expression.

Added:
    
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.java
    
camel/trunk/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.xml
Modified:
    camel/trunk/components/camel-quartz/pom.xml

Modified: camel/trunk/components/camel-quartz/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/pom.xml?rev=991194&r1=991193&r2=991194&view=diff
==============================================================================
--- camel/trunk/components/camel-quartz/pom.xml (original)
+++ camel/trunk/components/camel-quartz/pom.xml Tue Aug 31 13:57:55 2010
@@ -63,6 +63,11 @@
         <!-- testing -->
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-spring</artifactId>            
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-test</artifactId>            
             <scope>test</scope>
         </dependency>

Added: 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.java?rev=991194&view=auto
==============================================================================
--- 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.java
 (added)
+++ 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.java
 Tue Aug 31 13:57:55 2010
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class SpringQuartzCronRouteTest extends CamelSpringTestSupport {
+
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new 
ClassPathXmlApplicationContext("org/apache/camel/component/quartz/SpringQuartzCronRouteTest.xml");
+    }
+
+    @Test
+    public void testQuartzCronRoute() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMinimumMessageCount(3);
+
+        assertMockEndpointsSatisfied();
+    }
+
+}

Added: 
camel/trunk/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.xml?rev=991194&view=auto
==============================================================================
--- 
camel/trunk/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.xml
 (added)
+++ 
camel/trunk/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzCronRouteTest.xml
 Tue Aug 31 13:57:55 2010
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+    <!-- START SNIPPET: e1 -->
+    <camelContext xmlns="http://camel.apache.org/schema/spring";>
+        <route>
+            <from uri="quartz://myGroup/myTimerName?cron=0/2+*+*+*+*+?"/>
+            <to uri="mock:result"/>
+        </route>
+    </camelContext>
+    <!-- END SNIPPET: e1 -->
+
+</beans>


Reply via email to