servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r722015 - /servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
Date Mon, 01 Dec 2008 09:55:22 GMT
Author: ffang
Date: Mon Dec  1 01:55:18 2008
New Revision: 722015

URL: http://svn.apache.org/viewvc?rev=722015&view=rev
Log:
[SM-1702]test to show how to configure cxf bc/se to use synchronous way when handle concurrenct
invocation

Modified:
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java?rev=722015&r1=722014&r2=722015&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
Mon Dec  1 01:55:18 2008
@@ -21,6 +21,9 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.calculator.AddNumbersFault;
 import org.apache.cxf.calculator.CalculatorPortType;
 import org.apache.cxf.calculator.CalculatorService;
@@ -37,6 +40,13 @@
 public class CxfBCSESystemTest extends SpringTestSupport {
     
     private static final Logger LOG = LogUtils.getL7dLogger(CxfBCSESystemTest.class);
+    
+    static {
+        SpringBusFactory bf = new SpringBusFactory();
+        Bus bus = bf.createBus("org/apache/servicemix/cxfbc/jettyThreadPool.xml");
+        BusFactory.setDefaultBus(bus);
+    }
+    
     public void setUp() throws Exception {
         //override super setup
         LOG.info("setUp is invoked");
@@ -94,6 +104,7 @@
         multiClientTestBase();
     }
     
+
     
     private void calculatorTestBase() throws Exception {
 
@@ -116,6 +127,7 @@
     }
     
     private void multiClientTestBase() throws Exception {
+        
         URL wsdl = getClass().getResource("/wsdl/calculator.wsdl");
         assertNotNull(wsdl);
         CalculatorService service = new CalculatorService(wsdl, new QName(
@@ -133,10 +145,15 @@
         for (int i = 0; i < clients.length; i++) {
             clients[i].join();
         }
+        
+        for (int i = 0; i < clients.length; i++) {
+            assertEquals(clients[i].getResult(), 3);
+        }
     }
     
     class MultiClientThread extends Thread {
         private CalculatorPortType port;
+        private int ret;
         
         public MultiClientThread(CalculatorPortType port) {
             this.port = port;
@@ -144,11 +161,15 @@
         
         public void run() {
             try {
-                assertEquals(port.add(1, 2), 3);
+                ret = port.add(1, 2);
             } catch (AddNumbersFault e) {
                 fail();
             }
         }
+        
+        public int getResult() {
+            return ret;
+        }
     }
 
     @Override



Mime
View raw message