Author: davsclaus
Date: Sun Nov 11 13:13:26 2012
New Revision: 1407971
URL: http://svn.apache.org/viewvc?rev=1407971&view=rev
Log:
Use dynamic port in test
Modified:
camel/branches/camel-2.10.x/ (props changed)
camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
camel/branches/camel-2.10.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1407970
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java?rev=1407971&r1=1407970&r2=1407971&view=diff
==============================================================================
---
camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
(original)
+++
camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
Sun Nov 11 13:13:26 2012
@@ -38,7 +38,8 @@ import org.springframework.context.suppo
*/
public class CxfRsProducerClientFactoryCacheTest extends Assert {
private static int port1 = CXFTestSupport.getPort1();
-
+ private static int port2 = CXFTestSupport.getPort2();
+
private CamelContext context1;
private CamelContext context2;
private ProducerTemplate template1;
@@ -62,11 +63,15 @@ public class CxfRsProducerClientFactoryC
@After
public void tearDown() throws Exception {
- context1.stop();
- template1.stop();
-
- context2.stop();
- template2.stop();
+ if (context1 != null) {
+ context1.stop();
+ template1.stop();
+ }
+
+ if (context2 != null) {
+ context2.stop();
+ template2.stop();
+ }
}
@Test
@@ -84,6 +89,7 @@ public class CxfRsProducerClientFactoryC
inMessage.setHeader(Exchange.HTTP_METHOD, "GET");
inMessage.setHeader(Exchange.HTTP_PATH,
"/customerservice/customers/123");
inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS,
Customer.class);
+ inMessage.setHeader("port", getPort2());
inMessage.setBody(null);
}
});
@@ -100,4 +106,8 @@ public class CxfRsProducerClientFactoryC
public int getPort1() {
return port1;
}
+
+ public int getPort2() {
+ return port2;
+ }
}
Modified:
camel/branches/camel-2.10.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml?rev=1407971&r1=1407970&r2=1407971&view=diff
==============================================================================
---
camel/branches/camel-2.10.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
(original)
+++
camel/branches/camel-2.10.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
Sun Nov 11 13:13:26 2012
@@ -28,7 +28,7 @@
http://cxf.apache.org/schemas/configuration/http-conf.xsd ">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
- <jaxrs:server id="restService"
address="https://localhost:8181/CxfRsProducerTest/"
+ <jaxrs:server id="restService"
address="https://localhost:${CXFTestSupport.port2}/CxfRsProducerTest/"
staticSubresourceResolution="true">
<jaxrs:serviceBeans>
<ref bean="customerService"/>
@@ -40,13 +40,14 @@
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct://http"/>
- <to
uri="cxfrs://https://localhost:8181/CxfRsProducerTest/"/>
-
+ <recipientList>
+
<simple>cxfrs://https://localhost:${header.port}/CxfRsProducerTest/</simple>
+ </recipientList>
</route>
</camelContext>
<httpj:engine-factory id="tls-config">
- <httpj:engine port="8181">
+ <httpj:engine port="${CXFTestSupport.port2}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="password">
<sec:keyStore type="JKS"
password="password"
file="src/test/resources/org/apache/camel/component/cxf/jaxrs/Bethal.jks"/>