You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/08/07 14:23:32 UTC
svn commit: r801965 - in /camel/branches/camel-1.x: ./
examples/camel-example-cxf/
examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/
examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/
examples/camel-...
Author: ningjiang
Date: Fri Aug 7 12:23:31 2009
New Revision: 801965
URL: http://svn.apache.org/viewvc?rev=801965&view=rev
Log:
Merged revisions 801960 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r801960 | ningjiang | 2009-08-07 19:55:33 +0800 (Fri, 07 Aug 2009) | 1 line
CAMEL-1889 create unit tests for camel-example-cxf
........
Added:
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java
- copied, changed from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java
- copied, changed from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java
- copied, changed from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/resources/
- copied from r801960, camel/trunk/examples/camel-example-cxf/src/test/resources/
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/resources/log4j.properties
- copied unchanged from r801960, camel/trunk/examples/camel-example-cxf/src/test/resources/log4j.properties
camel/branches/camel-1.x/examples/camel-example-cxf/src/test/resources/logging.properties
- copied unchanged from r801960, camel/trunk/examples/camel-example-cxf/src/test/resources/logging.properties
Modified:
camel/branches/camel-1.x/ (props changed)
camel/branches/camel-1.x/examples/camel-example-cxf/pom.xml
camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/CamelCxfExample.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/jms/JmsBroker.java
camel/branches/camel-1.x/examples/camel-example-cxf/src/main/resources/wsdl/hello_world.wsdl
Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 7 12:23:31 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781314-781349,781775,781
923,781974,781993,782557,782594,782681,782886,782918-782923,783204,783248,783363,783639,783704,785564,785584,785599,787206,787581,787598,787605,787928,788393,789121,789703,790560,790936,791379,791476,791767,792038,792381,792398,792899,793359,793518,793547-793555,793862,793935,794237,794368,794550,794967,795790,798027,798052,798063,798489,798864,799252,800340,800785,800797
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781314-781349,781775,781
923,781974,781993,782557,782594,782681,782886,782918-782923,783204,783248,783363,783639,783704,785564,785584,785599,787206,787581,787598,787605,787928,788393,789121,789703,790560,790936,791379,791476,791767,792038,792381,792398,792899,793359,793518,793547-793555,793862,793935,794237,794368,794550,794967,795790,798027,798052,798063,798489,798864,799252,800340,800785,800797,801960
Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/pom.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/pom.xml?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/pom.xml (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/pom.xml Fri Aug 7 12:23:31 2009
@@ -70,6 +70,27 @@
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
@@ -124,6 +145,24 @@
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>pertest</forkMode>
+ <childDelegation>false</childDelegation>
+ <useFile>true</useFile>
+ <includes>
+ <include>**/*Test.*</include>
+ </includes>
+ <systemProperties>
+ <property>
+ <name>java.util.logging.config.file</name>
+ <value>${basedir}/target/test-classes/logging.properties</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+
<!-- Allows the example to be run via 'mvn compile exec:java' -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java Fri Aug 7 12:23:31 2009
@@ -16,16 +16,13 @@
*/
package org.apache.camel.example.camel.transport;
-import java.io.File;
import java.net.MalformedURLException;
-import java.net.URL;
+
import javax.xml.namespace.QName;
-import javax.xml.ws.ProtocolException;
import javax.xml.ws.Service;
import org.apache.hello_world_soap_http.Greeter;
import org.apache.hello_world_soap_http.PingMeFault;
-import org.apache.hello_world_soap_http.SOAPService;
import org.apache.hello_world_soap_http.types.FaultDetail;
public final class Client {
@@ -35,6 +32,7 @@
private static final QName PORT_NAME
= new QName("http://apache.org/hello_world_soap_http", "CamelPort");
private Service service;
+ private Greeter port;
public Client(String address) throws MalformedURLException {
@@ -42,15 +40,18 @@
service = Service.create(SERVICE_NAME);
service.addPort(PORT_NAME, javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING,
address);
+
+ System.out.println("Acquiring router port ...");
+ port = service.getPort(PORT_NAME, Greeter.class);
}
-
+ public Greeter getProxy() {
+ return port;
+ }
public void invoke() throws Exception {
- System.out.println("Acquiring router port ...");
- Greeter port = service.getPort(PORT_NAME, Greeter.class);
String resp;
System.out.println("Invoking sayHi...");
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java Fri Aug 7 12:23:31 2009
@@ -47,6 +47,17 @@
private CamelCxfExample() {
}
+
+ static class MyRouteBuilder extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ // Here we just pass the exception back , don't need to use errorHandler
+ errorHandler(noErrorHandler());
+ from(ROUTER_ENDPOINT_URI).to(SERVICE_ENDPOINT_URI);
+ }
+
+ }
public static void main(String args[]) throws Exception {
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java Fri Aug 7 12:23:31 2009
@@ -32,6 +32,7 @@
= new QName("http://apache.org/hello_world_soap_http", "SOAPService");
private String wsdlLocation;
private SOAPService soapService;
+
public Client(String wsdl) throws MalformedURLException {
URL wsdlURL = null;
@@ -47,13 +48,18 @@
}
soapService = new SOAPService(wsdlURL, SERVICE_NAME);
}
+
+ public Greeter getProxy() {
+ Greeter port = soapService.getSoapOverHttpRouter();
+ return port;
+ }
public void invoke() throws Exception {
System.out.println("Acquiring router port ...");
- Greeter port = soapService.getSoapOverHttpRouter();
+ Greeter port = getProxy();
String resp;
System.out.println("Invoking sayHi...");
@@ -66,15 +72,6 @@
System.out.println("Server responded with: " + resp);
System.out.println();
- System.out.println("Invoking greetMe with invalid length string, expecting exception...");
- try {
- resp = port.greetMe("Invoking greetMe with invalid length string, expecting exception...");
- } catch (ProtocolException e) {
- System.out.println("Expected exception has occurred: " + e.getClass().getName());
- }
-
- System.out.println();
-
System.out.println("Invoking greetMeOneWay...");
port.greetMeOneWay(System.getProperty("user.name"));
System.out.println("No response from server as method is OneWay");
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/CamelCxfExample.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/CamelCxfExample.java?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/CamelCxfExample.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/CamelCxfExample.java Fri Aug 7 12:23:31 2009
@@ -36,7 +36,9 @@
// set the client's service access point
Client client = new Client("http://localhost:9000/GreeterContext/SOAPMessageService");
// invoke the services
- client.invoke();
+ String response = client.invoke();
+
+ System.out.println(response);
} catch (Exception ex) {
ex.printStackTrace();
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java Fri Aug 7 12:23:31 2009
@@ -41,7 +41,7 @@
this.endpointAddress = endpointAddress;
}
- public void invoke() throws Exception {
+ public String invoke() throws Exception {
// Service Qname as defined in the WSDL.
QName serviceName = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
@@ -96,8 +96,8 @@
SOAPElement bodyElement = (SOAPElement)body.getChildElements(responseName).next();
String responseMessageText = bodyElement.getTextContent();
-
- System.out.println(responseMessageText);
+
+ return responseMessageText;
}
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/jms/JmsBroker.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/jms/JmsBroker.java?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/jms/JmsBroker.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/main/java/org/apache/camel/example/jms/JmsBroker.java Fri Aug 7 12:23:31 2009
@@ -24,7 +24,7 @@
public final class JmsBroker {
JMSEmbeddedBroker jmsBrokerThread;
- String jmsBrokerUrl = "tcp://localhost:61616";
+ String jmsBrokerUrl = "vm://localhost";
String activeMQStorageDir;
public JmsBroker() {
}
Modified: camel/branches/camel-1.x/examples/camel-example-cxf/src/main/resources/wsdl/hello_world.wsdl
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/main/resources/wsdl/hello_world.wsdl?rev=801965&r1=801964&r2=801965&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-cxf/src/main/resources/wsdl/hello_world.wsdl (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/main/resources/wsdl/hello_world.wsdl Fri Aug 7 12:23:31 2009
@@ -240,7 +240,7 @@
jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="dynamicQueues/test.soap.jmstransport.queue">
<jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
- <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61616"/>
+ <jms:JMSNamingProperty name="java.naming.provider.url" value="vm://localhost"/>
</jms:address>
</wsdl:port>
</wsdl:service>
Copied: camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java (from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java)
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java?p2=camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java&p1=camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java&r1=801960&r2=801965&rev=801965&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java Fri Aug 7 12:23:31 2009
@@ -18,30 +18,31 @@
import java.net.MalformedURLException;
+import junit.framework.TestCase;
+
import org.apache.hello_world_soap_http.Greeter;
import org.apache.hello_world_soap_http.PingMeFault;
import org.apache.hello_world_soap_http.types.FaultDetail;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-public class CamelTransportClientServerTest extends Assert {
- private static Server server = new Server();
+
+public class CamelTransportClientServerTest extends TestCase {
+ private Server server = new Server();
- @BeforeClass
- public static void startUpServer() throws Exception {
+
+ public void startUpServer() throws Exception {
server.prepare();
server.start();
}
- @AfterClass
- public static void shutDownServer() {
+
+ public void shutDownServer() {
server.stop();
}
- @Test
- public void testClientInvocation() throws MalformedURLException {
+
+ public void testClientInvocation() throws Exception {
+ startUpServer();
+
Client client = new Client("http://localhost:9091/GreeterContext/GreeterPort");
Greeter port = client.getProxy();
@@ -71,6 +72,8 @@
assertEquals("Wrong FaultDetail major:", 2, detail.getMajor());
assertEquals("Wrong FaultDetail minor:", 1, detail.getMinor());
}
+
+ shutDownServer();
}
Copied: camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java (from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java)
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java?p2=camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java&p1=camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java&r1=801960&r2=801965&rev=801965&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java Fri Aug 7 12:23:31 2009
@@ -20,29 +20,26 @@
import javax.xml.ws.ProtocolException;
+import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.example.cxf.CamelCxfExample.MyRouteBuilder;
import org.apache.camel.example.jms.JmsBroker;
-import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.hello_world_soap_http.Greeter;
import org.apache.hello_world_soap_http.PingMeFault;
import org.apache.hello_world_soap_http.types.FaultDetail;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-public class CxfHttpJmsClientServerTest extends CamelTestSupport {
+
+public class CxfHttpJmsClientServerTest extends ContextTestSupport {
static JmsBroker broker = new JmsBroker();
static Server server = new Server();
private static final String ROUTER_ADDRESS = "http://localhost:9001/SoapContext/SoapPort";
- @BeforeClass
+
public static void startUpJmsBroker() throws Exception {
broker.start();
server.start();
}
- @AfterClass
public static void shutDownJmsBroker() throws Exception {
server.stop();
broker.stop();
@@ -53,8 +50,10 @@
return new MyRouteBuilder();
}
- @Test
- public void testClientInvocation() throws MalformedURLException {
+
+ public void testClientInvocation() throws Exception {
+ startUpJmsBroker();
+
Client client = new Client(ROUTER_ADDRESS + "?wsdl");
Greeter proxy = client.getProxy();
@@ -75,6 +74,7 @@
assertEquals("Wrong FaultDetail major:", 2, detail.getMajor());
assertEquals("Wrong FaultDetail minor:", 1, detail.getMinor());
}
+ shutDownJmsBroker();
}
Copied: camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java (from r801960, camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java)
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java?p2=camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java&p1=camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java&r1=801960&r2=801965&rev=801965&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java (original)
+++ camel/branches/camel-1.x/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java Fri Aug 7 12:23:31 2009
@@ -17,14 +17,13 @@
package org.apache.camel.example.provider;
import org.apache.camel.example.cxf.provider.Client;
-import org.apache.camel.test.junit4.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.spring.SpringTestSupport;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-public class ProviderClientServerTest extends CamelSpringTestSupport {
+public class ProviderClientServerTest extends SpringTestSupport {
- @Test
+
public void testClientInvocation() throws Exception {
// set the client's service access point
Client client = new Client("http://localhost:9000/GreeterContext/SOAPMessageService");