Author: cmueller
Date: Sun Jan 8 11:09:23 2012
New Revision: 1228825
URL: http://svn.apache.org/viewvc?rev=1228825&view=rev
Log:
fixed broken unit test
Modified:
camel/trunk/examples/camel-example-cxf-osgi/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java
camel/trunk/examples/camel-example-cxf-osgi/src/test/resources/camel-context.xml
Modified:
camel/trunk/examples/camel-example-cxf-osgi/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf-osgi/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java?rev=1228825&r1=1228824&r2=1228825&view=diff
==============================================================================
---
camel/trunk/examples/camel-example-cxf-osgi/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java
(original)
+++
camel/trunk/examples/camel-example-cxf-osgi/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java
Sun Jan 8 11:09:23 2012
@@ -31,11 +31,12 @@ import org.springframework.context.suppo
public class ReportIncidentRoutesClientTest extends CamelSpringTestSupport {
// should be the same address as we have in our route
- private static final String URL =
"http://localhost:{{port}}/cxf/camel-example-cxf-osgi/webservices/incident";
+ private static final String URL =
"http://localhost:%s/cxf/camel-example-cxf-osgi/webservices/incident";
+ private static final int port = AvailablePortFinder.getNextAvailable(9100);
@BeforeClass
public static void setUpBeforeClass() {
- System.setProperty("port",
String.valueOf(AvailablePortFinder.getNextAvailable(9100)));
+ System.setProperty("port", String.valueOf(port));
}
@AfterClass
@@ -65,8 +66,7 @@ public class ReportIncidentRoutesClientT
input.setPhone("0045 2962 7576");
// create the webservice client and send the request
- String url = context.resolvePropertyPlaceholders(URL);
- ReportIncidentEndpoint client = createCXFClient(url);
+ ReportIncidentEndpoint client = createCXFClient(String.format(URL,
port));
OutputReportIncident out = client.reportIncident(input);
// assert we got a OK back
Modified:
camel/trunk/examples/camel-example-cxf-osgi/src/test/resources/camel-context.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf-osgi/src/test/resources/camel-context.xml?rev=1228825&r1=1228824&r2=1228825&view=diff
==============================================================================
---
camel/trunk/examples/camel-example-cxf-osgi/src/test/resources/camel-context.xml
(original)
+++
camel/trunk/examples/camel-example-cxf-osgi/src/test/resources/camel-context.xml
Sun Jan 8 11:09:23 2012
@@ -29,7 +29,7 @@
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>
<cxf:cxfEndpoint id="reportIncident"
-
address="http://localhost:{{port}}/cxf/camel-example-cxf-osgi/webservices/incident"
+
address="http://localhost:${port}/cxf/camel-example-cxf-osgi/webservices/incident"
wsdlURL="META-INF/wsdl/report_incident.wsdl"
serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint">
</cxf:cxfEndpoint>
@@ -37,8 +37,6 @@
<bean id="reportIncidentRoutes"
class="org.apache.camel.example.reportincident.ReportIncidentRoutes" />
<camel:camelContext id="camel">
- <!-- property which contains port number -->
- <camel:propertyPlaceholder id="properties"
location="file:target/custom.properties"/>
<camel:routeBuilder ref="reportIncidentRoutes"/>
</camel:camelContext>
</beans>