cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r495477 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/ systests/src/test/java/org/apache/cxf/systest/handlers/
Date Fri, 12 Jan 2007 03:19:21 GMT
Author: jliu
Date: Thu Jan 11 19:19:20 2007
New Revision: 495477

URL: http://svn.apache.org/viewvc?view=rev&rev=495477
Log:
Apply patch CXF-334 on behalf of Unreal Jiang: Logical handler's close() method is not properly
called after completion

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java?view=diff&rev=495477&r1=495476&r2=495477
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java
Thu Jan 11 19:19:20 2007
@@ -36,10 +36,17 @@
     
     public void handleMessage(T message) {
         MessageContext context = createProtocolMessageContext(message);
-        getInvoker(message).invokeProtocolHandlers(isRequestor(message), context);      
     
+        getInvoker(message).invokeProtocolHandlers(isRequestor(message), context);
+        onCompletion(message);
     }
     
     protected MessageContext createProtocolMessageContext(Message message) {
         return new WrappedMessageContext(message);
+    }
+    
+    public void onCompletion(T message) {
+        if (isOutbound(message)) {
+            getInvoker(message).mepComplete(message);
+        }
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptor.java?view=diff&rev=495477&r1=495476&r2=495477
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptor.java
Thu Jan 11 19:19:20 2007
@@ -79,6 +79,7 @@
                 }
             }
         }
+        onCompletion(message);
     }
 
     public void handleFault(T message) {
@@ -86,7 +87,7 @@
     }
 
     public void onCompletion(T message) {
-        if (isRequestor(message) && (isOneway(message) || !isOutbound(message)))
{
+        if (!isOutbound(message)) {
             getInvoker(message).mepComplete(message);
         }
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java?view=diff&rev=495477&r1=495476&r2=495477
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java
Thu Jan 11 19:19:20 2007
@@ -42,7 +42,6 @@
 
 import static org.easymock.EasyMock.eq;
 import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
 import static org.easymock.EasyMock.isA;
 import static org.easymock.classextension.EasyMock.createNiceControl;
 
@@ -88,18 +87,6 @@
         LogicalHandlerInterceptor<Message> li = new LogicalHandlerInterceptor<Message>(binding);
         assertEquals("unexpected phase", "user-logical", li.getPhase());
         li.handleMessage(message);
-        control.verify();
-    }
-
-    public void testOnCompletion() {
-        expect(message.getExchange()).andReturn(exchange).anyTimes();
-        expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker);
-        expect(exchange.getOutMessage()).andReturn(message);
-        invoker.mepComplete(message);
-        expectLastCall();
-        control.replay();
-        LogicalHandlerInterceptor<Message> li = new LogicalHandlerInterceptor<Message>(binding);
-        li.onCompletion(message);
         control.verify();
     }
 

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java?view=diff&rev=495477&r1=495476&r2=495477
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
Thu Jan 11 19:19:20 2007
@@ -253,7 +253,7 @@
     }
        
     //TODO: Commented out due to CXF-334
-    public void xtestHandlersInvoked() throws Exception {
+    public void testHandlersInvoked() throws Exception {
         TestHandler<LogicalMessageContext> handler1 = new TestHandler<LogicalMessageContext>(false);
         TestHandler<LogicalMessageContext>  handler2 = new TestHandler<LogicalMessageContext>(false);
         TestSOAPHandler soapHandler1 = new TestSOAPHandler(false);



Mime
View raw message