camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r790560 - in /camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty: HttpClient.java JettyValidatorStreamTest.java JettyValidatorStreamWithStreamCachingEnabledTest.java JettyValidatorTest.java
Date Thu, 02 Jul 2009 12:17:51 GMT
Author: davsclaus
Date: Thu Jul  2 12:17:51 2009
New Revision: 790560

URL: http://svn.apache.org/viewvc?rev=790560&view=rev
Log:
Fixed some unit tests reported by TC.

Removed:
    camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/HttpClient.java
Modified:
    camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamTest.java
    camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamWithStreamCachingEnabledTest.java
    camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorTest.java

Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamTest.java?rev=790560&r1=790559&r2=790560&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamTest.java
(original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamTest.java
Thu Jul  2 12:17:51 2009
@@ -29,9 +29,10 @@
 
     @Test
     public void testValideRequestAsStream() throws Exception {
-        InputStream inputStream = HttpClient.class.getResourceAsStream("ValidRequest.xml");
+        InputStream inputStream = this.getClass().getResourceAsStream("ValidRequest.xml");
         assertNotNull("the inputStream should not be null", inputStream);
-        String response = HttpClient.send(inputStream);
+
+        String response = template.requestBody("http://localhost:8192/test", inputStream,
String.class);
         assertEquals("The response should be ok", response, "<ok/>");
     }
 

Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamWithStreamCachingEnabledTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamWithStreamCachingEnabledTest.java?rev=790560&r1=790559&r2=790560&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamWithStreamCachingEnabledTest.java
(original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorStreamWithStreamCachingEnabledTest.java
Thu Jul  2 12:17:51 2009
@@ -29,9 +29,10 @@
 
     @Test
     public void testValideRequestAsStream() throws Exception {
-        InputStream inputStream = HttpClient.class.getResourceAsStream("ValidRequest.xml");
+        InputStream inputStream = this.getClass().getResourceAsStream("ValidRequest.xml");
         assertNotNull("the inputStream should not be null", inputStream);
-        String response = HttpClient.send(inputStream);
+
+        String response = template.requestBody("http://localhost:8192/test", inputStream,
String.class);
         assertEquals("The response should be ok", response, "<ok/>");
     }
 

Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorTest.java?rev=790560&r1=790559&r2=790560&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorTest.java
(original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyValidatorTest.java
Thu Jul  2 12:17:51 2009
@@ -27,17 +27,20 @@
 
     @Test
     public void testValideRequest() throws Exception {
-        InputStream inputStream = HttpClient.class.getResourceAsStream("ValidRequest.xml");
+        InputStream inputStream = this.getClass().getResourceAsStream("ValidRequest.xml");
         assertNotNull("the inputStream should not be null", inputStream);
-        String response = HttpClient.send(inputStream);
+
+        String response = template.requestBody("http://localhost:8192/test", inputStream,
String.class);
+
         assertEquals("The response should be ok", response, "<ok/>");
     }
 
     @Test
     public void testInvalideRequest() throws Exception {
-        InputStream inputStream = HttpClient.class.getResourceAsStream("InvalidRequest.xml");
+        InputStream inputStream = this.getClass().getResourceAsStream("InvalidRequest.xml");
         assertNotNull("the inputStream should not be null", inputStream);
-        String response = HttpClient.send(inputStream);
+
+        String response = template.requestBody("http://localhost:8192/test", inputStream,
String.class);
         assertEquals("The response should be error", response, "<error/>");
     }
 



Mime
View raw message