cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r903689 - in /cxf/branches/2.2.x-fixes: ./ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
Date Wed, 27 Jan 2010 15:35:48 GMT
Author: dkulp
Date: Wed Jan 27 15:35:48 2010
New Revision: 903689

URL: http://svn.apache.org/viewvc?rev=903689&view=rev
Log:
Merged revisions 903443 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r903443 | dkulp | 2010-01-26 16:56:39 -0500 (Tue, 26 Jan 2010) | 2 lines
  
  WS-A support throws NullPointerException in cases where we aren't mapped
  directly to class objects (example: camel/smx routes and such)
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=903689&r1=903688&r2=903689&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Wed Jan 27 15:35:48 2010
@@ -756,7 +756,10 @@
                 // http://www.w3.org/2005/02/addressing/wsdl schema
                 for (BindingFaultInfo bfi : bindingOpInfo.getFaults()) {
                     FaultInfo fi = bfi.getFaultInfo();
-                    if (t != null && t.getClass().isAssignableFrom(fi.getMessagePart(0).getTypeClass()))
{
+                    Class<?> fiTypeClass = fi.getMessagePart(0).getTypeClass();
+                    if (t != null 
+                            && fiTypeClass != null
+                            && t.getClass().isAssignableFrom(fiTypeClass)) {
                         if (fi.getExtensionAttributes() == null) {
                             continue;
                         }

Modified: cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java?rev=903689&r1=903688&r2=903689&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
Wed Jan 27 15:35:48 2010
@@ -22,8 +22,11 @@
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.namespace.QName;
@@ -38,16 +41,19 @@
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.phase.PhaseManager;
 import org.apache.cxf.phase.PhaseManagerImpl;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingFaultInfo;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.MessageInfo.Type;
 import org.apache.cxf.service.model.OperationInfo;
@@ -292,6 +298,7 @@
                                                       true,
                                                       false,
                                                       true});
+        
         aggregator.mediate(message, true);
         control.verify();
         verifyMessage(message, false, true, true);
@@ -405,7 +412,7 @@
         
         Message message = getMessage();        
         Exchange exchange = getExchange();
-        setUpOutbound(message, exchange, outbound);
+        setUpOutbound(message, exchange, outbound, fault);
         setUpMessageProperty(message,
                              REQUESTOR_ROLE,
                              Boolean.valueOf(requestor));
@@ -574,7 +581,14 @@
                 setUpMessageProperty(message,
                                      REQUESTOR_ROLE,
                                      Boolean.FALSE);
-                expectedAction = "http://foo/bar/SEI/opResponse";
+                
+                if (fault) {
+                    message.setContent(Exception.class, new SoapFault("blah",
+                            (Throwable) new Exception(), Fault.FAULT_CODE_SERVER));
+                    expectedAction = "http://foo/bar/SEI/Fault/Exception";
+                } else {
+                    expectedAction = "http://foo/bar/SEI/opResponse";
+                }
             }
             setUpMessageProperty(message,
                                  REQUESTOR_ROLE,
@@ -631,9 +645,9 @@
         setUpExchangeOneway(exchange, oneway);
     }
 
-    private void setUpOutbound(Message message, Exchange exchange, boolean outbound) {
+    private void setUpOutbound(Message message, Exchange exchange, boolean outbound, boolean
fault) {
         setUpMessageExchange(message, exchange);
-        setUpExchangeOutbound(exchange, message, outbound);
+        setUpExchangeOutbound(exchange, message, outbound, fault);
     }
 
     private void setUpConduit(Message message, Exchange exchange) {
@@ -657,6 +671,10 @@
                         opInfo.createMessage(new QName("http://foo/bar", "opRequest"), Type.INPUT));
         opInfo.setOutput("opResponse",
                          opInfo.createMessage(new QName("http://foo/bar", "opResponse"),
Type.INPUT));
+        FaultInfo finfo = opInfo.addFault(new QName("http://foo/bar", "opFault"),
+                new QName("http://foo/bar", "opFault"));
+        finfo.addMessagePart("fault");
+        
         BindingOperationInfo bindingOpInfo = new TestBindingOperationInfo(opInfo);
         setUpExchangeGet(exchange, BindingOperationInfo.class, bindingOpInfo);
         // Usual fun with EasyMock not always working as expected
@@ -718,8 +736,13 @@
 
     private void setUpExchangeOutbound(Exchange exchange,
                                        Message message,
-                                       boolean outbound) {
-        exchange.getOutMessage();
+                                       boolean outbound,
+                                       boolean fault) {
+        if (fault) {
+            exchange.getOutFaultMessage();
+        } else {
+            exchange.getOutMessage();
+        }
         EasyMock.expectLastCall().andReturn(outbound ? message : null).anyTimes();
         //exchange.setOutMessage(outbound ? message : new MessageImpl());
     }
@@ -797,8 +820,18 @@
     }
 
     private static class TestBindingOperationInfo extends BindingOperationInfo {
+        private Map<QName, BindingFaultInfo> faults;
+        
         public TestBindingOperationInfo(OperationInfo oi) {
             opInfo = oi;
+            
+            Collection<FaultInfo> of = opInfo.getFaults();
+            if (of != null && !of.isEmpty()) {
+                faults = new ConcurrentHashMap<QName, BindingFaultInfo>(of.size());
+                for (FaultInfo fault : of) {
+                    faults.put(fault.getFaultName(), new BindingFaultInfo(fault, this));
+                }
+            }
         }
 
         public BindingMessageInfo getInput() {
@@ -808,5 +841,10 @@
         public BindingMessageInfo getOutput() {
             return new TestBindingMessageInfo();
         }
+
+        @Override
+        public Collection<BindingFaultInfo> getFaults() {
+            return Collections.unmodifiableCollection(this.faults.values());
+        }        
     }
 }



Mime
View raw message