Author: ningjiang
Date: Fri Oct 30 09:29:32 2009
New Revision: 831236

URL: http://svn.apache.org/viewvc?rev=831236&view=rev
Log:
CAMEL-2118 start the camel-example-cxf services from spring

Added:
    camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
   (props changed)
      - copied unchanged from r830852, 
camel/trunk/examples/camel-example-cxf/src/main/resources/org/apache/camel/example/cxf/provider/CamelCXFRouteConfig.xml
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
   (with props)
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
   (with props)
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
   (with props)
Removed:
    
camel/trunk/examples/camel-example-cxf/src/main/resources/org/apache/camel/example/cxf/provider/CamelCXFRouteConfig.xml
Modified:
    camel/trunk/examples/camel-example-cxf/pom.xml
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/GreeterImpl.java
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Server.java
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Server.java
    
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java
    
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java
    
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java
    
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java

Modified: camel/trunk/examples/camel-example-cxf/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/pom.xml?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cxf/pom.xml (original)
+++ camel/trunk/examples/camel-example-cxf/pom.xml Fri Oct 30 09:29:32 2009
@@ -84,6 +84,17 @@
       <groupId>org.apache.activemq</groupId>
       <artifactId>activemq-core</artifactId>
     </dependency>
+    
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-spring</artifactId>
+      <exclusions>
+       <exclusion>
+         <groupId>org.springframework</groupId>
+         <artifactId>spring</artifactId>
+       </exclusion>
+      </exclusions>
+    </dependency>
 
     <dependency>
       <groupId>xerces</groupId>

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/GreeterImpl.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/GreeterImpl.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/GreeterImpl.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/GreeterImpl.java
 Fri Oct 30 09:29:32 2009
@@ -32,7 +32,10 @@
 
     private String suffix;
 
-    public GreeterImpl(String suffix) {
+    public GreeterImpl() {
+    }
+    
+    public void setSuffix(String suffix) {
         this.suffix = suffix;
     }
 

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Server.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Server.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Server.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Server.java
 Fri Oct 30 09:29:32 2009
@@ -18,6 +18,8 @@
 
 import javax.xml.ws.Endpoint;
 
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
@@ -40,11 +42,13 @@
         // start the endpoints
         System.out.println("Starting Server");
         // START SNIPPET: e2
-        Object implementor = new GreeterImpl("EndpointA");
+        GreeterImpl implementor = new GreeterImpl();
+        implementor.setSuffix("EndpointA");
         String address = "camel://direct:EndpointA";
         endpointA = Endpoint.publish(address, implementor);
 
-        implementor = new GreeterImpl("EndpointB");
+        implementor = new GreeterImpl();
+        implementor.setSuffix("EndpointB");
         address = "camel://direct:EndpointB";
         endpointB = Endpoint.publish(address, implementor);
         // END SNIPPET: e2
@@ -58,12 +62,13 @@
             endpointB.stop();
         }
     }
-
+    
 
     public static void main(String args[]) throws Exception {
         Server server = new Server();
         server.prepare();
         server.start();
+        
         System.out.println("Server ready...");
 
         Thread.sleep(5 * 60 * 1000);

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
 Fri Oct 30 09:29:32 2009
@@ -44,7 +44,7 @@
     private CamelCxfExample() {
     }
     
-    static class MyRouteBuilder extends RouteBuilder {
+    public static class MyRouteBuilder extends RouteBuilder {
 
         @Override
         public void configure() throws Exception {

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Server.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Server.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Server.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Server.java
 Fri Oct 30 09:29:32 2009
@@ -18,24 +18,25 @@
 
 import javax.xml.ws.Endpoint;
 
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 
 public class Server {
-    Endpoint endpoint;
+    AbstractApplicationContext applicationContext;
 
     public void start() throws Exception {
         // Setup the Camel context using Spring
-        SpringBusFactory bf = new SpringBusFactory();
-        BusFactory.setDefaultBus(null);
-        Bus bus = 
bf.createBus("/org/apache/camel/example/cxf/provider/CamelCXFRouteConfig.xml");
-        BusFactory.setDefaultBus(bus);          
+        applicationContext = new 
ClassPathXmlApplicationContext("/META-INF/spring/CamelCXFProviderRouteConfig.xml");
+                 
     }
     
     public void stop() {
-        if (endpoint != null) {
-            endpoint.stop();
+        if (applicationContext != null) {
+            applicationContext.stop();
         }    
     }
     

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml?rev=831236&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
 Fri Oct 30 09:29:32 2009
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:jaxws="http://cxf.apache.org/jaxws";     
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd";>
+       
+       <import resource="classpath:META-INF/cxf/cxf.xml"/>
+       <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+       <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" 
/>
+       <import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />
+       <import 
resource="classpath:org/apache/camel/example/camel/transport/CamelDestination.xml"/>
+      
+       <jaxws:endpoint id="endpointA"
+               implementor="#implementorA"
+               address="camel://direct:EndpointA"
+       />
+       
+       <jaxws:endpoint id="endpointB"
+               implementor="#implementorB"
+               address="camel://direct:EndpointB"
+       />
+       
+       <bean id="implementorA" 
class="org.apache.camel.example.camel.transport.GreeterImpl">
+           <property name="suffix" value="EndpointA" />
+       </bean>
+       
+       <bean id="implementorB" 
class="org.apache.camel.example.camel.transport.GreeterImpl">
+           <property name="suffix" value="EndpointB" />
+       </bean>
+       
+
+</beans>
\ No newline at end of file

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml?rev=831236&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
 Fri Oct 30 09:29:32 2009
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:broker="http://activemq.apache.org/schema/core";
+       xmlns:camel="http://camel.apache.org/schema/spring";
+       xmlns:jaxws="http://cxf.apache.org/jaxws";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+       http://activemq.apache.org/schema/core 
http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd
+       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd";>
+
+  <broker:broker id="broker" useJmx="false" persistent="false" 
dataDirectory="target/activemq">
+    <broker:transportConnectors>
+       <broker:transportConnector name="openwire" uri="vm://localhost"/>
+    </broker:transportConnectors>
+  </broker:broker>
+
+  <camel:camelContext>
+    <camel:routeBuilder ref="myRouteBuilder"/>    
+  </camel:camelContext>
+
+  <bean id="myRouteBuilder" 
class="org.apache.camel.example.cxf.CamelCxfExample$MyRouteBuilder"/>
+  
+  <jaxws:endpoint id="serviceEndpoint"
+               implementor="org.apache.camel.example.cxf.GreeterImpl"
+               address="jms://JMSAddress"/>
+               
+  
+</beans>
\ No newline at end of file

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml?rev=831236&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
 Fri Oct 30 09:29:32 2009
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:camel="http://camel.apache.org/schema/spring";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+  <camel:camelContext>
+    <camel:package>org.apache.camel.example.cxf.jaxrs</camel:package>    
+  </camel:camelContext>
+
+
+</beans>

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/camel/transport/CamelTransportClientServerTest.java
 Fri Oct 30 09:29:32 2009
@@ -18,6 +18,9 @@
 
 import java.net.MalformedURLException;
 
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
 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;
@@ -27,17 +30,18 @@
 import org.junit.Test;
 
 public class CamelTransportClientServerTest extends Assert {
-    private static Server server = new Server();
+    static AbstractApplicationContext context;
     
     @BeforeClass
     public static void startUpServer() throws Exception {
-        server.prepare();
-        server.start();
+        context = new ClassPathXmlApplicationContext(new 
String[]{"/META-INF/spring/CamelTransportSpringConfig.xml"});   
     }
     
     @AfterClass
     public static void shutDownServer() {
-        server.stop();
+        if (context != null) {
+            context.stop();
+        }
     }
     
     @Test
@@ -62,7 +66,6 @@
         port.greetMeOneWay(System.getProperty("user.name"));
 
         try {
-            System.out.println("Invoking pingMe, expecting exception...");
             port.pingMe("hello");
             fail("expects the exception here");
         } catch (PingMeFault ex) {

Modified: 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/CxfHttpJmsClientServerTest.java
 Fri Oct 30 09:29:32 2009
@@ -18,40 +18,19 @@
 
 import java.net.MalformedURLException;
 
-import javax.xml.ws.ProtocolException;
-
 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.camel.test.junit4.CamelSpringTestSupport;
 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;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-public class CxfHttpJmsClientServerTest extends CamelTestSupport {
-    static JmsBroker broker = new JmsBroker();
-    static Server server = new Server();
+public class CxfHttpJmsClientServerTest extends CamelSpringTestSupport {
     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();
-    }
-    
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new MyRouteBuilder();
-    }
     
     @Test
     public void testClientInvocation() throws MalformedURLException {
@@ -76,6 +55,11 @@
             assertEquals("Wrong FaultDetail minor:", 1, detail.getMinor());
         }
     }
+
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {       
 
+        return new ClassPathXmlApplicationContext(new 
String[]{"/META-INF/spring/CxfRouteCamelContext.xml"});
+    }
     
     
 

Modified: 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java
 Fri Oct 30 09:29:32 2009
@@ -16,19 +16,19 @@
  */
 package org.apache.camel.example.cxf.jaxrs;
 
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.example.cxf.jaxrs.resources.Book;
 import org.apache.camel.example.cxf.jaxrs.resources.BookNotFoundFault;
 import org.apache.camel.example.cxf.jaxrs.resources.BookStore;
+import org.apache.camel.test.junit4.CamelSpringTestSupport;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class JAXRSClientServerTest extends CamelTestSupport {
+public class JAXRSClientServerTest extends CamelSpringTestSupport {
+    
     
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new CamelRouterBuilder();
-    }
     
     @Test
     public void testJAXWSClient() throws BookNotFoundFault {
@@ -66,4 +66,9 @@
         }
     }
 
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext(new 
String[]{"/META-INF/spring/JAXRSCamelContext.xml"});
+    }
+
 }

Modified: 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java?rev=831236&r1=831235&r2=831236&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/provider/ProviderClientServerTest.java
 Fri Oct 30 09:29:32 2009
@@ -37,7 +37,7 @@
     @Override
     protected AbstractXmlApplicationContext createApplicationContext() {
         
-        return new ClassPathXmlApplicationContext(new 
String[]{"/org/apache/camel/example/cxf/provider/CamelCXFRouteConfig.xml"});
+        return new ClassPathXmlApplicationContext(new 
String[]{"/META-INF/spring/CamelCXFProviderRouteConfig.xml"});
     }
     
     


Reply via email to