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 2020/01/09 15:30:07 UTC
svn commit: r1872555 - in /santuario/xml-security-java/trunk/src:
main/java/org/apache/xml/security/utils/
test/java/javax/xml/crypto/test/dsig/
test/java/javax/xml/crypto/test/dsig/keyinfo/
test/java/org/apache/xml/security/test/dom/ test/java/org/apa...
Author: coheigea
Date: Thu Jan 9 15:30:06 2020
New Revision: 1872555
URL: http://svn.apache.org/viewvc?rev=1872555&view=rev
Log:
More pruning of parsing methods in XMLUtils
Modified:
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/utils/XMLUtils.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/EnvelopingSignatureTest.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/PKSignatureAlgorithmTest.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/SignatureDigestMethodTest.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/TestUtils.java
santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/keyinfo/KeyInfoTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/CreateExclC14nInteropValues.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/TestUtils.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/PreCalculatedDigestSignatureTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResolverDirectHTTPTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/StAX2DOM.java
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/utils/XMLUtils.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/utils/XMLUtils.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/utils/XMLUtils.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/utils/XMLUtils.java Thu Jan 9 15:30:06 2020
@@ -1008,24 +1008,6 @@ public final class XMLUtils {
return true;
}
- public static Document newDocument() throws ParserConfigurationException {
- ClassLoader loader = getContextClassLoader();
- if (loader == null) {
- loader = getClassLoader(XMLUtils.class);
- }
- // If the ClassLoader is null then just create a DocumentBuilder and use it
- if (loader == null) {
- DocumentBuilder documentBuilder = createDocumentBuilder(true);
- return documentBuilder.newDocument();
- }
-
- Queue<DocumentBuilder> queue = getDocumentBuilderQueue(true, loader);
- DocumentBuilder documentBuilder = getDocumentBuilder(true, queue);
- Document doc = documentBuilder.newDocument();
- repoolDocumentBuilder(documentBuilder, queue);
- return doc;
- }
-
public static Document read(InputStream inputStream, boolean disAllowDocTypeDeclarations) throws ParserConfigurationException, SAXException, IOException {
ClassLoader loader = getContextClassLoader();
if (loader == null) {
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java Thu Jan 9 15:30:06 2020
@@ -136,7 +136,7 @@ public class CreateBaltimore23Test {
// create XMLSignature
XMLSignature sig = fac.newXMLSignature(si, dsa);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element envelope = doc.createElementNS
("http://example.org/envelope", "Envelope");
envelope.setAttributeNS
@@ -434,7 +434,7 @@ public class CreateBaltimore23Test {
(Transform.XPATH, xpf)));
KeyInfo ki = kifac.newKeyInfo(Collections.singletonList(rm), null);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
// create objects
List<XMLObject> objs = new ArrayList<>();
@@ -658,7 +658,7 @@ public class CreateBaltimore23Test {
SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
// create XMLSignature
XMLSignature sig = fac.newXMLSignature(si, ki);
@@ -710,7 +710,7 @@ public class CreateBaltimore23Test {
SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
// create Objects
XMLObject obj = fac.newXMLObject(Collections.singletonList
(new DOMStructure(doc.createTextNode("some text"))),
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java Thu Jan 9 15:30:06 2020
@@ -33,7 +33,6 @@ import javax.xml.crypto.dsig.dom.*;
import javax.xml.crypto.dsig.keyinfo.*;
import javax.xml.crypto.dsig.spec.*;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.*;
import javax.xml.crypto.test.KeySelectors;
@@ -138,7 +137,7 @@ public class CreateInteropExcC14NTest {
KeyInfo ki = kifac.newKeyInfo(kits);
// create Objects
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element baz = doc.createElementNS("urn:bar", "bar:Baz");
Comment com = doc.createComment(" comment ");
baz.appendChild(com);
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java Thu Jan 9 15:30:06 2020
@@ -33,7 +33,6 @@ import javax.xml.crypto.dsig.dom.*;
import javax.xml.crypto.dsig.keyinfo.*;
import javax.xml.crypto.dsig.spec.*;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.*;
import javax.xml.crypto.test.KeySelectors;
@@ -128,7 +127,7 @@ public class CreateInteropXFilter2Test {
XMLSignature sig = fac.newXMLSignature
(si, ki, null, null, "signature-value");
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element tbs1 = doc.createElementNS(null, "ToBeSigned");
Comment tbs1Com = doc.createComment(" comment ");
Element tbs1Data = doc.createElementNS(null, "Data");
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java Thu Jan 9 15:30:06 2020
@@ -30,7 +30,6 @@ import javax.xml.crypto.dsig.dom.*;
import javax.xml.crypto.dsig.keyinfo.*;
import javax.xml.crypto.dsig.spec.*;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.*;
import javax.xml.crypto.test.KeySelectors;
@@ -294,7 +293,7 @@ public class CreateInteropXMLDSig11Test
SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
// create Objects
Element webElem = doc.createElementNS(null, "Web");
Text text = doc.createTextNode("up up and away");
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java Thu Jan 9 15:30:06 2020
@@ -45,8 +45,6 @@ import javax.xml.crypto.test.KeySelector
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.apache.xml.security.utils.XMLUtils;
-
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
@@ -112,7 +110,7 @@ public class CreatePhaosXMLDSig3Test {
// create XMLSignature
XMLSignature sig = fac.newXMLSignature(si, null);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
DOMSignContext dsc = new DOMSignContext
(new KeySelectors.SecretKeySelector
("test".getBytes(StandardCharsets.US_ASCII)), doc);
@@ -154,7 +152,7 @@ public class CreatePhaosXMLDSig3Test {
// create XMLSignature
XMLSignature sig = fac.newXMLSignature(si, null);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element player = doc.createElementNS(null, "player");
player.setAttributeNS(null, "bats", "left");
player.setAttributeNS(null, "id", "10012");
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java Thu Jan 9 15:30:06 2020
@@ -32,7 +32,6 @@ import javax.xml.crypto.dsig.spec.C14NMe
import java.security.*;
import java.util.*;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -137,7 +136,7 @@ public class DetachedTest {
// Create an XMLSignContext and set the
// DSA PrivateKey for signing
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
DOMSignContext signContext = new DOMSignContext(kp.getPrivate(), doc);
signContext.putNamespacePrefix(XMLSignature.XMLNS, "ds");
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/EnvelopingSignatureTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/EnvelopingSignatureTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/EnvelopingSignatureTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/EnvelopingSignatureTest.java Thu Jan 9 15:30:06 2020
@@ -162,7 +162,7 @@ public class EnvelopingSignatureTest {
XMLObject obj = fac.newXMLObject(
Collections.singletonList(new DOMStructure(child)),
"object", null, "UTF-8");
-
+
// Create a KeyInfo and add the KeyValue to it
KeyValue kv = kif.newKeyValue(rsaKeyPair.getPublic());
KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
@@ -170,7 +170,7 @@ public class EnvelopingSignatureTest {
XMLSignature sig = fac.newXMLSignature(si, ki,
Collections.singletonList(obj),
"signature", null);
- DOMSignContext dsc = new DOMSignContext(rsaKeyPair.getPrivate(), doc);
+ DOMSignContext dsc = new DOMSignContext(rsaKeyPair.getPrivate(), doc);
sig.sign(dsc);
// validate signature
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java Thu Jan 9 15:30:06 2020
@@ -41,7 +41,6 @@ import javax.xml.crypto.dsig.keyinfo.Key
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.crypto.test.KeySelectors;
-import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.Assumptions;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -164,7 +163,7 @@ public class HMACSignatureAlgorithmTest
SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
// create Objects
Element webElem = doc.createElementNS(null, "Web");
Text text = doc.createTextNode("up up and away");
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/PKSignatureAlgorithmTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/PKSignatureAlgorithmTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/PKSignatureAlgorithmTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/PKSignatureAlgorithmTest.java Thu Jan 9 15:30:06 2020
@@ -45,7 +45,6 @@ import javax.xml.crypto.dsig.keyinfo.Key
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.crypto.test.KeySelectors;
-import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.w3c.dom.Document;
@@ -291,7 +290,7 @@ public class PKSignatureAlgorithmTest {
SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
// create Objects
Element webElem = doc.createElementNS(null, "Web");
Text text = doc.createTextNode("up up and away");
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/SignatureDigestMethodTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/SignatureDigestMethodTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/SignatureDigestMethodTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/SignatureDigestMethodTest.java Thu Jan 9 15:30:06 2020
@@ -39,7 +39,6 @@ import javax.xml.crypto.dsig.keyinfo.Key
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.crypto.test.KeySelectors;
-import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.Assumptions;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -183,7 +182,7 @@ public class SignatureDigestMethodTest {
SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
// create Objects
Element webElem = doc.createElementNS(null, "Web");
Text text = doc.createTextNode("up up and away");
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/TestUtils.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/TestUtils.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/TestUtils.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/TestUtils.java Thu Jan 9 15:30:06 2020
@@ -63,6 +63,8 @@ import javax.xml.crypto.dsig.dom.DOMVali
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.crypto.dsig.spec.DigestMethodParameterSpec;
import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import javax.xml.transform.Transformer;
@@ -110,6 +112,18 @@ public class TestUtils {
private static final String RSA_PRIV =
"0161169735844219697954459962296126719476357984292128166117072108359155865913405986839960884870654387514883422519600695753920562880636800379454345804879553";
+ private static final DocumentBuilderFactory DBF = DocumentBuilderFactory.newInstance();
+
+ static {
+ DBF.setNamespaceAware(true);
+ try {
+ DBF.setFeature(javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ } catch (ParserConfigurationException e) {
+ // Ignore: DocumentBuilderFactory is required to support the secure processing feature
+ e.printStackTrace(); // NOPMD
+ }
+ }
+
private TestUtils() {}
public static PublicKey getPublicKey(String algo)
@@ -214,7 +228,7 @@ public class TestUtils {
public static Document newDocument() {
try {
- return XMLUtils.newDocument();
+ return DBF.newDocumentBuilder().newDocument();
} catch (Exception ex) {
return null;
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/keyinfo/KeyInfoTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/keyinfo/KeyInfoTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/keyinfo/KeyInfoTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/keyinfo/KeyInfoTest.java Thu Jan 9 15:30:06 2020
@@ -33,7 +33,7 @@ import javax.xml.crypto.dsig.keyinfo.Key
import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
import org.apache.jcp.xml.dsig.internal.dom.DOMUtils;
-import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.test.dom.TestUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -120,7 +120,7 @@ public class KeyInfoTest {
fail("Should raise a NullPointerException");
} catch (NullPointerException npe) {}
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element elem = doc.createElementNS("http://acme.org", "parent");
doc.appendChild(elem);
DOMStructure parent = new DOMStructure(elem);
@@ -140,7 +140,7 @@ public class KeyInfoTest {
}
// check if key info is inserted before nextSibling
- doc = XMLUtils.newDocument();
+ doc = TestUtils.newDocument();
elem = doc.createElementNS("http://acme.org", "parent");
doc.appendChild(elem);
Element nextSib = doc.createElementNS("http://acme.org", "nextSib");
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/CreateExclC14nInteropValues.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/CreateExclC14nInteropValues.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/CreateExclC14nInteropValues.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/CreateExclC14nInteropValues.java Thu Jan 9 15:30:06 2020
@@ -50,7 +50,7 @@ public class CreateExclC14nInteropValues
org.apache.xml.security.Init.init();
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
String directory = "data/org/apache/xml/security/c14n/outExcl/";
File signatureFile = new File(directory + "apacheSignature.xml");
XMLSignature xmlSignature = new XMLSignature(doc,
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/TestUtils.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/TestUtils.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/TestUtils.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/TestUtils.java Thu Jan 9 15:30:06 2020
@@ -18,12 +18,27 @@
*/
package org.apache.xml.security.test.dom;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.xml.security.utils.Constants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class TestUtils {
+ private static final DocumentBuilderFactory DBF = DocumentBuilderFactory.newInstance();
+
+ static {
+ DBF.setNamespaceAware(true);
+ try {
+ DBF.setFeature(javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ } catch (ParserConfigurationException e) {
+ // Ignore: DocumentBuilderFactory is required to support the secure processing feature
+ e.printStackTrace(); // NOPMD
+ }
+ }
+
/**
* Method createDSctx
*
@@ -42,4 +57,7 @@ public class TestUtils {
return ctx;
}
+ public static Document newDocument() throws ParserConfigurationException {
+ return DBF.newDocumentBuilder().newDocument();
+ }
}
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java Thu Jan 9 15:30:06 2020
@@ -25,7 +25,7 @@ import java.security.Provider;
import java.security.Security;
import org.apache.xml.security.algorithms.MessageDigestAlgorithm;
-import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.test.dom.TestUtils;
import org.junit.jupiter.api.Assumptions;
import org.w3c.dom.Document;
@@ -74,7 +74,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA1() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1);
@@ -92,7 +92,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA224() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA224);
@@ -110,7 +110,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA256() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256);
@@ -128,7 +128,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA384() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA384);
@@ -146,7 +146,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA512() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512);
@@ -164,7 +164,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testMD5() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5);
@@ -183,7 +183,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testRIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_RIPEMD160);
@@ -202,7 +202,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testWhirlpool() throws Exception {
Assumptions.assumeTrue(bcInstalled);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_WHIRLPOOL);
@@ -221,7 +221,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA3_224() throws Exception {
Assumptions.assumeTrue(bcInstalled);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA3_224);
@@ -240,7 +240,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA3_256() throws Exception {
Assumptions.assumeTrue(bcInstalled);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA3_256);
@@ -259,7 +259,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA3_384() throws Exception {
Assumptions.assumeTrue(bcInstalled);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA3_384);
@@ -278,7 +278,7 @@ public class DigestAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSHA3_512() throws Exception {
Assumptions.assumeTrue(bcInstalled);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA3_512);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java Thu Jan 9 15:30:06 2020
@@ -27,7 +27,7 @@ import java.util.Map;
import org.apache.xml.security.algorithms.SignatureAlgorithm;
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
-import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.test.dom.TestUtils;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -44,7 +44,7 @@ public class SignatureAlgorithmTest {
@org.junit.jupiter.api.Test
public void testSameKeySeveralAlgorithmSigning() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
new SignatureAlgorithm(doc, XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1);
PrivateKey pk = KeyPairGenerator.getInstance("RSA").genKeyPair().getPrivate();
@@ -76,7 +76,7 @@ public class SignatureAlgorithmTest {
Map<String, Class<?>> algorithmHash = (Map<String, Class<?>>)algorithmHashField.get(null);
assertFalse(algorithmHash.isEmpty());
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Provider provider = new org.bouncycastle.jce.provider.BouncyCastleProvider();
for (String algorithmURI : algorithmHash.keySet()) {
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java Thu Jan 9 15:30:06 2020
@@ -22,8 +22,8 @@ package org.apache.xml.security.test.dom
import javax.xml.parsers.ParserConfigurationException;
import org.apache.xml.security.c14n.helper.AttrCompare;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -220,7 +220,7 @@ public class AttrCompareTest {
private static Document createDoc(
String documentElement
) throws ParserConfigurationException {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element root = doc.createElementNS(null, documentElement);
doc.appendChild(root);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java Thu Jan 9 15:30:06 2020
@@ -30,9 +30,9 @@ import org.apache.xml.security.keys.KeyI
import org.apache.xml.security.signature.ObjectContainer;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -83,7 +83,7 @@ public class Bug45961Test {
X509Certificate signingCert = (X509Certificate) ks
.getCertificate(ALIAS);
- Document document = XMLUtils.newDocument();
+ Document document = TestUtils.newDocument();
XMLSignature signature = new XMLSignature(document, null,
XMLSignature.ALGO_ID_SIGNATURE_DSA,
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java Thu Jan 9 15:30:06 2020
@@ -38,6 +38,7 @@ import org.apache.xml.security.c14n.impl
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureInput;
import org.apache.xml.security.test.dom.DSNamespaceContext;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.JavaUtils;
import org.apache.xml.security.utils.XMLUtils;
@@ -279,7 +280,7 @@ public class Canonicalizer20010315Exclus
*/
@org.junit.jupiter.api.Test
public void test24Aexcl() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element local = doc.createElementNS("foo:bar", "dsig:local");
Element test = doc.createElementNS("http://example.net", "etsi:test");
Element elem2 = doc.createElementNS("http://example.net", "etsi:elem2");
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java Thu Jan 9 15:30:06 2020
@@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.xml.security.c14n.implementations.NameSpaceSymbTable;
-import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.test.dom.TestUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -38,7 +38,7 @@ public class NameSpaceSymbTableTest {
static Attr node1, node2;
static {
try {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
node1 = doc.createAttributeNS("a","b");
node2 = doc.createAttributeNS("b","c");
} catch (Exception e) {
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java Thu Jan 9 15:30:06 2020
@@ -24,8 +24,8 @@ import java.util.Iterator;
import org.apache.xml.security.encryption.Reference;
import org.apache.xml.security.encryption.ReferenceList;
import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.EncryptionConstants;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -46,7 +46,7 @@ public class ReferenceListTest {
@org.junit.jupiter.api.Test
public void testReferenceList() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
XMLCipher dataCipher = XMLCipher.getInstance();
dataCipher.init(XMLCipher.DECRYPT_MODE, null);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java Thu Jan 9 15:30:06 2020
@@ -57,6 +57,7 @@ import org.apache.xml.security.utils.Enc
import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.Assumptions;
import org.apache.xml.security.keys.KeyInfo;
+import org.apache.xml.security.test.dom.TestUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -634,7 +635,7 @@ public class XMLCipherTest {
public void testSameDocumentCipherReference() throws Exception {
if (haveISOPadding) {
- Document d = XMLUtils.newDocument();
+ Document d = TestUtils.newDocument();
Element docElement = d.createElement("EncryptedDoc");
d.appendChild(docElement);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java Thu Jan 9 15:30:06 2020
@@ -24,6 +24,7 @@ import java.security.PublicKey;
import java.security.spec.X509EncodedKeySpec;
import org.apache.xml.security.keys.content.DEREncodedKeyValue;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.JavaUtils;
import org.apache.xml.security.utils.XMLUtils;
@@ -56,7 +57,7 @@ public class DEREncodedKeyValueTest {
@org.junit.jupiter.api.Test
public void testSchema() throws Exception {
- DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(XMLUtils.newDocument(), rsaKeyControl);
+ DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), rsaKeyControl);
Element element = derEncodedKeyValue.getElement();
assertEquals("http://www.w3.org/2009/xmldsig11#", element.getNamespaceURI());
@@ -101,28 +102,28 @@ public class DEREncodedKeyValueTest {
@org.junit.jupiter.api.Test
public void testRSAPublicKeyFromKey() throws Exception {
- DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(XMLUtils.newDocument(), rsaKeyControl);
+ DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), rsaKeyControl);
assertEquals(rsaKeyControl, derEncodedKeyValue.getPublicKey());
assertArrayEquals(rsaKeyControl.getEncoded(), derEncodedKeyValue.getBytesFromTextChild());
}
@org.junit.jupiter.api.Test
public void testDSAPublicKeyFromKey() throws Exception {
- DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(XMLUtils.newDocument(), dsaKeyControl);
+ DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), dsaKeyControl);
assertEquals(dsaKeyControl, derEncodedKeyValue.getPublicKey());
assertArrayEquals(dsaKeyControl.getEncoded(), derEncodedKeyValue.getBytesFromTextChild());
}
@org.junit.jupiter.api.Test
public void testECPublicKeyFromKey() throws Exception {
- DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(XMLUtils.newDocument(), ecKeyControl);
+ DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), ecKeyControl);
assertEquals(ecKeyControl, derEncodedKeyValue.getPublicKey());
assertArrayEquals(ecKeyControl.getEncoded(), derEncodedKeyValue.getBytesFromTextChild());
}
@org.junit.jupiter.api.Test
public void testId() throws Exception {
- DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(XMLUtils.newDocument(), rsaKeyControl);
+ DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), rsaKeyControl);
assertEquals("", derEncodedKeyValue.getId());
assertNull(derEncodedKeyValue.getElement().getAttributeNodeNS(null, Constants._ATT_ID));
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java Thu Jan 9 15:30:06 2020
@@ -21,6 +21,7 @@ package org.apache.xml.security.test.dom
import java.io.FileInputStream;
import org.apache.xml.security.keys.content.KeyInfoReference;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
@@ -42,7 +43,7 @@ public class KeyInfoReferenceTest {
@org.junit.jupiter.api.Test
public void testSchema() throws Exception {
- KeyInfoReference keyInfoReference = new KeyInfoReference(XMLUtils.newDocument(), URI_CONTROL);
+ KeyInfoReference keyInfoReference = new KeyInfoReference(TestUtils.newDocument(), URI_CONTROL);
Element element = keyInfoReference.getElement();
assertEquals("http://www.w3.org/2009/xmldsig11#", element.getNamespaceURI());
@@ -62,13 +63,13 @@ public class KeyInfoReferenceTest {
@org.junit.jupiter.api.Test
public void testURIOnConstruction() throws Exception {
- KeyInfoReference keyInfoReference = new KeyInfoReference(XMLUtils.newDocument(), URI_CONTROL);
+ KeyInfoReference keyInfoReference = new KeyInfoReference(TestUtils.newDocument(), URI_CONTROL);
assertEquals(URI_CONTROL, keyInfoReference.getURI());
}
@org.junit.jupiter.api.Test
public void testId() throws Exception {
- KeyInfoReference keyInfoReference = new KeyInfoReference(XMLUtils.newDocument(), URI_CONTROL);
+ KeyInfoReference keyInfoReference = new KeyInfoReference(TestUtils.newDocument(), URI_CONTROL);
assertEquals("", keyInfoReference.getId());
assertNull(keyInfoReference.getElement().getAttributeNodeNS(null, Constants._ATT_ID));
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java Thu Jan 9 15:30:06 2020
@@ -24,6 +24,7 @@ import java.security.cert.X509Certificat
import org.apache.xml.security.Init;
import org.apache.xml.security.keys.content.x509.XMLX509Digest;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
@@ -57,7 +58,7 @@ public class XMLX509DigestTest {
@org.junit.jupiter.api.Test
public void testSchema() throws Exception {
- XMLX509Digest x509Digest = new XMLX509Digest(XMLUtils.newDocument(), digestControl, ALG_URI_CONTROL);
+ XMLX509Digest x509Digest = new XMLX509Digest(TestUtils.newDocument(), digestControl, ALG_URI_CONTROL);
Element element = x509Digest.getElement();
assertEquals("http://www.w3.org/2009/xmldsig11#", element.getNamespaceURI());
@@ -77,14 +78,14 @@ public class XMLX509DigestTest {
@org.junit.jupiter.api.Test
public void testDigestOnConstructionWithCert() throws Exception {
- XMLX509Digest x509Digest = new XMLX509Digest(XMLUtils.newDocument(), certControl, ALG_URI_CONTROL);
+ XMLX509Digest x509Digest = new XMLX509Digest(TestUtils.newDocument(), certControl, ALG_URI_CONTROL);
assertEquals(ALG_URI_CONTROL, x509Digest.getAlgorithm());
assertArrayEquals(digestControl, x509Digest.getDigestBytes());
}
@org.junit.jupiter.api.Test
public void testDigestOnConstructionWithBytes() throws Exception {
- XMLX509Digest x509Digest = new XMLX509Digest(XMLUtils.newDocument(), digestControl, ALG_URI_CONTROL);
+ XMLX509Digest x509Digest = new XMLX509Digest(TestUtils.newDocument(), digestControl, ALG_URI_CONTROL);
assertEquals(ALG_URI_CONTROL, x509Digest.getAlgorithm());
assertArrayEquals(digestControl, x509Digest.getDigestBytes());
}
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java Thu Jan 9 15:30:06 2020
@@ -20,7 +20,7 @@ package org.apache.xml.security.test.dom
import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial;
-import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.test.dom.TestUtils;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -34,7 +34,7 @@ public class XMLX509IssuerSerialTest {
private Document doc;
public XMLX509IssuerSerialTest() throws Exception {
- doc = XMLUtils.newDocument();
+ doc = TestUtils.newDocument();
}
@org.junit.jupiter.api.Test
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java Thu Jan 9 15:30:06 2020
@@ -55,8 +55,8 @@ import org.apache.xml.security.keys.keyr
import org.apache.xml.security.keys.keyresolver.implementations.SingleKeyResolver;
import org.apache.xml.security.keys.storage.StorageResolver;
import org.apache.xml.security.keys.storage.implementations.KeyStoreResolver;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
@@ -109,7 +109,7 @@ public class KeyResolverTest {
KeyResolverSpi privateKeyResolver = new PrivateKeyResolver(ks, pwd);
KeyResolverSpi secretKeyResolver = new SecretKeyResolver(ks, pwd);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
KeyInfo ki;
X509Data x509data;
@@ -219,7 +219,7 @@ public class KeyResolverTest {
}
// Create a sample XML document
- Document document = XMLUtils.newDocument();
+ Document document = TestUtils.newDocument();
Element rootElement = document.createElement("root");
document.appendChild(rootElement);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java Thu Jan 9 15:30:06 2020
@@ -31,10 +31,10 @@ import javax.xml.parsers.ParserConfigura
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.test.dom.interop.InteropTestBase;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -79,7 +79,7 @@ public class ForbiddenRefCountTest exten
}
private Document getOriginalDocument() throws ParserConfigurationException {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element rootElement = doc.createElementNS("http://ns.example.org/", "root");
rootElement.appendChild(doc.createTextNode("Hello World!"));
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java Thu Jan 9 15:30:06 2020
@@ -45,6 +45,7 @@ import org.apache.xml.security.signature
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureException;
import org.apache.xml.security.test.dom.DSNamespaceContext;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.transforms.params.XPath2FilterContainer;
import org.apache.xml.security.transforms.params.XPathContainer;
@@ -82,7 +83,7 @@ public class CreateSignatureTest {
*/
@org.junit.jupiter.api.Test
public void testEmptyNodeSet() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element envelope = doc.createElementNS("http://www.usps.gov/", "Envelope");
envelope.appendChild(doc.createTextNode("\n"));
doc.appendChild(envelope);
@@ -157,7 +158,7 @@ public class CreateSignatureTest {
@org.junit.jupiter.api.Test
public void testXFilter2Signature() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
doc.appendChild(doc.createComment(" Comment before "));
Element root = doc.createElementNS("", "RootElement");
@@ -260,7 +261,7 @@ public class CreateSignatureTest {
@org.junit.jupiter.api.Test
public void testSHA256Digest() throws Exception {
PrivateKey privateKey = kp.getPrivate();
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
doc.appendChild(doc.createComment(" Comment before "));
Element root = doc.createElementNS("", "RootElement");
@@ -299,7 +300,7 @@ public class CreateSignatureTest {
@org.junit.jupiter.api.Test
public void testSignatureProperties() throws Exception {
PrivateKey privateKey = kp.getPrivate();
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element root = doc.createElementNS("", "RootElement");
doc.appendChild(root);
@@ -348,7 +349,7 @@ public class CreateSignatureTest {
@org.junit.jupiter.api.Test
public void testAddDuplicateKeyInfo() throws Exception {
PrivateKey privateKey = kp.getPrivate();
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element root = doc.createElementNS("", "RootElement");
doc.appendChild(root);
@@ -395,7 +396,7 @@ public class CreateSignatureTest {
@org.junit.jupiter.api.Test
public void testWrongSignatureName() throws Exception {
PrivateKey privateKey = kp.getPrivate();
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element root = doc.createElementNS("", "RootElement");
doc.appendChild(root);
@@ -462,7 +463,7 @@ public class CreateSignatureTest {
private String doSign() throws Exception {
PrivateKey privateKey = kp.getPrivate();
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
doc.appendChild(doc.createComment(" Comment before "));
Element root = doc.createElementNS("", "RootElement");
@@ -507,7 +508,7 @@ public class CreateSignatureTest {
}
ks.load(fis, "changeit".toCharArray());
PrivateKey privateKey = (PrivateKey) ks.getKey("mullan", "changeit".toCharArray());
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
X509Certificate signingCert = (X509Certificate) ks.getCertificate("mullan");
doc.appendChild(doc.createComment(" Comment before "));
Element root = doc.createElementNS("", "RootElement");
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java Thu Jan 9 15:30:06 2020
@@ -39,6 +39,7 @@ import org.apache.xml.security.c14n.Cano
import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.test.dom.DSNamespaceContext;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
@@ -123,7 +124,7 @@ public class ECDSASignatureTest {
}
private byte[] doSign(PrivateKey privateKey, X509Certificate x509, PublicKey publicKey) throws Exception {
- org.w3c.dom.Document doc = XMLUtils.newDocument();
+ org.w3c.dom.Document doc = TestUtils.newDocument();
doc.appendChild(doc.createComment(" Comment before "));
Element root = doc.createElementNS("", "RootElement");
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java Thu Jan 9 15:30:06 2020
@@ -32,6 +32,7 @@ import org.apache.xml.security.Init;
import org.apache.xml.security.c14n.Canonicalizer;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
@@ -78,7 +79,7 @@ public class HMACOutputLengthTest {
@org.junit.jupiter.api.Test
public void test_generate_hmac_sha1_40() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
XMLSignature sig =
new XMLSignature(
doc, null, XMLSignature.ALGO_ID_MAC_HMAC_SHA1,
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/PreCalculatedDigestSignatureTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/PreCalculatedDigestSignatureTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/PreCalculatedDigestSignatureTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/PreCalculatedDigestSignatureTest.java Thu Jan 9 15:30:06 2020
@@ -21,6 +21,7 @@ package org.apache.xml.security.test.dom
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureInput;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.TransformationException;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
@@ -137,7 +138,7 @@ public class PreCalculatedDigestSignatur
}
private XMLSignature createXmlSignature() throws ParserConfigurationException, XMLSecurityException {
- Document signatureDocument = XMLUtils.newDocument();
+ Document signatureDocument = TestUtils.newDocument();
Element root = createSignatureRoot(signatureDocument);
String baseURI = "";
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java Thu Jan 9 15:30:06 2020
@@ -47,6 +47,7 @@ import org.apache.xml.security.signature
import org.apache.xml.security.signature.reference.ReferenceData;
import org.apache.xml.security.signature.reference.ReferenceNodeSetData;
import org.apache.xml.security.test.dom.DSNamespaceContext;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.ElementProxy;
@@ -112,7 +113,7 @@ public class SignatureReferenceTest {
// See SANTUARIO-465
@org.junit.jupiter.api.Test
public void testNoReferenceChildren() throws ParserConfigurationException, XMLSecurityException {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element referenceElement = doc.createElementNS(Constants.SignatureSpecNS, "Reference");
referenceElement.setAttributeNS(null, "URI", "#_12345");
@@ -230,7 +231,7 @@ public class SignatureReferenceTest {
}
private Document getOriginalDocument() throws Throwable {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element rootElement = doc.createElementNS("http://ns.example.org/", "root");
rootElement.appendChild(doc.createTextNode("Hello World!"));
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java Thu Jan 9 15:30:06 2020
@@ -31,10 +31,10 @@ import java.util.Enumeration;
import org.apache.xml.security.Init;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.ElementProxy;
-import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.utils.resolver.implementations.ResolverXPointer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -200,7 +200,7 @@ public class SignatureTest {
}
private Document getOriginalDocument() throws Throwable {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element rootElement = doc.createElementNS("http://ns.example.org/", "root");
rootElement.appendChild(doc.createTextNode("Hello World!"));
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java Thu Jan 9 15:30:06 2020
@@ -29,6 +29,7 @@ import java.security.cert.X509Certificat
import org.apache.xml.security.Init;
import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -47,7 +48,7 @@ public class X509DataTest {
public void testAddX509SubjectName() throws Exception {
Init.init();
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
XMLSignature sig = new XMLSignature(doc, "", XMLSignature.ALGO_ID_SIGNATURE_DSA);
doc.appendChild(sig.getElement());
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java Thu Jan 9 15:30:06 2020
@@ -35,10 +35,10 @@ import org.apache.xml.security.algorithm
import org.apache.xml.security.c14n.Canonicalizer;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.test.dom.DSNamespaceContext;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.transforms.params.XPathContainer;
import org.apache.xml.security.utils.Constants;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -71,7 +71,7 @@ public class XmlSecTest {
private void checkXmlSignatureSoftwareStack(boolean cert) throws Exception {
Init.init();
- Document testDocument = XMLUtils.newDocument();
+ Document testDocument = TestUtils.newDocument();
Element rootElement =
testDocument.createElementNS("urn:namespace", "tns:document");
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java Thu Jan 9 15:30:06 2020
@@ -29,6 +29,7 @@ import javax.xml.xpath.XPathFactory;
import org.apache.xml.security.signature.XMLSignatureInput;
import org.apache.xml.security.test.dom.DSNamespaceContext;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.transforms.implementations.TransformBase64Decode;
import org.apache.xml.security.utils.XMLUtils;
@@ -138,7 +139,7 @@ public class TransformBase64DecodeTest {
}
private static Document createDocument() throws ParserConfigurationException {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
if (doc == null) {
throw new RuntimeException("Could not create a Document");
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResolverDirectHTTPTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResolverDirectHTTPTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResolverDirectHTTPTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResolverDirectHTTPTest.java Thu Jan 9 15:30:06 2020
@@ -19,7 +19,7 @@
package org.apache.xml.security.test.dom.utils.resolver;
import org.apache.xml.security.Init;
-import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.ResourceResolverContext;
import org.apache.xml.security.utils.resolver.ResourceResolverException;
@@ -52,7 +52,7 @@ public class ResolverDirectHTTPTest {
@Test
public void testBug40783() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uri = doc.createAttribute("id");
uri.setNodeValue("urn:ddd:uuu");
doc.createElement("test").setAttributeNode(uri);
@@ -67,7 +67,7 @@ public class ResolverDirectHTTPTest {
@Test
@Disabled
public void testProxyAuth() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uri = doc.createAttribute("URI");
uri.setNodeValue(url);
@@ -84,7 +84,7 @@ public class ResolverDirectHTTPTest {
@Test
@Disabled
public void testProxyAuthWithWrongPassword() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uri = doc.createAttribute("URI");
uri.setNodeValue(url);
@@ -106,7 +106,7 @@ public class ResolverDirectHTTPTest {
@Test
@Disabled
public void testServerAuth() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uri = doc.createAttribute("URI");
uri.setNodeValue(url);
@@ -121,7 +121,7 @@ public class ResolverDirectHTTPTest {
@Test
@Disabled
public void testServerAuthWithWrongPassword() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uri = doc.createAttribute("URI");
uri.setNodeValue(url);
@@ -141,7 +141,7 @@ public class ResolverDirectHTTPTest {
@Test
@Disabled
public void testProxyAndServerAuth() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uri = doc.createAttribute("URI");
uri.setNodeValue(url);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java Thu Jan 9 15:30:06 2020
@@ -21,7 +21,7 @@ package org.apache.xml.security.test.dom
import java.io.File;
-import org.apache.xml.security.utils.XMLUtils;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -50,7 +50,7 @@ public class ResourceResolverTest {
String className =
"org.apache.xml.security.test.dom.utils.resolver.OfflineResolver";
ResourceResolver.registerAtStart(className);
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
uriAttr.setValue("http://www.apache.org");
ResourceResolver res =
@@ -73,7 +73,7 @@ public class ResourceResolverTest {
@org.junit.jupiter.api.Test
public void testLocalFileWithEmptyBaseURI() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
String basedir = System.getProperty("basedir");
String file = new File(basedir, "pom.xml").toURI().toString();
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java Thu Jan 9 15:30:06 2020
@@ -23,8 +23,8 @@ import org.junit.jupiter.api.BeforeEach;
import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_ExclOmitCommentsTransformer;
import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_ExclWithCommentsTransformer;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -236,7 +236,7 @@ public class Canonicalizer20010315Exclus
*/
@org.junit.jupiter.api.Test
public void test24Aexcl() throws Exception {
- Document doc = XMLUtils.newDocument();
+ Document doc = TestUtils.newDocument();
Element local = doc.createElementNS("foo:bar", "dsig:local");
Element test = doc.createElementNS("http://example.net", "etsi:test");
Element elem2 = doc.createElementNS("http://example.net", "etsi:elem2");
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/StAX2DOM.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/StAX2DOM.java?rev=1872555&r1=1872554&r2=1872555&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/StAX2DOM.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/utils/StAX2DOM.java Thu Jan 9 15:30:06 2020
@@ -18,7 +18,6 @@
*/
package org.apache.xml.security.test.stax.utils;
-import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.*;
import javax.xml.parsers.ParserConfigurationException;
@@ -36,7 +35,7 @@ public class StAX2DOM {
//skip possible text at the beginning of a document and go directly to the root tag
while (xmlStreamReader.hasNext() && xmlStreamReader.next() != XMLStreamConstants.START_ELEMENT) { //NOPMD
}
- Document document = XMLUtils.newDocument();
+ Document document = org.apache.xml.security.test.dom.TestUtils.newDocument();
StAX2DOM.readDocElements(document, document, xmlStreamReader, false, false);
xmlStreamReader.close();
return document;