camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r809904 [2/2] - in /camel/trunk/components/camel-web/src/test/java/org/apache/camel/web: groovy/ resources/ spring/ util/
Date Tue, 01 Sep 2009 09:06:20 GMT
Modified: camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsHtmlTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsHtmlTest.java?rev=809904&r1=809903&r2=809904&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsHtmlTest.java
(original)
+++ camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsHtmlTest.java
Tue Sep  1 09:06:18 2009
@@ -16,19 +16,22 @@
  */
 package org.apache.camel.web.resources;
 
+import org.junit.Test;
+
 
 /**
  * @version $Revision$
  */
 public class EndpointsHtmlTest extends TestSupport {
 
+    @Test
     public void testCamelAsHtml() throws Exception {
         String response = resource("/").accept("text/html").get(String.class);
 
         assertTrue("Should contain <html> but was: " + response, response.contains("<html>"));
     }
 
-
+    @Test
     public void testEndpointsAsHtml() throws Exception {
         String response = resource("endpoints").accept("text/html").get(String.class);
 

Modified: camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsTest.java?rev=809904&r1=809903&r2=809904&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsTest.java
(original)
+++ camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/EndpointsTest.java
Tue Sep  1 09:06:18 2009
@@ -21,12 +21,14 @@
 import org.apache.camel.web.model.Camel;
 import org.apache.camel.web.model.EndpointLink;
 import org.apache.camel.web.model.Endpoints;
+import org.junit.Test;
 
 /**
  * @version $Revision$
  */
 public class EndpointsTest extends TestSupport {
 
+    @Test
     public void testCamelAsXml() throws Exception {
         Camel camel = resource("/").accept("application/xml").get(Camel.class);
         assertValidCamel(camel);
@@ -35,6 +37,7 @@
         assertValidCamel(camel);
     }
 
+    @Test
     public void testEndpointsAsXml() throws Exception {
         Endpoints endpoints = resource("endpoints").accept("application/xml").get(Endpoints.class);
         assertValidEndpoints(endpoints);

Modified: camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/RoutesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/RoutesTest.java?rev=809904&r1=809903&r2=809904&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/RoutesTest.java
(original)
+++ camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/RoutesTest.java
Tue Sep  1 09:06:18 2009
@@ -20,6 +20,7 @@
 
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.model.RoutesDefinition;
+import org.junit.Test;
 
 
 /**
@@ -27,6 +28,7 @@
  */
 public class RoutesTest extends TestSupport {
 
+    @Test
     public void testRoutes() throws Exception {
 
         String text = resource.path("routes").accept("application/xml").get(String.class);

Modified: camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/StaticContentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/StaticContentTest.java?rev=809904&r1=809903&r2=809904&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/StaticContentTest.java
(original)
+++ camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/StaticContentTest.java
Tue Sep  1 09:06:18 2009
@@ -16,11 +16,14 @@
  */
 package org.apache.camel.web.resources;
 
+import org.junit.Test;
+
 /**
  * @version $Revision$
  */
 public class StaticContentTest  extends TestSupport {
 
+    @Test
     public void testCssFile() throws Exception {
         String response = resource("/css/site.css").get(String.class);
         assertNotNull("Should have returned a response", response);

Modified: camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/TestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/TestSupport.java?rev=809904&r1=809903&r2=809904&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/TestSupport.java
(original)
+++ camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/resources/TestSupport.java
Tue Sep  1 09:06:18 2009
@@ -16,30 +16,30 @@
  */
 package org.apache.camel.web.resources;
 
-import junit.framework.TestCase;
-
 import com.sun.jersey.api.client.Client;
 import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.api.client.config.ClientConfig;
 import com.sun.jersey.api.client.config.DefaultClientConfig;
-
 import org.apache.camel.web.Main;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
 
 /**
  * @version $Revision$
  */
-public class TestSupport extends TestCase {
+public class TestSupport extends Assert {
     private static final transient Log LOG = LogFactory.getLog(TestSupport.class);
 
     protected ClientConfig clientConfig;
     protected Client client;
     protected WebResource resource;
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Before
+    public void setUp() throws Exception {
+        
         Main.start();
 
         clientConfig = new DefaultClientConfig();
@@ -49,10 +49,8 @@
         resource = client.resource(Main.getRootUrl());
     }
 
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
+    @After
+    public void tearDown() throws Exception {
         Main.stop();
     }
 

Modified: camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/spring/CamelRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/spring/CamelRouteTest.java?rev=809904&r1=809903&r2=809904&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/spring/CamelRouteTest.java
(original)
+++ camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/spring/CamelRouteTest.java
Tue Sep  1 09:06:18 2009
@@ -21,21 +21,25 @@
 
 import javax.xml.bind.JAXBContext;
 
-import junit.framework.TestCase;
 import org.apache.camel.CamelContext;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.model.RoutesDefinition;
 import org.apache.camel.web.resources.CamelContextResource;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.FileSystemXmlApplicationContext;
 
 /**
  * @version $Revision$
  */
-public class CamelRouteTest extends TestCase {
+public class CamelRouteTest extends Assert {
     protected AbstractXmlApplicationContext applicationContext;
     protected CamelContext camelContext;
-
+ 
+    @Test
     public void testCanMarshalRoutes() throws Exception {
         CamelContextResource resource = new CamelContextResource(camelContext);
         RoutesDefinition routes = resource.getRoutesResource().getRouteDefinitions();
@@ -50,20 +54,18 @@
         System.out.println("XML is: " + xml);
     }
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Before
+    public void setUp() throws Exception {
         applicationContext = new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/applicationContext.xml");
         applicationContext.start();
         camelContext = (CamelContext) applicationContext.getBean("camelContext", CamelContext.class);
         assertNotNull("camelContext", camelContext);
     }
 
-    @Override
-    protected void tearDown() throws Exception {
+    @After
+    public void tearDown() throws Exception {
         if (applicationContext != null) {
             applicationContext.stop();
         }
-        super.tearDown();
     }
 }

Modified: camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/util/UriCharachersEncoderTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/util/UriCharachersEncoderTest.java?rev=809904&r1=809903&r2=809904&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/util/UriCharachersEncoderTest.java
(original)
+++ camel/trunk/components/camel-web/src/test/java/org/apache/camel/web/util/UriCharachersEncoderTest.java
Tue Sep  1 09:06:18 2009
@@ -17,12 +17,16 @@
 
 package org.apache.camel.web.util;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+
 
 /**
  *
  */
-public class UriCharachersEncoderTest extends TestCase {
+public class UriCharachersEncoderTest extends Assert {
+    @Test
     public void testEncoder() {
         String afterEncoding = "direct:%2F%2Fstart";
         String beforeEncoding = "direct://start";
@@ -31,6 +35,7 @@
         assertEquals("Get the wrong encoding result", afterEncoding, result);
     }
 
+    @Test
     public void testNoEncoding() {
         String noEncoding = "direct:start";
         String result = UriCharactersEncoder.encode(noEncoding);



Mime
View raw message