cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaypai...@apache.org
Subject svn commit: r545488 - /incubator/cxf/trunk/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocOutInterceptorTest.java
Date Fri, 08 Jun 2007 12:06:02 GMT
Author: ajaypaibir
Date: Fri Jun  8 05:06:01 2007
New Revision: 545488

URL: http://svn.apache.org/viewvc?view=rev&rev=545488
Log:
Fix for the intermittent failure due to ConcurrentModificationException.

Modified:
    incubator/cxf/trunk/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocOutInterceptorTest.java

Modified: incubator/cxf/trunk/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocOutInterceptorTest.java?view=diff&rev=545488&r1=545487&r2=545488
==============================================================================
--- incubator/cxf/trunk/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocOutInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/coloc/src/test/java/org/apache/cxf/binding/coloc/ColocOutInterceptorTest.java
Fri Jun  8 05:06:01 2007
@@ -45,6 +45,7 @@
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.InterfaceInfo;
+import org.apache.cxf.service.model.ServiceInfo;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
@@ -346,8 +347,9 @@
         BindingOperationInfo sboi = control.createMock(BindingOperationInfo.class);
         //Local var
         Service ses = control.createMock(Service.class);
-        EndpointInfo sei = control.createMock(EndpointInfo.class);
-        BindingInfo rbi = control.createMock(BindingInfo.class);
+        ServiceInfo ssi = control.createMock(ServiceInfo.class);
+        EndpointInfo sei = control.createMock(EndpointInfo.class);        
+        TestBindingInfo rbi = new TestBindingInfo(ssi, "testBinding");
         Endpoint rep = control.createMock(Endpoint.class);
         Service res = control.createMock(Service.class);
         EndpointInfo rei = control.createMock(EndpointInfo.class);
@@ -362,14 +364,18 @@
         EasyMock.expect(rei.getName()).andReturn(new QName("C", "D"));
         EasyMock.expect(sei.getName()).andReturn(new QName("C", "D"));
         EasyMock.expect(rei.getBinding()).andReturn(rbi);
-        QName op = new QName("E", "F");
-        EasyMock.expect(rbi.getOperation(op)).andReturn(null);
+        EasyMock.expect(sboi.getName()).andReturn(new QName("E", "F"));
+        //Causes ConcurrentModification intermittently
+        //QName op = new QName("E", "F");
+        //EasyMock.expect(rbi.getOperation(op).andReturn(null);
         
         control.replay();
         Server val = colocOut.isColocated(list, sep, sboi);
         assertEquals("Is not a colocated call",
                      null,
                      val);
+        assertEquals("BindingOperation.getOperation was not called", 
+                     1, rbi.getOpCount());
         control.reset();
     }
 
@@ -429,5 +435,23 @@
         protected boolean isSameOperationInfo(BindingOperationInfo s, BindingOperationInfo
r) {
             return true;
         }
+    }
+    
+    class TestBindingInfo extends BindingInfo {
+        private int opCount;
+        TestBindingInfo(ServiceInfo si, String bindingId) {
+            super(si, bindingId);
+        }
+        
+        public int getOpCount() {
+            return opCount;
+        }
+        
+        public BindingOperationInfo getOperation(QName opName) {
+            BindingOperationInfo boi = super.getOperation(opName);
+            ++opCount;
+            return boi;
+        }
+        
     }
 }



Mime
View raw message