servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r793820 - in /servicemix/components/bindings/servicemix-cxf-bc/trunk/src: main/java/org/apache/servicemix/cxfbc/ test/java/org/apache/servicemix/cxfbc/ test/java/org/apache/servicemix/cxfbc/interceptors/ test/resources/org/apache/servicemix...
Date Tue, 14 Jul 2009 09:12:50 GMT
Author: ffang
Date: Tue Jul 14 09:12:50 2009
New Revision: 793820

URL: http://svn.apache.org/viewvc?rev=793820&view=rev
Log:
[SMXCOMP-589]cxf bc provider shouldn't try to set fault message back to InOut MessageExchange

Added:
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
Modified:
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider.xml

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=793820&r1=793819&r2=793820&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
Tue Jul 14 09:12:50 2009
@@ -31,6 +31,7 @@
 
 import javax.jbi.management.DeploymentException;
 import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.MessageExchange;
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
@@ -259,7 +260,9 @@
             is.close();
             os.close();
         } catch (Exception e) {
+            if (!(exchange instanceof InOnly)) {
         	faultProcess(exchange, message, e);
+            }
         }
         if (boi.getOperationInfo().isOneWay()) {
             exchange.setStatus(ExchangeStatus.DONE);

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java?rev=793820&r1=793819&r2=793820&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
Tue Jul 14 09:12:50 2009
@@ -243,6 +243,7 @@
                 io.getOutMessage()).indexOf("Hello concurrency test 0 2 4 6 8 10 12 14 16
18") >= 0);
         client.done(io);
         // Shutdown CXF Service/Endpoint so that next test doesn't fail.
+        Thread.sleep(5000); //sleep so we get chance to see the behavior of oneway exception
         factory.getBus().shutdown(true);
     }
     

Added: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java?rev=793820&view=auto
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
(added)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
Tue Jul 14 09:12:50 2009
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.servicemix.cxfbc.interceptors;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class ThrowExceptionForOneWay extends AbstractPhaseInterceptor<Message> {
+    
+    public ThrowExceptionForOneWay() {
+        super(Phase.PREPARE_SEND);
+    }
+    
+
+    public void handleMessage(Message message) throws Fault {
+        if (message.getExchange().isOneWay()) {
+            throw new RuntimeException("intend for test oneway with Exception");
+        }
+        
+    }
+
+}

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider.xml?rev=793820&r1=793819&r2=793820&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
Tue Jul 14 09:12:50 2009
@@ -62,6 +62,7 @@
                 </cxfbc:inInterceptors>
                 <cxfbc:outInterceptors>
                     <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+                    <bean class="org.apache.servicemix.cxfbc.interceptors.ThrowExceptionForOneWay"/>
                 </cxfbc:outInterceptors>
                 <cxfbc:inFaultInterceptors>
                     <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>



Mime
View raw message