camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject git commit: Try to fix the CI test error of CxfRsRelayTest
Date Wed, 27 Aug 2014 07:43:09 GMT
Repository: camel
Updated Branches:
  refs/heads/master ec34144a7 -> 877854777


Try to fix the CI test error of CxfRsRelayTest


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/87785477
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/87785477
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/87785477

Branch: refs/heads/master
Commit: 8778547770713afca1c6267989d60d2893511a5b
Parents: ec34144
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Wed Aug 27 15:40:22 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Wed Aug 27 15:40:46 2014 +0800

----------------------------------------------------------------------
 .../component/cxf/jaxrs/CxfRsRelayTest.java     | 36 +++++++++++---------
 .../component/cxf/jaxrs/CxfRsSpringRelay.xml    |  9 +++--
 2 files changed, 25 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/87785477/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRelayTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRelayTest.java
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRelayTest.java
index 1e05ff4..3033a81 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRelayTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRelayTest.java
@@ -33,6 +33,7 @@ import javax.ws.rs.Produces;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.cxf.CXFTestSupport;
 import org.apache.camel.spring.Main;
 import org.apache.camel.test.junit4.TestSupport;
 import org.apache.cxf.helpers.IOUtils;
@@ -41,6 +42,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Multipart;
 import org.junit.Test;
 
 public class CxfRsRelayTest extends TestSupport {
+    private static int port6 = CXFTestSupport.getPort6(); 
     /**
      * A sample service "interface" (technically, it is a class since we will
      * use proxy-client. That interface exposes three methods over-loading each
@@ -94,6 +96,22 @@ public class CxfRsRelayTest extends TestSupport {
         try {
             main.setApplicationContextUri("org/apache/camel/component/cxf/jaxrs/CxfRsSpringRelay.xml");
             main.start();
+            Thread t = new Thread(new Runnable() {
+                /**
+                 * Sends a request to the first endpoint in the route
+                 */
+                public void run() {
+                    try {
+                        JAXRSClientFactory.create("http://localhost:" + port6 + "/CxfRsRelayTest/rest",
UploadService.class)
+                            .upload(CamelRouteBuilder.class.getResourceAsStream(SAMPLE_CONTENT_PATH),
+                                    SAMPLE_NAME);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        throw new RuntimeException(e);
+                    }
+                }
+            });
+            t.start();
             LATCH.await(10, TimeUnit.SECONDS);
             assertEquals(SAMPLE_NAME, name);
             StringWriter writer = new StringWriter();
@@ -124,23 +142,7 @@ public class CxfRsRelayTest extends TestSupport {
                     LATCH.countDown();
                 }
             });
-            Thread t = new Thread(new Runnable() {
-                /**
-                 * Sends a request to the first endpoint in the route
-                 */
-                public void run() {
-                    try {
-                        JAXRSClientFactory.create(getContext().getEndpoint("upload1", CxfRsEndpoint.class)
-                                                      .getAddress(), UploadService.class)
-                            .upload(CamelRouteBuilder.class.getResourceAsStream(SAMPLE_CONTENT_PATH),
-                                    SAMPLE_NAME);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                        throw new RuntimeException(e);
-                    }
-                }
-            });
-            t.start();
+            
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/87785477/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRelay.xml
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRelay.xml
b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRelay.xml
index a7d5adc..97b5ede 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRelay.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRelay.xml
@@ -21,6 +21,9 @@
 	xsi:schemaLocation="http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
                         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">
+	
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+	
 	<bean id="builder"
 		class="org.apache.camel.component.cxf.jaxrs.CxfRsRelayTest.CamelRouteBuilder" />
 	<camel:camelContext id="cxfrs_context">
@@ -32,13 +35,13 @@
 		<camel:endpoint id="upload2Client"
 			uri="cxfrs:bean:rsClient2?httpClientAPI=false" />
 	</camel:camelContext>
-	<cxf:rsServer id="rsServer1" address="http://localhost:9002/rest"
+	<cxf:rsServer id="rsServer1" address="http://localhost:${CXFTestSupport.port6}/CxfRsRelayTest/rest"
 		serviceClass="org.apache.camel.component.cxf.jaxrs.CxfRsRelayTest.UploadService"
 		loggingFeatureEnabled="true" loggingSizeLimit="5000" />
-	<cxf:rsServer id="rsServer2" address="http://localhost:9002/rast"
+	<cxf:rsServer id="rsServer2" address="http://localhost:${CXFTestSupport.port6}/CxfRsRelayTest/rast"
 		serviceClass="org.apache.camel.component.cxf.jaxrs.CxfRsRelayTest.UploadService"
 		loggingFeatureEnabled="true" loggingSizeLimit="5000" />
-	<cxf:rsClient id="rsClient2" address="http://localhost:9002/rast"
+	<cxf:rsClient id="rsClient2" address="http://localhost:${CXFTestSupport.port6}/CxfRsRelayTest/rast"
 		serviceClass="org.apache.camel.component.cxf.jaxrs.CxfRsRelayTest.UploadService"
 		loggingFeatureEnabled="true" loggingSizeLimit="5000" />
 </beans>
\ No newline at end of file


Mime
View raw message