cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r1307318 - in /cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test: java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
Date Fri, 30 Mar 2012 08:56:49 GMT
Author: asoldano
Date: Fri Mar 30 08:56:49 2012
New Revision: 1307318

URL: http://svn.apache.org/viewvc?rev=1307318&view=rev
Log:
[CXF-4181] Adding (excluded) test reproducing regression with SOAP12 faults

Added:
    cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
Modified:
    cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java

Modified: cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java?rev=1307318&r1=1307317&r2=1307318&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
Fri Mar 30 08:56:49 2012
@@ -45,6 +45,7 @@ import org.apache.cxf.binding.soap.inter
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.interceptor.StaxInInterceptor;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 
@@ -139,6 +140,32 @@ public class SAAJInInterceptorTest exten
         
     }
     
+    @Test
+    @Ignore
+    public void testFaultDetailSOAP12() throws Exception {
+        try {
+            prepareSoapMessage("../test-soap-12-fault-detail.xml");
+        } catch (IOException ioe) {
+            fail("Failed in creating soap message");
+        }
+
+        staxIntc.handleMessage(soapMessage);
+        rhi.handleMessage(soapMessage);
+        sbi.handleMessage(soapMessage);
+
+        // check the xmlReader should be placed on the first entry of the body
+        // element
+        XMLStreamReader xmlReader = soapMessage.getContent(XMLStreamReader.class);
+        xmlReader.nextTag();
+        saajIntc.handleMessage(soapMessage);
+        
+        SOAPMessage parsedMessage = soapMessage.getContent(SOAPMessage.class);
+        SOAPFault fault = parsedMessage.getSOAPBody().getFault();
+        assertEquals("Simulated failure", fault.getFaultReasonTexts().next());
+        assertEquals("soap:Receiver", fault.getFaultCode());
+        
+    }
+    
 
     private void prepareSoapMessage(String message) throws IOException {
 

Added: cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml?rev=1307318&view=auto
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
(added)
+++ cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
Fri Mar 30 08:56:49 2012
@@ -0,0 +1,31 @@
+<!--
+    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.
+-->
+<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
+ <soap:Body>
+  <soap:Fault>
+   <soap:Code>
+    <soap:Value>soap:Receiver</soap:Value>
+   </soap:Code>
+   <soap:Reason>
+    <soap:Text xml:lang="en">Simulated failure</soap:Text>
+   </soap:Reason>
+  </soap:Fault>
+ </soap:Body>
+</soap:Envelope>
+



Mime
View raw message