Author: ningjiang
Date: Wed May  5 13:09:16 2010
New Revision: 941274

URL: http://svn.apache.org/viewvc?rev=941274&view=rev
Log:
Stopping the service when the CxfSimpleRouterTest is over

Modified:
    
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSimpleRouterTest.java

Modified: 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSimpleRouterTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSimpleRouterTest.java?rev=941274&r1=941273&r2=941274&view=diff
==============================================================================
--- 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSimpleRouterTest.java
 (original)
+++ 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSimpleRouterTest.java
 Wed May  5 13:09:16 2010
@@ -26,10 +26,12 @@ import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.ClientFactoryBean;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.apache.cxf.frontend.ServerFactoryBean;
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class CxfSimpleRouterTest extends CamelTestSupport {    
+    protected static Server server;
     protected static final String ROUTER_ADDRESS = 
"http://localhost:9000/router";;
     protected static final String SERVICE_ADDRESS = 
"http://localhost:9002/helloworld";;
     protected static final String SERVICE_CLASS = 
"serviceClass=org.apache.camel.component.cxf.HelloService";
@@ -46,10 +48,17 @@ public class CxfSimpleRouterTest extends
         svrBean.setServiceClass(HelloService.class);
         svrBean.setServiceBean(new HelloServiceImpl());
     
-        Server server = svrBean.create();
+        server = svrBean.create();
         server.start();
     }
     
+    @AfterClass
+    public static void shutdownService() {
+        if (server != null) {
+            server.stop();
+        }
+    }
+    
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {


Reply via email to