camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r785902 - in /camel/trunk/components/camel-stringtemplate: ./ src/test/java/org/apache/camel/component/stringtemplate/
Date Thu, 18 Jun 2009 04:57:53 GMT
Author: ningjiang
Date: Thu Jun 18 04:57:53 2009
New Revision: 785902

URL: http://svn.apache.org/viewvc?rev=785902&view=rev
Log:
CAMEL-1712 Upgraded the camel-stringtemplate to JUnit4

Modified:
    camel/trunk/components/camel-stringtemplate/pom.xml
    camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateConcurrentTest.java
    camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateContentCacheTest.java
    camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
    camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateTest.java

Modified: camel/trunk/components/camel-stringtemplate/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stringtemplate/pom.xml?rev=785902&r1=785901&r2=785902&view=diff
==============================================================================
--- camel/trunk/components/camel-stringtemplate/pom.xml (original)
+++ camel/trunk/components/camel-stringtemplate/pom.xml Thu Jun 18 04:57:53 2009
@@ -53,8 +53,7 @@
     <!-- testing -->
     <dependency>
       <groupId>org.apache.camel</groupId>
-      <artifactId>camel-core</artifactId>
-      <type>test-jar</type>
+      <artifactId>camel-test</artifactId>      
       <scope>test</scope>
     </dependency>
 

Modified: camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateConcurrentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateConcurrentTest.java?rev=785902&r1=785901&r2=785902&view=diff
==============================================================================
--- camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateConcurrentTest.java
(original)
+++ camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateConcurrentTest.java
Thu Jun 18 04:57:53 2009
@@ -20,18 +20,21 @@
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
 
 /**
  * @version $Revision$
  */
-public class StringTemplateConcurrentTest extends ContextTestSupport {
+public class StringTemplateConcurrentTest extends CamelTestSupport {
 
+    @Test
     public void testNoConcurrentProducers() throws Exception {
         doSendMessages(1, 1);
     }
 
+    @Test
     public void testConcurrentProducers() throws Exception {
         doSendMessages(10, 5);
     }

Modified: camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateContentCacheTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateContentCacheTest.java?rev=785902&r1=785901&r2=785902&view=diff
==============================================================================
--- camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateContentCacheTest.java
(original)
+++ camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateContentCacheTest.java
Thu Jun 18 04:57:53 2009
@@ -16,23 +16,27 @@
  */
 package org.apache.camel.component.stringtemplate;
 
-import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Unit test the cahce when reloading .tm files in the classpath
  */
-public class StringTemplateContentCacheTest extends ContextTestSupport {
+public class StringTemplateContentCacheTest extends CamelTestSupport {
 
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         super.setUp();
 
         // create a tm file in the classpath as this is the tricky reloading stuff
         template.sendBodyAndHeader("file://target/test-classes/org/apache/camel/component/stringtemplate?fileExist=Override",
"Hello $headers.name$", Exchange.FILE_NAME, "hello.tm");
     }
 
+    @Test
     public void testNotCached() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Hello London");
@@ -50,6 +54,7 @@
         mock.assertIsSatisfied();
     }
 
+    @Test
     public void testCached() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Hello London");

Modified: camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java?rev=785902&r1=785901&r2=785902&view=diff
==============================================================================
--- camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
(original)
+++ camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateLetterTest.java
Thu Jun 18 04:57:53 2009
@@ -16,16 +16,17 @@
  */
 package org.apache.camel.component.stringtemplate;
 
-import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
 
 /**
  * Unit test for wiki documentation
  */
-public class StringTemplateLetterTest extends ContextTestSupport {
+public class StringTemplateLetterTest extends CamelTestSupport {
 
     // START SNIPPET: e1
     private Exchange createLetter() {
@@ -38,6 +39,7 @@
         return exchange;
     }
 
+    @Test
     public void testVelocityLetter() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);

Modified: camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateTest.java?rev=785902&r1=785901&r2=785902&view=diff
==============================================================================
--- camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateTest.java
(original)
+++ camel/trunk/components/camel-stringtemplate/src/test/java/org/apache/camel/component/stringtemplate/StringTemplateTest.java
Thu Jun 18 04:57:53 2009
@@ -16,22 +16,25 @@
  */
 package org.apache.camel.component.stringtemplate;
 
-import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
 
 /**
  * @version $Revision$
  */
-public class StringTemplateTest extends ContextTestSupport {
+public class StringTemplateTest extends CamelTestSupport {
 
+    @Test
     public void testReceivesFooResponse() throws Exception {
         assertRespondsWith("foo", "<hello>foo</hello>");
     }
 
+    @Test
     public void testReceivesBarResponse() throws Exception {
         assertRespondsWith("bar", "<hello>bar</hello>");
     }



Mime
View raw message