Author: asoldano
Date: Fri Mar 30 09:14:45 2012
New Revision: 1307325
URL: http://svn.apache.org/viewvc?rev=1307325&view=rev
Log:
[CXF-4181] Adding (excluded) test reproducing regression with SOAP12 faults
Added:
cxf/trunk/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
Modified:
cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
Modified:
cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java?rev=1307325&r1=1307324&r2=1307325&view=diff
==============================================================================
---
cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
(original)
+++
cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java
Fri Mar 30 09:14:45 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/trunk/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml?rev=1307325&view=auto
==============================================================================
---
cxf/trunk/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
(added)
+++
cxf/trunk/rt/bindings/soap/src/test/resources/org/apache/cxf/binding/soap/test-soap-12-fault-detail.xml
Fri Mar 30 09:14:45 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>
+