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/05/18 15:51:12 UTC
[2/3] cxf git commit: Updating test
Updating test
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/80a05be5
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/80a05be5
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/80a05be5
Branch: refs/heads/3.1.x-fixes
Commit: 80a05be5e1340d25d5bb3b869caca188ab426f83
Parents: a58edd7
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed May 18 14:56:08 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed May 18 16:49:58 2016 +0100
----------------------------------------------------------------------
.../apache/cxf/ws/security/wss4j/AbstractSecurityTest.java | 7 ++++++-
.../org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java | 3 ++-
2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/80a05be5/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java
index 38bc2be..10bb9df 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java
@@ -32,6 +32,7 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.stream.XMLStreamReader;
@@ -81,7 +82,11 @@ public abstract class AbstractSecurityTest extends AbstractCXFTest {
* @param doc the document containing the SOAP content.
*/
protected SoapMessage getSoapMessageForDom(Document doc) throws Exception {
- SOAPMessage saajMsg = MessageFactory.newInstance().createMessage();
+ return getSoapMessageForDom(doc, SOAPConstants.SOAP_1_1_PROTOCOL);
+ }
+
+ protected SoapMessage getSoapMessageForDom(Document doc, String protocol) throws Exception {
+ SOAPMessage saajMsg = MessageFactory.newInstance(protocol).createMessage();
SOAPPart part = saajMsg.getSOAPPart();
SAAJStreamWriter writer = new SAAJStreamWriter(part);
StaxUtils.copy(doc, writer);
http://git-wip-us.apache.org/repos/asf/cxf/blob/80a05be5/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java
index bd1b526..1393ef8 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java
@@ -23,6 +23,7 @@ import java.io.ByteArrayInputStream;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPMessage;
import javax.xml.stream.XMLStreamReader;
@@ -225,7 +226,7 @@ public class WSS4JFaultCodeTest extends AbstractSecurityTest {
public void testSignedEncryptedSOAP12Fault() throws Exception {
Document doc = readDocument("wsse-response-fault.xml");
- SoapMessage msg = getSoapMessageForDom(doc);
+ SoapMessage msg = getSoapMessageForDom(doc, SOAPConstants.SOAP_1_2_PROTOCOL);
SOAPMessage saajMsg = msg.getContent(SOAPMessage.class);
doc = saajMsg.getSOAPPart();