You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2016/02/23 19:07:59 UTC

[1/3] cxf git commit: Recording .gitmergeinfo Changes

Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 322cfa1a3 -> ac9fa2417


Recording .gitmergeinfo Changes


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/23d7bbd1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/23d7bbd1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/23d7bbd1

Branch: refs/heads/3.1.x-fixes
Commit: 23d7bbd18d761e7be6b4ee34e7b77f884f42b57b
Parents: 322cfa1
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Feb 23 18:06:38 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Feb 23 18:06:38 2016 +0000

----------------------------------------------------------------------
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/23d7bbd1/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index adca1f3..67cc0473 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -43,6 +43,7 @@ M 2e8219cf3d047abc3a7e2611bf284aadbc20b7d6
 M 386805560479b35276d88605c5acf805e3004aa5
 M 39c772a0764b323f98ab58e00345f4fca924c425
 M 63a1088a9253da0452497440e900d35a5415c3c9
+M 7304dfbd8f3044d8d46981abf2058c6cb732d219
 M 746914a5084f5db8d0c0f052802c7ef2217b9b6b
 M 7690a1fd087aff24ad8e8e1ab2e0722e24bf3d81
 M 8583a24ac541dc373503d7a6c59cd90890acdae3


[2/3] cxf git commit: Check thrown Exception's cause for SOAPFaultException

Posted by co...@apache.org.
Check thrown Exception's cause for SOAPFaultException

- added a test case


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2b27fb10
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2b27fb10
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2b27fb10

Branch: refs/heads/3.1.x-fixes
Commit: 2b27fb10704f78daca7e69b8f3577df477664090
Parents: 23d7bbd
Author: Tomas Hofman <th...@redhat.com>
Authored: Wed Apr 29 15:48:09 2015 +0200
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Feb 23 18:06:49 2016 +0000

----------------------------------------------------------------------
 .../WebFaultOutInterceptorTestCase.java         | 729 +++++++++++++++++++
 1 file changed, 729 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2b27fb10/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java
new file mode 100644
index 0000000..ee4843c
--- /dev/null
+++ b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java
@@ -0,0 +1,729 @@
+/**
+ * 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.cxf.jaxws.interceptors;
+
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.message.Message;
+import org.junit.Assert;
+import org.junit.Test;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.TypeInfo;
+import org.w3c.dom.UserDataHandler;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Test case for https://bugzilla.redhat.com/show_bug.cgi?id=1177704
+ *
+ * Scenario:
+ *
+ * Let WebFaultOutInterceptor process a message containing a SoapFault.
+ *
+ * If SoapFault's exception or its' cause is instance of SOAPFaultException, values of SOAPFaultException.subCodes
+ * should be copied to SoapFault.subCodes.
+ *
+ * @author Tomas Hofman (thofman@redhat.com)
+ */
+public class WebFaultOutInterceptorTestCase {
+
+    private WebFaultOutInterceptor interceptor = new WebFaultOutInterceptor();
+
+    private static final QName code = new QName("ns", "code");
+    private static final QName subcode = new QName("ns", "subcode");
+    private static final List subcodes = Collections.singletonList(subcode);
+
+    @Test
+    public void testSoapFaultException() {
+        // create message that contains Fault that contains exception
+        SOAPFaultException soapFaultException = new SOAPFaultException(new SOAPFaultStub());
+        SoapFault soapFault = new SoapFault("message", soapFaultException, code);
+        Message message = createMessage(soapFault);
+
+        interceptor.handleMessage(message);
+
+        Assert.assertNotNull(soapFault.getSubCodes());
+        Assert.assertEquals(1, soapFault.getSubCodes().size());
+        Assert.assertEquals(subcode, soapFault.getSubCodes().get(0));
+        Assert.assertEquals(code, soapFault.getFaultCode());
+    }
+
+    @Test
+    public void testSoapFaultCause() {
+        SOAPFaultException cause = new SOAPFaultException(new SOAPFaultStub());
+        Exception exception = new Exception(cause);
+        SoapFault soapFault = new SoapFault("message", exception, code);
+        Message message = createMessage(soapFault);
+
+        interceptor.handleMessage(message);
+
+        Assert.assertNotNull(soapFault.getSubCodes());
+        Assert.assertEquals(1, soapFault.getSubCodes().size());Assert.assertEquals(subcode, soapFault.getSubCodes().get(0));
+        Assert.assertEquals(code, soapFault.getFaultCode());
+    }
+
+    @Test
+    public void testSoapFaultCauseCause() {
+        SOAPFaultException cause = new SOAPFaultException(new SOAPFaultStub());
+        Exception innerException = new Exception(cause);
+        Exception outerException = new Exception(innerException);
+        SoapFault soapFault = new SoapFault("message", outerException, code);
+        Message message = createMessage(soapFault);
+
+        interceptor.handleMessage(message);
+
+        Assert.assertTrue("SoapFault.subCodes are expected to be empty.",
+                soapFault.getSubCodes() == null || soapFault.getSubCodes().size() == 0);
+        Assert.assertEquals(code, soapFault.getFaultCode());
+    }
+
+    @Test
+    public void testOtherException() {
+        Exception exception = new Exception("test");
+        SoapFault soapFault = new SoapFault("message", exception, code);
+        Message message = createMessage(soapFault);
+
+        interceptor.handleMessage(message);
+
+        Assert.assertTrue("SoapFault.subCodes are expected to be empty.",
+                soapFault.getSubCodes() == null || soapFault.getSubCodes().size() == 0);
+        Assert.assertEquals(code, soapFault.getFaultCode());
+    }
+
+    private Message createMessage(SoapFault soapFault) {
+        Message message = new SoapMessage(Soap12.getInstance());
+        message.setContent(Exception.class, soapFault);
+        return message;
+    }
+
+    private class SOAPFaultStub implements SOAPFault {
+
+        @Override
+        public void setFaultCode(Name name) throws SOAPException {
+
+        }
+
+        @Override
+        public void setFaultCode(QName qName) throws SOAPException {
+
+        }
+
+        @Override
+        public void setFaultCode(String s) throws SOAPException {
+
+        }
+
+        @Override
+        public Name getFaultCodeAsName() {
+            return null;
+        }
+
+        @Override
+        public QName getFaultCodeAsQName() {
+            return null;
+        }
+
+        @Override
+        public Iterator getFaultSubcodes() {
+            return subcodes.iterator();
+        }
+
+        @Override
+        public void removeAllFaultSubcodes() {
+
+        }
+
+        @Override
+        public void appendFaultSubcode(QName qName) throws SOAPException {
+
+        }
+
+        @Override
+        public String getFaultCode() {
+            return null;
+        }
+
+        @Override
+        public void setFaultActor(String s) throws SOAPException {
+
+        }
+
+        @Override
+        public String getFaultActor() {
+            return null;
+        }
+
+        @Override
+        public void setFaultString(String s) throws SOAPException {
+
+        }
+
+        @Override
+        public void setFaultString(String s, Locale locale) throws SOAPException {
+
+        }
+
+        @Override
+        public String getFaultString() {
+            return null;
+        }
+
+        @Override
+        public Locale getFaultStringLocale() {
+            return null;
+        }
+
+        @Override
+        public boolean hasDetail() {
+            return false;
+        }
+
+        @Override
+        public Detail getDetail() {
+            return null;
+        }
+
+        @Override
+        public Detail addDetail() throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public Iterator getFaultReasonLocales() throws SOAPException {
+            return Collections.emptyIterator();
+        }
+
+        @Override
+        public Iterator getFaultReasonTexts() throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public String getFaultReasonText(Locale locale) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public void addFaultReasonText(String s, Locale locale) throws SOAPException {
+
+        }
+
+        @Override
+        public String getFaultNode() {
+            return null;
+        }
+
+        @Override
+        public void setFaultNode(String s) throws SOAPException {
+
+        }
+
+        @Override
+        public String getFaultRole() {
+            return null;
+        }
+
+        @Override
+        public void setFaultRole(String s) throws SOAPException {
+
+        }
+
+        @Override
+        public SOAPElement addChildElement(Name name) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addChildElement(QName qName) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addChildElement(String s) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addChildElement(String s, String s1) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addChildElement(String s, String s1, String s2) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public void removeContents() {
+
+        }
+
+        @Override
+        public SOAPElement addTextNode(String s) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addAttribute(Name name, String s) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addAttribute(QName qName, String s) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public SOAPElement addNamespaceDeclaration(String s, String s1) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public String getAttributeValue(Name name) {
+            return null;
+        }
+
+        @Override
+        public String getAttributeValue(QName qName) {
+            return null;
+        }
+
+        @Override
+        public Iterator getAllAttributes() {
+            return null;
+        }
+
+        @Override
+        public Iterator getAllAttributesAsQNames() {
+            return null;
+        }
+
+        @Override
+        public String getNamespaceURI(String s) {
+            return null;
+        }
+
+        @Override
+        public Iterator getNamespacePrefixes() {
+            return null;
+        }
+
+        @Override
+        public Iterator getVisibleNamespacePrefixes() {
+            return null;
+        }
+
+        @Override
+        public QName createQName(String s, String s1) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public Name getElementName() {
+            return null;
+        }
+
+        @Override
+        public QName getElementQName() {
+            return null;
+        }
+
+        @Override
+        public SOAPElement setElementQName(QName qName) throws SOAPException {
+            return null;
+        }
+
+        @Override
+        public boolean removeAttribute(Name name) {
+            return false;
+        }
+
+        @Override
+        public boolean removeAttribute(QName qName) {
+            return false;
+        }
+
+        @Override
+        public boolean removeNamespaceDeclaration(String s) {
+            return false;
+        }
+
+        @Override
+        public Iterator getChildElements() {
+            return null;
+        }
+
+        @Override
+        public Iterator getChildElements(Name name) {
+            return null;
+        }
+
+        @Override
+        public Iterator getChildElements(QName qName) {
+            return null;
+        }
+
+        @Override
+        public void setEncodingStyle(String s) throws SOAPException {
+
+        }
+
+        @Override
+        public String getEncodingStyle() {
+            return null;
+        }
+
+        @Override
+        public String getTagName() {
+            return null;
+        }
+
+        @Override
+        public String getAttribute(String s) {
+            return null;
+        }
+
+        @Override
+        public void setAttribute(String s, String s1) throws DOMException {
+
+        }
+
+        @Override
+        public void removeAttribute(String s) throws DOMException {
+
+        }
+
+        @Override
+        public Attr getAttributeNode(String s) {
+            return null;
+        }
+
+        @Override
+        public Attr setAttributeNode(Attr attr) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public Attr removeAttributeNode(Attr attr) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public NodeList getElementsByTagName(String s) {
+            return null;
+        }
+
+        @Override
+        public String getAttributeNS(String s, String s1) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public void setAttributeNS(String s, String s1, String s2) throws DOMException {
+
+        }
+
+        @Override
+        public void removeAttributeNS(String s, String s1) throws DOMException {
+
+        }
+
+        @Override
+        public Attr getAttributeNodeNS(String s, String s1) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public Attr setAttributeNodeNS(Attr attr) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public NodeList getElementsByTagNameNS(String s, String s1) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public boolean hasAttribute(String s) {
+            return false;
+        }
+
+        @Override
+        public boolean hasAttributeNS(String s, String s1) throws DOMException {
+            return false;
+        }
+
+        @Override
+        public TypeInfo getSchemaTypeInfo() {
+            return null;
+        }
+
+        @Override
+        public void setIdAttribute(String s, boolean b) throws DOMException {
+
+        }
+
+        @Override
+        public void setIdAttributeNS(String s, String s1, boolean b) throws DOMException {
+
+        }
+
+        @Override
+        public void setIdAttributeNode(Attr attr, boolean b) throws DOMException {
+
+        }
+
+        @Override
+        public String getValue() {
+            return null;
+        }
+
+        @Override
+        public void setValue(String s) {
+
+        }
+
+        @Override
+        public void setParentElement(SOAPElement soapElement) throws SOAPException {
+
+        }
+
+        @Override
+        public SOAPElement getParentElement() {
+            return null;
+        }
+
+        @Override
+        public void detachNode() {
+
+        }
+
+        @Override
+        public void recycleNode() {
+
+        }
+
+        @Override
+        public String getNodeName() {
+            return null;
+        }
+
+        @Override
+        public String getNodeValue() throws DOMException {
+            return null;
+        }
+
+        @Override
+        public void setNodeValue(String s) throws DOMException {
+
+        }
+
+        @Override
+        public short getNodeType() {
+            return 0;
+        }
+
+        @Override
+        public Node getParentNode() {
+            return null;
+        }
+
+        @Override
+        public NodeList getChildNodes() {
+            return null;
+        }
+
+        @Override
+        public Node getFirstChild() {
+            return null;
+        }
+
+        @Override
+        public Node getLastChild() {
+            return null;
+        }
+
+        @Override
+        public Node getPreviousSibling() {
+            return null;
+        }
+
+        @Override
+        public Node getNextSibling() {
+            return null;
+        }
+
+        @Override
+        public NamedNodeMap getAttributes() {
+            return null;
+        }
+
+        @Override
+        public Document getOwnerDocument() {
+            return null;
+        }
+
+        @Override
+        public Node insertBefore(Node node, Node node1) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public Node replaceChild(Node node, Node node1) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public Node removeChild(Node node) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public Node appendChild(Node node) throws DOMException {
+            return null;
+        }
+
+        @Override
+        public boolean hasChildNodes() {
+            return false;
+        }
+
+        @Override
+        public Node cloneNode(boolean b) {
+            return null;
+        }
+
+        @Override
+        public void normalize() {
+
+        }
+
+        @Override
+        public boolean isSupported(String s, String s1) {
+            return false;
+        }
+
+        @Override
+        public String getNamespaceURI() {
+            return null;
+        }
+
+        @Override
+        public String getPrefix() {
+            return null;
+        }
+
+        @Override
+        public void setPrefix(String s) throws DOMException {
+
+        }
+
+        @Override
+        public String getLocalName() {
+            return null;
+        }
+
+        @Override
+        public boolean hasAttributes() {
+            return false;
+        }
+
+        @Override
+        public String getBaseURI() {
+            return null;
+        }
+
+        @Override
+        public short compareDocumentPosition(Node node) throws DOMException {
+            return 0;
+        }
+
+        @Override
+        public String getTextContent() throws DOMException {
+            return null;
+        }
+
+        @Override
+        public void setTextContent(String s) throws DOMException {
+
+        }
+
+        @Override
+        public boolean isSameNode(Node node) {
+            return false;
+        }
+
+        @Override
+        public String lookupPrefix(String s) {
+            return null;
+        }
+
+        @Override
+        public boolean isDefaultNamespace(String s) {
+            return false;
+        }
+
+        @Override
+        public String lookupNamespaceURI(String s) {
+            return null;
+        }
+
+        @Override
+        public boolean isEqualNode(Node node) {
+            return false;
+        }
+
+        @Override
+        public Object getFeature(String s, String s1) {
+            return null;
+        }
+
+        @Override
+        public Object setUserData(String s, Object o, UserDataHandler userDataHandler) {
+            return null;
+        }
+
+        @Override
+        public Object getUserData(String s) {
+            return null;
+        }
+    }
+
+}


[3/3] cxf git commit: Fixing patch. This closes #67.

Posted by co...@apache.org.
Fixing patch. This closes #67.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ac9fa241
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ac9fa241
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ac9fa241

Branch: refs/heads/3.1.x-fixes
Commit: ac9fa2417230dd9e9a6518e70813e2679f93df7f
Parents: 2b27fb1
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Feb 23 18:05:38 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Feb 23 18:06:56 2016 +0000

----------------------------------------------------------------------
 .../WebFaultOutInterceptorTestCase.java         | 67 +++++++++++---------
 1 file changed, 36 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ac9fa241/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java
index ee4843c..de769b1 100644
--- a/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java
+++ b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptorTestCase.java
@@ -18,12 +18,19 @@
  */
 package org.apache.cxf.jaxws.interceptors;
 
-import org.apache.cxf.binding.soap.Soap12;
-import org.apache.cxf.binding.soap.SoapFault;
-import org.apache.cxf.binding.soap.SoapMessage;
-import org.apache.cxf.message.Message;
-import org.junit.Assert;
-import org.junit.Test;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.soap.SOAPFaultException;
+
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Document;
@@ -33,17 +40,13 @@ import org.w3c.dom.NodeList;
 import org.w3c.dom.TypeInfo;
 import org.w3c.dom.UserDataHandler;
 
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.ws.soap.SOAPFaultException;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
+
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.message.Message;
+import org.junit.Assert;
+import org.junit.Test;
 
 /**
  * Test case for https://bugzilla.redhat.com/show_bug.cgi?id=1177704
@@ -59,39 +62,41 @@ import java.util.Locale;
  */
 public class WebFaultOutInterceptorTestCase {
 
+    private static final QName CODE = new QName("ns", "code");
+    private static final QName SUBCODE = new QName("ns", "subcode");
+    private static final List SUBCODES = Collections.singletonList(SUBCODE);
+
     private WebFaultOutInterceptor interceptor = new WebFaultOutInterceptor();
 
-    private static final QName code = new QName("ns", "code");
-    private static final QName subcode = new QName("ns", "subcode");
-    private static final List subcodes = Collections.singletonList(subcode);
 
     @Test
     public void testSoapFaultException() {
         // create message that contains Fault that contains exception
         SOAPFaultException soapFaultException = new SOAPFaultException(new SOAPFaultStub());
-        SoapFault soapFault = new SoapFault("message", soapFaultException, code);
+        SoapFault soapFault = new SoapFault("message", soapFaultException, CODE);
         Message message = createMessage(soapFault);
 
         interceptor.handleMessage(message);
 
         Assert.assertNotNull(soapFault.getSubCodes());
         Assert.assertEquals(1, soapFault.getSubCodes().size());
-        Assert.assertEquals(subcode, soapFault.getSubCodes().get(0));
-        Assert.assertEquals(code, soapFault.getFaultCode());
+        Assert.assertEquals(SUBCODE, soapFault.getSubCodes().get(0));
+        Assert.assertEquals(CODE, soapFault.getFaultCode());
     }
 
     @Test
     public void testSoapFaultCause() {
         SOAPFaultException cause = new SOAPFaultException(new SOAPFaultStub());
         Exception exception = new Exception(cause);
-        SoapFault soapFault = new SoapFault("message", exception, code);
+        SoapFault soapFault = new SoapFault("message", exception, CODE);
         Message message = createMessage(soapFault);
 
         interceptor.handleMessage(message);
 
         Assert.assertNotNull(soapFault.getSubCodes());
-        Assert.assertEquals(1, soapFault.getSubCodes().size());Assert.assertEquals(subcode, soapFault.getSubCodes().get(0));
-        Assert.assertEquals(code, soapFault.getFaultCode());
+        Assert.assertEquals(1, soapFault.getSubCodes().size());
+        Assert.assertEquals(SUBCODE, soapFault.getSubCodes().get(0));
+        Assert.assertEquals(CODE, soapFault.getFaultCode());
     }
 
     @Test
@@ -99,27 +104,27 @@ public class WebFaultOutInterceptorTestCase {
         SOAPFaultException cause = new SOAPFaultException(new SOAPFaultStub());
         Exception innerException = new Exception(cause);
         Exception outerException = new Exception(innerException);
-        SoapFault soapFault = new SoapFault("message", outerException, code);
+        SoapFault soapFault = new SoapFault("message", outerException, CODE);
         Message message = createMessage(soapFault);
 
         interceptor.handleMessage(message);
 
         Assert.assertTrue("SoapFault.subCodes are expected to be empty.",
                 soapFault.getSubCodes() == null || soapFault.getSubCodes().size() == 0);
-        Assert.assertEquals(code, soapFault.getFaultCode());
+        Assert.assertEquals(CODE, soapFault.getFaultCode());
     }
 
     @Test
     public void testOtherException() {
         Exception exception = new Exception("test");
-        SoapFault soapFault = new SoapFault("message", exception, code);
+        SoapFault soapFault = new SoapFault("message", exception, CODE);
         Message message = createMessage(soapFault);
 
         interceptor.handleMessage(message);
 
         Assert.assertTrue("SoapFault.subCodes are expected to be empty.",
                 soapFault.getSubCodes() == null || soapFault.getSubCodes().size() == 0);
-        Assert.assertEquals(code, soapFault.getFaultCode());
+        Assert.assertEquals(CODE, soapFault.getFaultCode());
     }
 
     private Message createMessage(SoapFault soapFault) {
@@ -157,7 +162,7 @@ public class WebFaultOutInterceptorTestCase {
 
         @Override
         public Iterator getFaultSubcodes() {
-            return subcodes.iterator();
+            return SUBCODES.iterator();
         }
 
         @Override