You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2018/11/08 16:19:51 UTC

svn commit: r1846166 - in /santuario/xml-security-java/trunk: pom.xml src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java src/test/java/org/apache/xml/security/test/stax/utils/XMLSecEventAllocator.java

Author: coheigea
Date: Thu Nov  8 16:19:51 2018
New Revision: 1846166

URL: http://svn.apache.org/viewvc?rev=1846166&view=rev
Log:
Switching woodstox to runtime dependency

Modified:
    santuario/xml-security-java/trunk/pom.xml
    santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java
    santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/XMLSecEventAllocator.java

Modified: santuario/xml-security-java/trunk/pom.xml
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/pom.xml?rev=1846166&r1=1846165&r2=1846166&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/pom.xml (original)
+++ santuario/xml-security-java/trunk/pom.xml Thu Nov  8 16:19:51 2018
@@ -582,18 +582,18 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>com.fasterxml.woodstox</groupId>
-            <artifactId>woodstox-core</artifactId>
-            <version>${woodstox.core.version}</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
             <groupId>commons-codec</groupId>
             <artifactId>commons-codec</artifactId>
             <version>${commons.codec.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
+            <groupId>com.fasterxml.woodstox</groupId>
+            <artifactId>woodstox-core</artifactId>
+            <version>${woodstox.core.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
             <version>${slf4j.version}</version>

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java?rev=1846166&r1=1846165&r2=1846166&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java Thu Nov  8 16:19:51 2018
@@ -40,7 +40,9 @@ import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpressionException;
@@ -77,6 +79,7 @@ public class XMLEncryption11Test extends
     private int nodeCount;
 
     private XMLInputFactory xmlInputFactory;
+    private TransformerFactory transformerFactory = TransformerFactory.newInstance();
 
     @Before
     public void setUp() throws Exception {
@@ -447,8 +450,12 @@ public class XMLEncryption11Test extends
         InboundXMLSec inboundXMLSec = XMLSec.getInboundWSSec(properties);
         TestSecurityEventListener securityEventListener = new TestSecurityEventListener();
 
+        javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        transformer.transform(new DOMSource(doc), new StreamResult(baos));
+
         final XMLStreamReader xmlStreamReader =
-                xmlInputFactory.createXMLStreamReader(new DOMSource(doc));
+            xmlInputFactory.createXMLStreamReader(new ByteArrayInputStream(baos.toByteArray()));
 
         XMLStreamReader securityStreamReader =
                 inboundXMLSec.processInMessage(xmlStreamReader, null, securityEventListener);

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/XMLSecEventAllocator.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/XMLSecEventAllocator.java?rev=1846166&r1=1846165&r2=1846166&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/XMLSecEventAllocator.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/XMLSecEventAllocator.java Thu Nov  8 16:19:51 2018
@@ -36,11 +36,9 @@ import javax.xml.stream.util.XMLEventCon
  */
 public class XMLSecEventAllocator implements XMLEventAllocator {
 
-    private XMLEventAllocator xmlEventAllocator;
     private XMLSecStartElement parentXmlSecStartElement;
 
     public XMLSecEventAllocator() throws Exception {
-        xmlEventAllocator = com.ctc.wstx.evt.DefaultEventAllocator.getDefaultInstance();
     }
 
     @Override
@@ -70,6 +68,6 @@ public class XMLSecEventAllocator implem
 
     @Override
     public void allocate(XMLStreamReader reader, XMLEventConsumer consumer) throws XMLStreamException {
-        xmlEventAllocator.allocate(reader, consumer);
+       // xmlEventAllocator.allocate(reader, consumer);
     }
 }