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 2023/06/16 12:55:14 UTC
[santuario-xml-security-java] branch main updated: Test annotations moved to imports, finals, enhanced loops (#177)
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git
The following commit(s) were added to refs/heads/main by this push:
new e8ecc19e Test annotations moved to imports, finals, enhanced loops (#177)
e8ecc19e is described below
commit e8ecc19ef76bacfa2118bc3f760372dd845861e2
Author: David Matějček <da...@omnifish.ee>
AuthorDate: Fri Jun 16 14:55:09 2023 +0200
Test annotations moved to imports, finals, enhanced loops (#177)
* Test annotations moved to imports, finals, enhanced loops
Signed-off-by: David Matějček <da...@omnifish.ee>
* Fixed default value
- Fixed wrong replacement made by Eclipse IDE in the previous commit
Signed-off-by: David Matějček <da...@omnifish.ee>
---------
Signed-off-by: David Matějček <da...@omnifish.ee>
---
.../org/apache/xml/security/test/dom/InitTest.java | 5 +-
.../test/dom/algorithms/DigestAlgorithmTest.java | 32 +++---
.../dom/algorithms/HMACSignatureAlgorithmTest.java | 18 ++--
.../test/dom/algorithms/JCEMapperTest.java | 3 +-
.../algorithms/KeyWrapEncryptionAlgorithmTest.java | 26 ++---
.../dom/algorithms/PKSignatureAlgorithmTest.java | 50 +++++-----
.../dom/algorithms/SignatureAlgorithmTest.java | 25 ++---
.../SymmetricEncryptionAlgorithmTest.java | 26 ++---
.../test/dom/c14n/helper/AttrCompareTest.java | 9 +-
.../test/dom/c14n/helper/C14nHelperTest.java | 16 +--
.../dom/c14n/implementations/Bug45961Test.java | 4 +-
.../c14n/implementations/Canonicalizer11Test.java | 17 ++--
.../Canonicalizer20010315ExclusiveTest.java | 39 ++++----
.../implementations/Canonicalizer20010315Test.java | 59 +++++------
.../implementations/ExclusiveC14NInteropTest.java | 11 ++-
.../implementations/NameSpaceSymbTableTest.java | 25 ++---
.../dom/c14n/implementations/Santuario191Test.java | 7 +-
.../dom/c14n/implementations/Santuario273Test.java | 3 +-
.../dom/c14n/implementations/UtfHelperTest.java | 5 +-
.../test/dom/encryption/BaltimoreEncTest.java | 22 ++---
.../test/dom/encryption/EncryptContentTest.java | 7 +-
.../test/dom/encryption/ReferenceListTest.java | 3 +-
.../test/dom/encryption/XMLCipherTest.java | 59 +++++------
.../test/dom/encryption/XMLEncryption11Test.java | 21 ++--
.../security/test/dom/interop/BaltimoreTest.java | 45 +++++----
.../test/dom/interop/BaltimoreXalanTest.java | 7 +-
.../xml/security/test/dom/interop/IAIKTest.java | 25 ++---
.../xml/security/test/dom/interop/IBMTest.java | 22 +++--
.../security/test/dom/interop/RSASecurityTest.java | 5 +-
.../test/dom/keys/DEREncodedKeyValueTest.java | 17 ++--
.../test/dom/keys/KeyInfoReferenceTest.java | 13 +--
.../keys/content/x509/XMLX509CertificateTest.java | 5 +-
.../dom/keys/content/x509/XMLX509DigestTest.java | 13 ++-
.../keys/content/x509/XMLX509IssuerSerialTest.java | 7 +-
.../test/dom/keys/content/x509/XMLX509SKITest.java | 4 +-
.../keys/content/x509/XMLX509SubjectNameTest.java | 5 +-
.../DEREncodedKeyValueResolverTest.java | 18 ++--
.../keyresolver/KeyInfoReferenceResolverTest.java | 13 +--
.../test/dom/keys/keyresolver/KeyResolverTest.java | 7 +-
.../keyresolver/RetrievalMethodResolverTest.java | 5 +-
.../keys/keyresolver/X509DigestResolverTest.java | 5 +-
.../dom/keys/storage/KeyStoreResolverTest.java | 3 +-
.../test/dom/keys/storage/StorageResolverTest.java | 3 +-
.../security/test/dom/parser/XMLParserTest.java | 5 +-
.../dom/secure_val/ForbiddenAlgorithmTest.java | 3 +-
.../test/dom/secure_val/ForbiddenRefCountTest.java | 3 +-
.../dom/secure_val/ForbiddenReferenceTest.java | 3 +-
.../secure_val/ForbiddenRetrievalMethodTest.java | 3 +-
.../test/dom/secure_val/WrappingAttackTest.java | 3 +-
.../test/dom/signature/CreateSignatureTest.java | 21 ++--
.../dom/signature/CreateSignatureXalanTest.java | 3 +-
.../test/dom/signature/ECDSASignatureTest.java | 17 ++--
.../test/dom/signature/EDDSASignatureTest.java | 9 +-
.../test/dom/signature/HMACOutputLengthTest.java | 9 +-
.../test/dom/signature/InvalidKeyTest.java | 3 +-
.../security/test/dom/signature/KeyValueTest.java | 5 +-
.../security/test/dom/signature/NoKeyInfoTest.java | 3 +-
.../dom/signature/ProcessingInstructionTest.java | 3 +-
.../test/dom/signature/Santuario499Test.java | 3 +-
.../test/dom/signature/SignatureReferenceTest.java | 7 +-
.../security/test/dom/signature/SignatureTest.java | 15 +--
.../dom/signature/UnknownAlgoSignatureTest.java | 9 +-
.../security/test/dom/signature/X509DataTest.java | 3 +-
.../security/test/dom/signature/XmlSecTest.java | 5 +-
.../test/dom/transforms/EmptyNamespaceTest.java | 19 ++--
.../test/dom/transforms/TransformTest.java | 5 +-
.../implementations/TransformBase64DecodeTest.java | 7 +-
.../implementations/TransformXSLTTest.java | 3 +-
.../implementations/Xpath2TransformationTest.java | 3 +-
.../test/dom/utils/JDKXPathFactoryTest.java | 3 +-
.../dom/utils/resolver/ResourceResolverTest.java | 17 ++--
.../xml/security/test/dom/version/VersionTest.java | 6 +-
.../javax/xml/crypto/KeySelectorExceptionTest.java | 5 +-
.../test/javax/xml/crypto/KeySelectorTest.java | 29 +++---
.../test/javax/xml/crypto/OctetStreamDataTest.java | 11 ++-
.../javax/xml/crypto/dsig/Baltimore18Test.java | 15 +--
.../javax/xml/crypto/dsig/Baltimore23Test.java | 32 +++---
.../xml/crypto/dsig/Baltimore23XalanTest.java | 3 +-
.../xml/crypto/dsig/BaltimoreExcC14n1Test.java | 3 +-
.../javax/xml/crypto/dsig/BaltimoreIaik2Test.java | 3 +-
.../dsig/BaltimoreXPathFilter2ThreeTest.java | 5 +-
.../test/javax/xml/crypto/dsig/C14N11Test.java | 42 ++++----
.../crypto/dsig/CanonicalizationMethodTest.java | 14 ++-
.../javax/xml/crypto/dsig/ClassLoaderTest.java | 7 +-
.../javax/xml/crypto/dsig/ComRSASecurityTest.java | 5 +-
.../xml/crypto/dsig/CreateBaltimore23Test.java | 42 ++++----
.../xml/crypto/dsig/CreateInteropExcC14NTest.java | 5 +-
.../xml/crypto/dsig/CreateInteropXFilter2Test.java | 5 +-
.../crypto/dsig/CreateInteropXMLDSig11Test.java | 108 ++++++++++++++-------
.../xml/crypto/dsig/CreatePhaosXMLDSig3Test.java | 9 +-
.../test/javax/xml/crypto/dsig/DetachedTest.java | 27 ++++--
.../javax/xml/crypto/dsig/DigestMethodTest.java | 19 ++--
.../javax/xml/crypto/dsig/EdDSATestAbstract.java | 13 ++-
.../xml/crypto/dsig/EnvelopingSignatureTest.java | 14 +--
.../crypto/dsig/HMACSignatureAlgorithmTest.java | 31 +++---
.../xml/crypto/dsig/IaikCoreFeaturesTest.java | 7 +-
.../xml/crypto/dsig/IaikSignatureAlgosTest.java | 9 +-
.../javax/xml/crypto/dsig/IaikTransformsTest.java | 9 +-
.../javax/xml/crypto/dsig/InteropC14nTest.java | 16 +--
.../xml/crypto/dsig/InteropXMLDSig11Test.java | 44 +++++----
.../xml/crypto/dsig/JSRForbiddenRefCountTest.java | 3 +-
.../xml/crypto/dsig/JSRForbiddenReferenceTest.java | 3 +-
.../xml/crypto/dsig/JSRWrappingAttackTest.java | 4 +-
.../test/javax/xml/crypto/dsig/ManifestTest.java | 19 ++--
.../xml/crypto/dsig/PKSignatureAlgorithmTest.java | 63 ++++++------
.../javax/xml/crypto/dsig/PhaosXMLDSig3Test.java | 50 +++++-----
.../xml/crypto/dsig/PhaosXMLDSig3XalanTest.java | 3 +-
.../test/javax/xml/crypto/dsig/ReferenceTest.java | 41 +++++---
.../test/javax/xml/crypto/dsig/SecureXSLTTest.java | 7 +-
.../xml/crypto/dsig/SignatureDigestMethodTest.java | 35 +++----
.../javax/xml/crypto/dsig/SignatureMethodTest.java | 17 ++--
.../xml/crypto/dsig/SignaturePropertiesTest.java | 21 ++--
.../xml/crypto/dsig/SignaturePropertyTest.java | 19 ++--
.../test/javax/xml/crypto/dsig/SignedInfoTest.java | 23 +++--
.../test/javax/xml/crypto/dsig/TransformTest.java | 33 ++++---
.../xml/crypto/dsig/ValidateSignatureTest.java | 15 +--
.../javax/xml/crypto/dsig/X509KeySelector.java | 35 ++++---
.../test/javax/xml/crypto/dsig/XMLObjectTest.java | 21 ++--
.../javax/xml/crypto/dsig/XMLSignContextTest.java | 27 +++---
.../xml/crypto/dsig/XMLSignatureFactoryTest.java | 11 ++-
.../javax/xml/crypto/dsig/XMLSignatureTest.java | 21 ++--
.../xml/crypto/dsig/XMLValidateContextTest.java | 29 +++---
.../crypto/dsig/dom/DOMValidateContextTest.java | 7 +-
.../crypto/dsig/keyinfo/KeyInfoFactoryTest.java | 39 +++++---
.../javax/xml/crypto/dsig/keyinfo/KeyInfoTest.java | 20 ++--
.../javax/xml/crypto/dsig/keyinfo/KeyNameTest.java | 13 ++-
.../xml/crypto/dsig/keyinfo/KeyValueTest.java | 28 ++++--
.../javax/xml/crypto/dsig/keyinfo/PGPDataTest.java | 30 +++---
.../crypto/dsig/keyinfo/RetrievalMethodTest.java | 17 ++--
.../xml/crypto/dsig/keyinfo/X509DataTest.java | 31 +++---
.../crypto/dsig/keyinfo/X509IssuerSerialTest.java | 20 ++--
.../test/stax/c14n/Canonicalizer11Test.java | 27 +++---
.../c14n/Canonicalizer20010315ExclusiveTest.java | 67 +++++++------
.../test/stax/c14n/Canonicalizer20010315Test.java | 26 +++--
.../security/test/stax/c14n/Santuario191Test.java | 16 ++-
.../encryption/KeyWrapEncryptionCreationTest.java | 3 +-
.../KeyWrapEncryptionVerificationTest.java | 7 +-
.../SymmetricEncryptionCreationTest.java | 3 +-
.../SymmetricEncryptionVerificationTest.java | 7 +-
.../test/stax/encryption/XMLEncryption11Test.java | 21 ++--
.../signature/AbstractSignatureCreationTest.java | 6 +-
.../AbstractSignatureVerificationTest.java | 12 +--
.../stax/signature/SignatureEncryptionTest.java | 8 +-
143 files changed, 1312 insertions(+), 1040 deletions(-)
diff --git a/src/test/java/org/apache/xml/security/test/dom/InitTest.java b/src/test/java/org/apache/xml/security/test/dom/InitTest.java
index c7b7205b..4c11dc08 100644
--- a/src/test/java/org/apache/xml/security/test/dom/InitTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/InitTest.java
@@ -39,6 +39,7 @@ import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -62,7 +63,7 @@ public class InitTest {
System.clearProperty("org.apache.xml.security.resource.config");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testFileInit() throws Exception {
assertFalse(Init.isInitialized());
Init.init();
@@ -73,7 +74,7 @@ public class InitTest {
assertEquals("MessageDigest", JCEMapper.getAlgorithmClassFromURI(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256));
}
- @org.junit.jupiter.api.Test
+ @Test
public void checkConfigFileImplementationsExist() throws Exception {
try (InputStream is = ClassLoaderUtils.getResourceAsStream(CONFIG_FILE, InitTest.class)) {
/* read library configuration file */
diff --git a/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java
index ad35933c..54254275 100644
--- a/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/algorithms/DigestAlgorithmTest.java
@@ -27,7 +27,9 @@ import java.security.Security;
import org.apache.xml.security.algorithms.MessageDigestAlgorithm;
import org.apache.xml.security.signature.XMLSignatureException;
import org.apache.xml.security.test.dom.TestUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@@ -69,12 +71,12 @@ public class DigestAlgorithmTest {
}
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA1() throws Exception {
Document doc = TestUtils.newDocument();
@@ -92,7 +94,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA224() throws Exception {
Document doc = TestUtils.newDocument();
@@ -110,7 +112,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA256() throws Exception {
Document doc = TestUtils.newDocument();
@@ -128,7 +130,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA384() throws Exception {
Document doc = TestUtils.newDocument();
@@ -146,7 +148,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA512() throws Exception {
Document doc = TestUtils.newDocument();
@@ -164,7 +166,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testMD5() throws Exception {
Document doc = TestUtils.newDocument();
@@ -182,7 +184,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
Document doc = TestUtils.newDocument();
@@ -201,7 +203,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testWhirlpool() throws Exception {
Assumptions.assumeTrue(bcInstalled);
Document doc = TestUtils.newDocument();
@@ -220,7 +222,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_224() throws Exception {
Assumptions.assumeTrue(bcInstalled);
Document doc = TestUtils.newDocument();
@@ -239,7 +241,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_256() throws Exception {
Assumptions.assumeTrue(bcInstalled);
Document doc = TestUtils.newDocument();
@@ -258,7 +260,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_384() throws Exception {
Assumptions.assumeTrue(bcInstalled);
Document doc = TestUtils.newDocument();
@@ -277,7 +279,7 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_512() throws Exception {
Assumptions.assumeTrue(bcInstalled);
Document doc = TestUtils.newDocument();
@@ -296,13 +298,13 @@ public class DigestAlgorithmTest {
assertArrayEquals(digest, digest2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testNullAlgorithm() throws Exception {
assertThrows(XMLSignatureException.class, () ->
MessageDigestAlgorithm.getInstance(TestUtils.newDocument(), null));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testNoSuchAlgorithm() throws Exception {
assertThrows(XMLSignatureException.class, () ->
MessageDigestAlgorithm.getInstance(TestUtils.newDocument(), "xyz"));
diff --git a/src/test/java/org/apache/xml/security/test/dom/algorithms/HMACSignatureAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/dom/algorithms/HMACSignatureAlgorithmTest.java
index f77bf941..ac6534c7 100644
--- a/src/test/java/org/apache/xml/security/test/dom/algorithms/HMACSignatureAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/algorithms/HMACSignatureAlgorithmTest.java
@@ -38,8 +38,10 @@ import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -80,12 +82,12 @@ public class HMACSignatureAlgorithmTest {
}
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA1() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -105,7 +107,7 @@ public class HMACSignatureAlgorithmTest {
verify(document, key, localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACMD5() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -125,7 +127,7 @@ public class HMACSignatureAlgorithmTest {
verify(document, key, localNames, false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_224() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -145,7 +147,7 @@ public class HMACSignatureAlgorithmTest {
verify(document, key, localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_256() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -165,7 +167,7 @@ public class HMACSignatureAlgorithmTest {
verify(document, key, localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_384() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -185,7 +187,7 @@ public class HMACSignatureAlgorithmTest {
verify(document, key, localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_512() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -205,7 +207,7 @@ public class HMACSignatureAlgorithmTest {
verify(document, key, localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACRIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
diff --git a/src/test/java/org/apache/xml/security/test/dom/algorithms/JCEMapperTest.java b/src/test/java/org/apache/xml/security/test/dom/algorithms/JCEMapperTest.java
index f606ef41..f6db29a7 100644
--- a/src/test/java/org/apache/xml/security/test/dom/algorithms/JCEMapperTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/algorithms/JCEMapperTest.java
@@ -20,6 +20,7 @@ package org.apache.xml.security.test.dom.algorithms;
import org.apache.xml.security.algorithms.JCEMapper;
import org.apache.xml.security.algorithms.MessageDigestAlgorithm;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -29,7 +30,7 @@ public class JCEMapperTest {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA1() throws Exception {
assertEquals("MessageDigest", JCEMapper.getAlgorithmClassFromURI(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1));
assertEquals("SHA-1", JCEMapper.translateURItoJCEID(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1));
diff --git a/src/test/java/org/apache/xml/security/test/dom/algorithms/KeyWrapEncryptionAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/dom/algorithms/KeyWrapEncryptionAlgorithmTest.java
index 0c073767..87b9b8c5 100644
--- a/src/test/java/org/apache/xml/security/test/dom/algorithms/KeyWrapEncryptionAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/algorithms/KeyWrapEncryptionAlgorithmTest.java
@@ -41,8 +41,10 @@ import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.stax.ext.XMLSecurityConstants;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -87,12 +89,12 @@ public class KeyWrapEncryptionAlgorithmTest {
rsaKeyPair = KeyPairGenerator.getInstance("RSA").genKeyPair();
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES128KW() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -132,7 +134,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES192KW() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -172,7 +174,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES256KW() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -212,7 +214,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testTripleDESKW() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -250,7 +252,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAv15KW() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -286,7 +288,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAOAEPKW() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -322,7 +324,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAOAEP11KW() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -358,7 +360,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCamellia128KW() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -400,7 +402,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCamellia192KW() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -442,7 +444,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCamellia256KW() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -484,7 +486,7 @@ public class KeyWrapEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSEED128KW() throws Exception {
Assumptions.assumeTrue(bcInstalled);
diff --git a/src/test/java/org/apache/xml/security/test/dom/algorithms/PKSignatureAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/dom/algorithms/PKSignatureAlgorithmTest.java
index 378d57fa..e4241ce7 100644
--- a/src/test/java/org/apache/xml/security/test/dom/algorithms/PKSignatureAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/algorithms/PKSignatureAlgorithmTest.java
@@ -41,8 +41,10 @@ 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.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -90,12 +92,12 @@ public class PKSignatureAlgorithmTest {
ecKeyPair = KeyPairGenerator.getInstance("EC").genKeyPair();
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_MD5() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -111,7 +113,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames, false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA1() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -127,7 +129,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_224() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -143,7 +145,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_256() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -159,7 +161,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_384() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -175,7 +177,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_512() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -191,7 +193,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_RIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -209,7 +211,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA1_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -227,7 +229,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA224_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -245,7 +247,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA256_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -263,7 +265,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA384_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -281,7 +283,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA512_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -299,7 +301,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA3_224_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -317,7 +319,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA3_256_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -335,7 +337,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA3_384_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -353,7 +355,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA3_512_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -371,7 +373,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_PSS() throws Exception {
Assumptions.assumeTrue(bcInstalled || TestUtils.isJava11Compatible());
// Read in plaintext document
@@ -389,7 +391,7 @@ public class PKSignatureAlgorithmTest {
verify(document, rsaKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA1() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -405,7 +407,7 @@ public class PKSignatureAlgorithmTest {
verify(document, ecKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA_224() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -421,7 +423,7 @@ public class PKSignatureAlgorithmTest {
verify(document, ecKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA_256() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -437,7 +439,7 @@ public class PKSignatureAlgorithmTest {
verify(document, ecKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA_384() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -453,7 +455,7 @@ public class PKSignatureAlgorithmTest {
verify(document, ecKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA_512() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -469,7 +471,7 @@ public class PKSignatureAlgorithmTest {
verify(document, ecKeyPair.getPublic(), localNames);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_RIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
diff --git a/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java
index 49254b69..08f27fdc 100644
--- a/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/algorithms/SignatureAlgorithmTest.java
@@ -40,6 +40,7 @@ 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.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -67,7 +68,7 @@ public class SignatureAlgorithmTest {
keyPair = keyPairGenerator.generateKeyPair();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSameKeySeveralAlgorithmSigning() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -93,7 +94,7 @@ public class SignatureAlgorithmTest {
otherSignatureAlgorithm.sign();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructionWithProvider() throws Exception {
Field algorithmHashField = SignatureAlgorithm.class.getDeclaredField("algorithmHash");
algorithmHashField.setAccessible(true);
@@ -117,7 +118,7 @@ public class SignatureAlgorithmTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSASigningKeyIsPrivateKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -127,7 +128,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initSign(secretKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDSASigningKeyIsPrivateKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -137,7 +138,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initSign(secretKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSASigningKeyIsPrivateKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -147,7 +148,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initSign(secretKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAVerifyingKeyIsPublicKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -157,7 +158,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initVerify(secretKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDSAVerifyingKeyIsPublicKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -167,7 +168,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initVerify(secretKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSAVerifyingKeyIsPublicKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -177,7 +178,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initVerify(secretKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSigningKeyIsSecretKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -187,7 +188,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initSign(keyPair.getPrivate()));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACVerifyingKeyIsSecretKey() throws Exception {
Document doc = TestUtils.newDocument();
SignatureAlgorithm signatureAlgorithm =
@@ -197,7 +198,7 @@ public class SignatureAlgorithmTest {
signatureAlgorithm.initVerify(keyPair.getPublic()));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAlreadyRegisteredException() throws Exception {
assertThrows(AlgorithmAlreadyRegisteredException.class, () ->
SignatureAlgorithm.register(XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256,
@@ -205,7 +206,7 @@ public class SignatureAlgorithmTest {
);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAlreadyRegisteredExceptionFromString() throws Exception {
assertThrows(AlgorithmAlreadyRegisteredException.class, () ->
SignatureAlgorithm.register(XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256,
diff --git a/src/test/java/org/apache/xml/security/test/dom/algorithms/SymmetricEncryptionAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/dom/algorithms/SymmetricEncryptionAlgorithmTest.java
index 03cb4c5a..78356e4b 100644
--- a/src/test/java/org/apache/xml/security/test/dom/algorithms/SymmetricEncryptionAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/algorithms/SymmetricEncryptionAlgorithmTest.java
@@ -36,8 +36,10 @@ import org.apache.xml.security.encryption.XMLCipher;
import org.apache.xml.security.stax.ext.XMLSecurityConstants;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -79,12 +81,12 @@ public class SymmetricEncryptionAlgorithmTest {
}
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES128() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -116,7 +118,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES128_GCM() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -148,7 +150,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES192() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -180,7 +182,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES192_GCM() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -212,7 +214,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES256() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -244,7 +246,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAES256_GCM() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -276,7 +278,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testTRIPLE_DES() throws Exception {
// Read in plaintext document
InputStream sourceDocument =
@@ -307,7 +309,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSEED_128() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -341,7 +343,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCAMELLIA_128() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -375,7 +377,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCAMELLIA_192() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -409,7 +411,7 @@ public class SymmetricEncryptionAlgorithmTest {
assertEquals(nodeList.getLength(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCAMELLIA_256() throws Exception {
Assumptions.assumeTrue(bcInstalled);
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java b/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java
index 9715f025..440a59ad 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/helper/AttrCompareTest.java
@@ -24,6 +24,7 @@ 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.junit.jupiter.api.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -50,7 +51,7 @@ public class AttrCompareTest {
*
* @throws ParserConfigurationException
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testA1() throws ParserConfigurationException {
Document doc = createDoc("documentElement");
@@ -77,7 +78,7 @@ public class AttrCompareTest {
assertTrue(attrCompare.compare(attr1, attr0) > 0, attr1 + " < " + attr0);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testA2() throws ParserConfigurationException {
Document doc = createDoc("documentElement");
@@ -98,7 +99,7 @@ public class AttrCompareTest {
*
* @throws ParserConfigurationException
*/
- @org.junit.jupiter.api.Test
+ @Test
public void __testA2() throws ParserConfigurationException {
Document doc = createDoc("documentElement");
@@ -134,7 +135,7 @@ public class AttrCompareTest {
*
* @throws ParserConfigurationException
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testComplete() throws ParserConfigurationException {
/* <e5 xmlns="http://example.org"
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/helper/C14nHelperTest.java b/src/test/java/org/apache/xml/security/test/dom/c14n/helper/C14nHelperTest.java
index 5059c966..a037fde1 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/helper/C14nHelperTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/helper/C14nHelperTest.java
@@ -20,6 +20,8 @@ package org.apache.xml.security.test.dom.c14n.helper;
import org.apache.xml.security.c14n.helper.C14nHelper;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -38,7 +40,7 @@ public class C14nHelperTest {
/**
* Method testNamespaceIsAbsolute01
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testNamespaceIsAbsolute01() {
String namespaceURI = "http://www.w3.org/Signature/";
@@ -49,7 +51,7 @@ public class C14nHelperTest {
/**
* @see <A HREF="http://lists.w3.org/Archives/Public/w3c-ietf-xmldsig/2001JulSep/0068.html">The list</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testNamespaceIsAbsolute02() {
String namespaceURI = "http://www.w3.org/../blah";
@@ -60,7 +62,7 @@ public class C14nHelperTest {
/**
* Method testNamespaceIsAbsolute03
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testNamespaceIsAbsolute03() {
// unknown protocol?
@@ -72,7 +74,7 @@ public class C14nHelperTest {
/**
* Method testNamespaceIsRelative01
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testNamespaceIsRelative01() {
String namespaceURI = "../blah";
@@ -83,7 +85,7 @@ public class C14nHelperTest {
/**
* Method testNamespaceIsRelative02
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testNamespaceIsRelative02() {
String namespaceURI = "blah";
@@ -94,8 +96,8 @@ public class C14nHelperTest {
/**
* Method testNamespaceIsRelative03
*/
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void testNamespaceIsRelative03() {
String namespaceURI = "http://...";
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java
index 3e8439a3..7dc726d2 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Bug45961Test.java
@@ -19,7 +19,6 @@
package org.apache.xml.security.test.dom.c14n.implementations;
-import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
@@ -34,6 +33,7 @@ import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -57,7 +57,7 @@ public class Bug45961Test {
MockCanonicalizationMethod.class.getName());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testBug() throws Exception {
Document document = getSignedDocument();
NodeList list =
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer11Test.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer11Test.java
index 960235bf..6987a33c 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer11Test.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer11Test.java
@@ -35,6 +35,7 @@ import javax.xml.xpath.XPathFactory;
import org.apache.xml.security.c14n.Canonicalizer;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -66,7 +67,7 @@ public class Canonicalizer11Test {
/**
* 3.1 PIs, Comments, and Outside of Document Element
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test31withCommentsSubtree() throws Exception {
String descri =
"3.1: PIs, Comments, and Outside of Document Element. (commented)";
@@ -85,7 +86,7 @@ public class Canonicalizer11Test {
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-WhitespaceInContent">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test32subtree() throws Exception {
String descri = "3.2 Whitespace in Document Content. (uncommented)";
String fileIn = resolvePath(prefix, "in", "32_input.xml").toString();
@@ -102,7 +103,7 @@ public class Canonicalizer11Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-SETags">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test33subtree() throws Exception {
String descri = "3.3 Start and End Tags. (uncommented)";
String fileIn = resolvePath(prefix, "in", "33_input.xml").toString();
@@ -120,7 +121,7 @@ public class Canonicalizer11Test {
* @see #test34validatingParser
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Chars">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test34() throws Exception {
String descri =
"3.4 Character Modifications and Character References. (uncommented)";
@@ -138,7 +139,7 @@ public class Canonicalizer11Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Entities">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test35subtree() throws Exception {
String descri = "3.5 Entity References. (uncommented)";
String fileIn = resolvePath(prefix, "in", "35_input.xml").toString();
@@ -155,7 +156,7 @@ public class Canonicalizer11Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-UTF8">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test36subtree() throws Exception {
String descri = "3.6 UTF-8 Encoding. (uncommented)";
String fileIn = resolvePath(prefix, "in", "36_input.xml").toString();
@@ -172,7 +173,7 @@ public class Canonicalizer11Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-DocSubsets">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test37() throws Exception {
String descri = "3.7 Document Subsets. (uncommented)";
String fileIn = resolvePath(prefix, "in", "37_input.xml").toString();
@@ -196,7 +197,7 @@ public class Canonicalizer11Test {
/**
* 3.8 Document Subsets and XML Attributes
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test38() throws Exception {
String descri = "3.8 Document Subsets and XML Attributes (uncommented)";
String fileIn = resolvePath(prefix, "in", "38_input.xml").toString();
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java
index 1a885a6e..bdb839db 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315ExclusiveTest.java
@@ -22,7 +22,6 @@ package org.apache.xml.security.test.dom.c14n.implementations;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.HashSet;
@@ -42,10 +41,10 @@ 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;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -74,7 +73,7 @@ public class Canonicalizer20010315ExclusiveTest {
/**
* Method testA
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testA() throws Exception {
File fileIn = resolveFile(
@@ -110,7 +109,7 @@ public class Canonicalizer20010315ExclusiveTest {
/**
* Method test221
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test221() throws Exception {
Document doc = XMLUtils
.read(resolveFile("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1.xml"), false);
@@ -129,7 +128,7 @@ public class Canonicalizer20010315ExclusiveTest {
/**
* Method test222
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test222() throws Exception {
Document doc = XMLUtils
.read(resolveFile("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2.xml"), false);
@@ -148,7 +147,7 @@ public class Canonicalizer20010315ExclusiveTest {
/**
* Method test221excl
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test221excl() throws Exception {
Document doc = XMLUtils
.read(resolveFile("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1.xml"), false);
@@ -167,7 +166,7 @@ public class Canonicalizer20010315ExclusiveTest {
/**
* Method test222excl
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test222excl() throws Exception {
Document doc = XMLUtils
.read(resolveFile("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2.xml"), false);
@@ -188,7 +187,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* Provided by Gabriel McGoldrick - see e-mail of 21/11/03
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test223excl() throws Exception {
Document doc = XMLUtils
.read(resolveFile("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_3.xml"), false);
@@ -214,7 +213,7 @@ public class Canonicalizer20010315ExclusiveTest {
* Tests node-set as input. See bug 37708.
* Provided by Pete Hendry.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testNodeSet() throws Exception {
final String XML =
"<env:Envelope"
@@ -259,7 +258,7 @@ public class Canonicalizer20010315ExclusiveTest {
* "Canonicalizer can't handle dynamical created DOM correctly"
* https://issues.apache.org/jira/browse/SANTUARIO-263
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test24excl() throws Exception {
Document doc = XMLUtils
.read(resolveFile("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_4.xml"), false);
@@ -281,7 +280,7 @@ public class Canonicalizer20010315ExclusiveTest {
* "Canonicalizer can't handle dynamical created DOM correctly"
* https://issues.apache.org/jira/browse/SANTUARIO-263
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test24Aexcl() throws Exception {
Document doc = TestUtils.newDocument();
Element local = doc.createElementNS("foo:bar", "dsig:local");
@@ -310,7 +309,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList1() throws Exception {
final String XML =
"<env:Envelope"
@@ -364,7 +363,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList2() throws Exception {
final String XML =
"<env:Envelope"
@@ -430,7 +429,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList3() throws Exception {
final String XML =
"<env:Envelope"
@@ -485,7 +484,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList4() throws Exception {
final String XML =
"<env:Envelope"
@@ -539,7 +538,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs1() throws Exception {
final String XML =
"<env:Envelope"
@@ -575,7 +574,7 @@ public class Canonicalizer20010315ExclusiveTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs2() throws Exception {
final String XML =
"<env:Envelope"
@@ -612,7 +611,7 @@ public class Canonicalizer20010315ExclusiveTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs3() throws Exception {
final String XML =
"<Envelope"
@@ -649,7 +648,7 @@ public class Canonicalizer20010315ExclusiveTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs4() throws Exception {
final String XML =
"<Envelope"
@@ -686,7 +685,7 @@ public class Canonicalizer20010315ExclusiveTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs5() throws Exception {
final String XML =
"<env:Envelope"
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315Test.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315Test.java
index 6b6a63b9..eae31bcf 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315Test.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Canonicalizer20010315Test.java
@@ -42,10 +42,11 @@ import javax.xml.xpath.XPathFactory;
import org.apache.xml.security.c14n.CanonicalizationException;
import org.apache.xml.security.c14n.Canonicalizer;
-import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.JavaUtils;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -78,7 +79,7 @@ public class Canonicalizer20010315Test {
/**
* 3.1 PIs, Comments, and Outside of Document Element
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test31withCommentsSubtree() throws Exception {
String descri =
"3.1: PIs, Comments, and Outside of Document Element. (commented)";
@@ -95,7 +96,7 @@ public class Canonicalizer20010315Test {
/**
* 3.1 PIs, Comments, and Outside of Document Element
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test31withCommentsSubset() throws Exception {
String descri =
"3.1: PIs, Comments, and Outside of Document Element. (commented)";
@@ -114,7 +115,7 @@ public class Canonicalizer20010315Test {
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-OutsideDoc">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test31subtree() throws Exception {
String descri =
"3.1: PIs, Comments, and Outside of Document Element. (uncommented)";
@@ -132,7 +133,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-OutsideDoc">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test31subset() throws Exception {
String descri =
@@ -151,7 +152,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-WhitespaceInContent">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test32subtree() throws Exception {
String descri = "3.2 Whitespace in Document Content. (uncommented)";
String fileIn = prefix + "in/32_input.xml";
@@ -168,7 +169,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-WhitespaceInContent">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test32subset() throws Exception {
String descri = "3.2 Whitespace in Document Content. (uncommented)";
String fileIn = prefix + "in/32_input.xml";
@@ -185,7 +186,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-SETags">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test33subtree() throws Exception {
String descri = "3.3 Start and End Tags. (uncommented)";
String fileIn = prefix + "in/33_input.xml";
@@ -197,7 +198,7 @@ public class Canonicalizer20010315Test {
assertTrue(c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath), descri);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test33subset() throws Exception {
String descri = "3.3 Start and End Tags. (uncommented)";
String fileIn = prefix + "in/33_input.xml";
@@ -215,7 +216,7 @@ public class Canonicalizer20010315Test {
* @see #test34validatingParser
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Chars">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test34() throws Exception {
String descri =
"3.4 Character Modifications and Character References. (uncommented)";
@@ -241,7 +242,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Chars">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test34subtree() throws Exception {
String descri =
"3.4 Character Modifications and Character References. (uncommented, patched to run on validating Parsers)";
@@ -267,7 +268,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Chars">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test34subset() throws Exception {
String descri =
@@ -286,7 +287,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Entities">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test35subtree() throws Exception{
String descri = "3.5 Entity References. (uncommented)";
String fileIn = prefix + "in/35_input.xml";
@@ -303,7 +304,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Entities">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test35subset() throws Exception {
String descri = "3.5 Entity References. (uncommented)";
String fileIn = prefix + "in/35_input.xml";
@@ -320,7 +321,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-UTF8">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test36subtree() throws Exception {
String descri = "3.6 UTF-8 Encoding. (uncommented)";
String fileIn = prefix + "in/36_input.xml";
@@ -337,7 +338,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-UTF8">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test36subset() throws Exception {
String descri = "3.6 UTF-8 Encoding. (uncommented)";
String fileIn = prefix + "in/36_input.xml";
@@ -354,7 +355,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-DocSubsets">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test37() throws Exception {
String descri = "3.7 Document Subsets. (uncommented)";
String fileIn = prefix + "in/37_input.xml";
@@ -380,7 +381,7 @@ public class Canonicalizer20010315Test {
*
* @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-DocSubsets">the example from the spec</A>
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test37byNodeList() throws Exception {
//String descri = "3.7 Document Subsets. (uncommented), c14n by NodeList";
@@ -425,7 +426,7 @@ public class Canonicalizer20010315Test {
* Implementations MUST report an operation failure on documents containing
* relative namespace URIs.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testRelativeNSbehaviour() throws Exception {
//J-
@@ -468,7 +469,7 @@ public class Canonicalizer20010315Test {
* for ISO-8859-1 encoding is RECOMMENDED, and all other character encodings
* are OPTIONAL.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testTranslationFromUTF16toUTF8() throws Exception {
String val =
"<UTF16>The german &auml (which is Unicode &#xE4;): "ä"</UTF16>";
@@ -488,7 +489,7 @@ public class Canonicalizer20010315Test {
/**
* Method testXMLAttributes1
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testXMLAttributes1() throws Exception {
//J-
String input = ""
@@ -513,7 +514,7 @@ public class Canonicalizer20010315Test {
/**
* Method testXMLAttributes2
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testXMLAttributes2() throws Exception {
//J-
String input = ""
@@ -538,7 +539,7 @@ public class Canonicalizer20010315Test {
/**
* Method testXMLAttributes3
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testXMLAttributes3() throws Exception {
//J-
String input = ""
@@ -563,8 +564,8 @@ public class Canonicalizer20010315Test {
/**
* Method testXMLAttributes4
*/
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void _testXMLAttributes4() throws Exception {
//J-
String input = ""
@@ -591,8 +592,8 @@ public class Canonicalizer20010315Test {
/**
* Method testXMLAttributes5
*/
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void _testXMLAttributes5() throws Exception {
//J-
String input = ""
@@ -619,8 +620,8 @@ public class Canonicalizer20010315Test {
/**
* Method testXMLAttributes6
*/
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void _testXMLAttributes6() throws Exception {
//J-
String input = ""
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/ExclusiveC14NInteropTest.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/ExclusiveC14NInteropTest.java
index ad3bbc8c..c9c70b49 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/ExclusiveC14NInteropTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/ExclusiveC14NInteropTest.java
@@ -29,6 +29,7 @@ import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -60,7 +61,7 @@ public class ExclusiveC14NInteropTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_Y1() throws Exception {
String success = t("src/test/resources/interop/c14n/Y1", "exc-signature.xml", true);
@@ -73,7 +74,7 @@ public class ExclusiveC14NInteropTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_Y2() throws Exception {
String success = t("src/test/resources/interop/c14n/Y2", "signature-joseph-exc.xml", false);
@@ -86,7 +87,7 @@ public class ExclusiveC14NInteropTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_Y3() throws Exception {
String success = t("src/test/resources/interop/c14n/Y3", "signature.xml", false);
@@ -99,7 +100,7 @@ public class ExclusiveC14NInteropTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_Y4() throws Exception {
String success = t("src/test/resources/interop/c14n/Y4", "signature.xml", true);
@@ -107,7 +108,7 @@ public class ExclusiveC14NInteropTest extends InteropTestBase {
assertNull(success);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xfilter2() throws Exception {
String success = t("src/test/resources/interop/xfilter2/merlin-xpath-filter2-three", "sign-spec.xml", true);
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java
index 32aaa520..7f0f90ab 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/NameSpaceSymbTableTest.java
@@ -24,6 +24,7 @@ import java.util.List;
import org.apache.xml.security.c14n.implementations.NameSpaceSymbTable;
import org.apache.xml.security.test.dom.TestUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -46,13 +47,13 @@ public class NameSpaceSymbTableTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testNullFirstXmlns() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
assertNull(ns.getMapping("xmlns"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXmlnsPut() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -60,7 +61,7 @@ public class NameSpaceSymbTableTest {
assertEquals(node1, ns.getMapping("xmlns"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXmlnsMap() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -70,7 +71,7 @@ public class NameSpaceSymbTableTest {
assertEquals(null, ns.getMapping("xmlns"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXmlnsMap2() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -81,7 +82,7 @@ public class NameSpaceSymbTableTest {
assertEquals(null, ns.getMapping("xmlns"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXmlnsPrefix() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -95,7 +96,7 @@ public class NameSpaceSymbTableTest {
assertEquals(node1, ns.getMapping("xmlns"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXmlnsRemovePrefix() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -106,7 +107,7 @@ public class NameSpaceSymbTableTest {
assertNull(ns.getMapping("xmlns"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPrefix() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -124,7 +125,7 @@ public class NameSpaceSymbTableTest {
assertEquals(node1, ns.getMapping("a"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSeveralPrefixes() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -136,7 +137,7 @@ public class NameSpaceSymbTableTest {
assertNull(ns.getMapping("a"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSeveralPrefixes2() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -147,7 +148,7 @@ public class NameSpaceSymbTableTest {
assertEquals(node1, ns.getMapping("a"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testGetUnrenderedNodes() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -161,7 +162,7 @@ public class NameSpaceSymbTableTest {
assertEquals(n, node2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testUnrederedNodes() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
@@ -191,7 +192,7 @@ public class NameSpaceSymbTableTest {
assertTrue(l.contains(node2));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testBug38655() {
NameSpaceSymbTable ns = new NameSpaceSymbTable();
ns.push();
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario191Test.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario191Test.java
index de300531..6dba8b60 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario191Test.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario191Test.java
@@ -24,10 +24,11 @@ import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
import org.apache.xml.security.c14n.implementations.Canonicalizer11_OmitComments;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -58,7 +59,7 @@ public class Santuario191Test {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSantuario191() throws Exception {
//
// Parse the Data
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario273Test.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario273Test.java
index e4ce2b32..4361a96b 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario273Test.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/Santuario273Test.java
@@ -31,6 +31,7 @@ import org.apache.xml.security.Init;
import org.apache.xml.security.c14n.Canonicalizer;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -78,7 +79,7 @@ public class Santuario273Test {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testC14n11Base() throws Exception {
Document doc = null;
try (InputStream is = new ByteArrayInputStream(input.getBytes())) {
diff --git a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/UtfHelperTest.java b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/UtfHelperTest.java
index da70162b..65c2652f 100644
--- a/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/UtfHelperTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/c14n/implementations/UtfHelperTest.java
@@ -23,12 +23,13 @@ import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
import org.apache.xml.security.c14n.implementations.UtfHelpper;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
public class UtfHelperTest {
- @org.junit.jupiter.api.Test
+ @Test
public void testBug40156() {
String s = "\u00e4\u00f6\u00fc";
byte[] a = UtfHelpper.getStringInUtf8(s);
@@ -36,7 +37,7 @@ public class UtfHelperTest {
assertArrayEquals(correct, a);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testUtf() throws Exception {
//
diff --git a/src/test/java/org/apache/xml/security/test/dom/encryption/BaltimoreEncTest.java b/src/test/java/org/apache/xml/security/test/dom/encryption/BaltimoreEncTest.java
index 6eeeb980..d44547a7 100644
--- a/src/test/java/org/apache/xml/security/test/dom/encryption/BaltimoreEncTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/encryption/BaltimoreEncTest.java
@@ -51,8 +51,8 @@ import org.apache.xml.security.keys.content.x509.XMLX509Certificate;
import org.apache.xml.security.keys.keyresolver.KeyResolver;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.EncryptionConstants;
-import org.apache.xml.security.utils.JavaUtils;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -154,7 +154,7 @@ public class BaltimoreEncTest {
*
* Check the merlin-enc-five element content test for 3DES
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_content_3des_cbc() throws Exception {
if (haveISOPadding) {
@@ -176,7 +176,7 @@ public class BaltimoreEncTest {
*
* Check the merlin-enc-five element content test for AES256
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_content_aes256_cbc() throws Exception {
if (haveISOPadding) {
@@ -199,7 +199,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element content test for AES128 with
* AES 192 key wrap
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_content_aes128_cbc_kw_aes192() throws Exception {
if (haveISOPadding && haveKeyWraps) {
File file = resolveFile(
@@ -221,7 +221,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element content test for 3DES with
* AES 128 key wrap
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_content_3des_cbc_kw_aes128() throws Exception {
if (haveISOPadding && haveKeyWraps) {
@@ -244,7 +244,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element content test for AES128 with
* RSA key wrap (PKCS 1.5 padding)
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_content_aes128_cbc_rsa_15() throws Exception {
if (haveISOPadding) {
File file = resolveFile(
@@ -266,7 +266,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element data test for AES192 with
* a CipherReference element
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_element_aes192_cbc_ref() throws Exception {
if (haveISOPadding) {
File file = resolveFile(
@@ -290,7 +290,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element data test for AES128 with no
* key wrap
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_data_aes128_cbc() throws Exception {
if (haveISOPadding) {
File file = resolveFile("src/test/resources/ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-data-aes128-cbc.xml");
@@ -310,7 +310,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element data test for AES256 with 3DES
* key wrap
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_data_aes256_cbc_3des() throws Exception {
assumeFalse(isIBMJdK);
@@ -333,7 +333,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element data test for AES192 with AES256
* key wrap
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_data_aes192_cbc_aes256() throws Exception {
if (haveISOPadding && haveKeyWraps) {
File file = resolveFile(
@@ -354,7 +354,7 @@ public class BaltimoreEncTest {
* Check the merlin-enc-five element data test for 3DES with
* RSA key wrap (OAEP and no parameters)
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_five_data_3des_cbc_rsa_oaep() throws Exception {
if (haveISOPadding) {
File file = resolveFile(
diff --git a/src/test/java/org/apache/xml/security/test/dom/encryption/EncryptContentTest.java b/src/test/java/org/apache/xml/security/test/dom/encryption/EncryptContentTest.java
index 6a16132b..da4c269a 100644
--- a/src/test/java/org/apache/xml/security/test/dom/encryption/EncryptContentTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/encryption/EncryptContentTest.java
@@ -37,6 +37,7 @@ import org.apache.xml.security.encryption.XMLCipher;
import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -71,7 +72,7 @@ public class EncryptContentTest {
" </user>\n" +
"</users>\n";
- private SecretKey secretKey;
+ private final SecretKey secretKey;
private boolean haveISOPadding;
public EncryptContentTest() throws Exception {
@@ -107,7 +108,7 @@ public class EncryptContentTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testContentRemoved() throws Exception {
if (!haveISOPadding) {
LOG.warn("Test testContentRemoved skipped as necessary algorithms not available");
@@ -159,7 +160,7 @@ public class EncryptContentTest {
* See SANTUARIO-301:
* https://issues.apache.org/jira/browse/SANTUARIO-301
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testMultipleKeyInfoElements() throws Exception {
if (!haveISOPadding) {
LOG.warn("Test testMultipleKeyInfoElements skipped as necessary algorithms not available");
diff --git a/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java b/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java
index a2c46a16..5653008c 100644
--- a/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/encryption/ReferenceListTest.java
@@ -26,6 +26,7 @@ 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.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -44,7 +45,7 @@ public class ReferenceListTest {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testReferenceList() throws Exception {
Document doc = TestUtils.newDocument();
diff --git a/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java b/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java
index 57d50923..751011dc 100644
--- a/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/encryption/XMLCipherTest.java
@@ -27,8 +27,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.security.Key;
-import java.security.KeyPairGenerator;
import java.security.KeyPair;
+import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
@@ -43,20 +43,21 @@ import javax.crypto.spec.SecretKeySpec;
import org.apache.xml.security.algorithms.JCEMapper;
import org.apache.xml.security.c14n.Canonicalizer;
-import org.apache.xml.security.encryption.EncryptionProperties;
-import org.apache.xml.security.encryption.EncryptionProperty;
-import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.encryption.CipherData;
import org.apache.xml.security.encryption.EncryptedData;
import org.apache.xml.security.encryption.EncryptedKey;
import org.apache.xml.security.encryption.EncryptionMethod;
-import org.apache.xml.security.encryption.CipherData;
+import org.apache.xml.security.encryption.EncryptionProperties;
+import org.apache.xml.security.encryption.EncryptionProperty;
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.parser.XMLParserException;
+import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.transforms.params.XPathContainer;
import org.apache.xml.security.utils.EncryptionConstants;
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.junit.jupiter.api.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -81,17 +82,17 @@ public class XMLCipherTest {
org.apache.xml.security.Init.init();
}
- private String documentName;
- private String elementName;
- private String elementIndex;
+ private final String documentName;
+ private final String elementName;
+ private final String elementIndex;
private XMLCipher cipher;
- private String basedir;
+ private final String basedir;
private boolean haveISOPadding;
- private boolean haveKeyWraps;
- private String tstBase64EncodedString;
+ private final boolean haveKeyWraps;
+ private final String tstBase64EncodedString;
private boolean bcInstalled;
- private boolean isIBMJdK = System.getProperty("java.vendor").contains("IBM");
+ private final boolean isIBMJdK = System.getProperty("java.vendor").contains("IBM");
public XMLCipherTest() throws Exception {
basedir = System.getProperty("basedir",".");
@@ -130,7 +131,7 @@ public class XMLCipherTest {
* Test encryption using a generated AES 128 bit key that is
* encrypted using a AES 192 bit key. Then reverse using the KEK
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testAES128ElementAES192KWCipherUsingKEK() throws Exception {
Document d = document(); // source
@@ -197,7 +198,7 @@ public class XMLCipherTest {
* Test encryption using a generated AES 256 bit key that is
* encrypted using an RSA key. Reverse using KEK
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testAES256ElementRSAKWCipherUsingKEK() throws Exception {
Document d = document(); // source
@@ -271,7 +272,7 @@ public class XMLCipherTest {
* encrypted using a 3DES key. Then reverse by decrypting
* EncryptedKey by hand
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testAES192Element3DESKWCipher() throws Exception {
assumeFalse(isIBMJdK);
@@ -355,7 +356,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testTripleDesElementCipher() throws Exception {
Document d = document(); // source
Document ed = null; // target
@@ -398,7 +399,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAes128ElementCipher() throws Exception {
byte[] bits128 = {
(byte) 0x10, (byte) 0x11, (byte) 0x12, (byte) 0x13,
@@ -442,7 +443,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAes192ElementCipher() throws Exception {
byte[] bits192 = {
(byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B,
@@ -486,7 +487,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAes265ElementCipher() throws Exception {
byte[] bits256 = {
(byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03,
@@ -536,7 +537,7 @@ public class XMLCipherTest {
* Test case for when the entire document is encrypted and decrypted
* In this case the EncryptedData becomes the root element of the document
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testTripleDesDocumentCipher() throws Exception {
Document d = document(); // source
Document ed = null; // target
@@ -577,7 +578,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEncryptionProperties() throws Exception {
Document d = document(); // source
Document ed = null; // target
@@ -638,7 +639,7 @@ public class XMLCipherTest {
/*
* Test a Cipher Reference
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testSameDocumentCipherReference() throws Exception {
if (haveISOPadding) {
@@ -709,7 +710,7 @@ public class XMLCipherTest {
/*
* Test physical representation of decrypted element, see SANTUARIO-309
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testPhysicalRepresentation() throws Exception {
if (haveISOPadding) {
@@ -812,7 +813,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSerializedData() throws Exception {
if (!haveISOPadding) {
LOG.warn("Test testSerializedData skipped as necessary algorithms not available");
@@ -862,7 +863,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEncryptedKeyWithRecipient() throws Exception {
String filename =
"src/test/resources/org/apache/xml/security/encryption/encryptedKey.xml";
@@ -887,7 +888,7 @@ public class XMLCipherTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEecryptToByteArray() throws Exception {
Assumptions.assumeTrue(bcInstalled);
@@ -910,7 +911,7 @@ public class XMLCipherTest {
xmlCipher.decryptToByteArray(encryptedData);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testMultipleKEKs() throws Exception {
Document d = document(); // source
diff --git a/src/test/java/org/apache/xml/security/test/dom/encryption/XMLEncryption11Test.java b/src/test/java/org/apache/xml/security/test/dom/encryption/XMLEncryption11Test.java
index 5f310ada..27fba2ef 100644
--- a/src/test/java/org/apache/xml/security/test/dom/encryption/XMLEncryption11Test.java
+++ b/src/test/java/org/apache/xml/security/test/dom/encryption/XMLEncryption11Test.java
@@ -48,6 +48,7 @@ import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.EncryptionConstants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -115,7 +116,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA2048() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-2048_SHA256WithRSA.jks");
@@ -145,7 +146,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA2048EncryptDecrypt() throws Exception {
assumeFalse(isIBMJdK);
@@ -202,7 +203,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA2048EncryptDecryptWithSecureRandom() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-2048_SHA256WithRSA.jks");
@@ -256,7 +257,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-3072_SHA256WithRSA.jks");
@@ -285,7 +286,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072EncryptDecrypt() throws Exception {
assumeFalse(isIBMJdK);
@@ -341,7 +342,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA384, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072OAEP() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-3072_SHA256WithRSA.jks");
@@ -371,7 +372,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA384, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072OAEPEncryptDecrypt() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-3072_SHA256WithRSA.jks");
@@ -424,7 +425,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA512, MGF:SHA1, PSource: Specified 8 bytes
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA4096() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-4096_SHA256WithRSA.jks");
@@ -454,7 +455,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA512, MGF:SHA1, PSource: Specified 8 bytes
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA4096EncryptDecrypt() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-4096_SHA256WithRSA.jks");
@@ -504,7 +505,7 @@ public class XMLEncryption11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA4096EncryptDecryptSHA224() throws Exception {
if (haveISOPadding) {
File keystore = resolveFile("src/test/resources/org/w3c/www/interop/xmlenc-core-11/RSA-4096_SHA256WithRSA.jks");
diff --git a/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreTest.java b/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreTest.java
index bd19318f..45065da8 100644
--- a/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreTest.java
@@ -18,17 +18,16 @@
*/
package org.apache.xml.security.test.dom.interop;
-import org.apache.xml.security.signature.MissingResourceFailureException;
-import org.apache.xml.security.test.dom.utils.resolver.OfflineResolver;
-import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
-
-import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
-
import java.io.File;
import java.nio.charset.StandardCharsets;
+import org.apache.xml.security.signature.MissingResourceFailureException;
import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.test.dom.utils.resolver.OfflineResolver;
+import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.junit.jupiter.api.Test;
+import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
@@ -70,7 +69,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_enveloping_hmac_sha1() throws Exception {
File filename = new File(merlinsDir15, "signature-enveloping-hmac-sha1.xml");
@@ -89,7 +88,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_enveloping_hmac_sha1_40() throws Exception {
File filename = new File(merlinsDir15, "signature-enveloping-hmac-sha1-40.xml");
@@ -115,7 +114,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_enveloped_dsa() throws Exception {
File filename = new File(merlinsDir15, "signature-enveloped-dsa.xml");
@@ -142,7 +141,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_enveloping_b64_dsa() throws Exception {
File filename = new File(merlinsDir15, "signature-enveloping-b64-dsa.xml");
@@ -169,7 +168,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_enveloping_dsa() throws Exception {
File filename = new File(merlinsDir15, "signature-enveloping-dsa.xml");
@@ -196,7 +195,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_enveloping_rsa() throws Exception {
File filename = new File(merlinsDir15, "signature-enveloping-rsa.xml");
@@ -223,7 +222,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_external_b64_dsa() throws Exception {
File filename = new File(merlinsDir15, "signature-external-b64-dsa.xml");
@@ -250,7 +249,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_fifteen_external_dsa() throws Exception {
File filename = new File(merlinsDir15, "signature-external-dsa.xml");
@@ -276,7 +275,7 @@ public class BaltimoreTest extends InteropTestBase {
* Method test_sixteen_bad_signature. This should fail due to lack of support for the here() function
* as we don't have Xalan installed.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_sixteen_bad_signature() throws Exception {
File filename = new File(merlinsDir16, "bad-signature.xml");
@@ -296,7 +295,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_enveloping_hmac_sha1() throws Exception {
File filename = new File(merlinsDir23, "signature-enveloping-hmac-sha1.xml");
@@ -315,7 +314,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_enveloping_hmac_sha1_40() throws Exception {
File filename = new File(merlinsDir23, "signature-enveloping-hmac-sha1-40.xml");
@@ -341,7 +340,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_enveloped_dsa() throws Exception {
File filename = new File(merlinsDir23, "signature-enveloped-dsa.xml");
@@ -368,7 +367,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_enveloping_b64_dsa() throws Exception {
File filename = new File(merlinsDir23, "signature-enveloping-b64-dsa.xml");
@@ -395,7 +394,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_enveloping_dsa() throws Exception {
File filename = new File(merlinsDir23, "signature-enveloping-dsa.xml");
@@ -422,7 +421,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_enveloping_rsa() throws Exception {
File filename = new File(merlinsDir23, "signature-enveloping-rsa.xml");
@@ -449,7 +448,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_external_b64_dsa() throws Exception {
File filename = new File(merlinsDir23, "signature-external-b64-dsa.xml");
@@ -476,7 +475,7 @@ public class BaltimoreTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_external_dsa() throws Exception {
File filename = new File(merlinsDir23, "signature-external-dsa.xml");
diff --git a/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreXalanTest.java b/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreXalanTest.java
index 78d611d1..7293094b 100644
--- a/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreXalanTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/interop/BaltimoreXalanTest.java
@@ -24,6 +24,7 @@ import org.apache.xml.security.test.dom.utils.resolver.OfflineResolver;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -67,7 +68,7 @@ public class BaltimoreXalanTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_sixteen_external_dsa() throws Exception {
File file = new File(merlinsDir16, "signature.xml");
@@ -97,7 +98,7 @@ public class BaltimoreXalanTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_sixteen_bad_signature() throws Exception {
File filename = new File(merlinsDir16 + "/bad-signature.xml");
@@ -125,7 +126,7 @@ public class BaltimoreXalanTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_twenty_three_external_dsa_2() throws Exception {
File filename = new File(merlinsDir23, "signature.xml");
diff --git a/src/test/java/org/apache/xml/security/test/dom/interop/IAIKTest.java b/src/test/java/org/apache/xml/security/test/dom/interop/IAIKTest.java
index f5d43d45..61eaaabd 100644
--- a/src/test/java/org/apache/xml/security/test/dom/interop/IAIKTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/interop/IAIKTest.java
@@ -28,6 +28,7 @@ import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
import org.apache.xml.security.utils.resolver.implementations.ResolverAnonymous;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolvePath;
@@ -61,7 +62,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_signatureAlgorithms_signatures_hMACShortSignature()
throws Exception {
@@ -88,7 +89,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_signatureAlgorithms_signatures_hMACSignature()
throws Exception {
@@ -118,7 +119,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_coreFeatures_signatures_manifestSignature_core()
throws Exception {
@@ -147,7 +148,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_coreFeatures_signatures_manifestSignature_manifest()
throws Exception {
@@ -176,7 +177,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_coreFeatures_signatures_signatureTypesSignature()
throws Exception {
@@ -205,7 +206,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_coreFeatures_signatures_anonymousReferenceSignature()
throws Exception {
@@ -236,7 +237,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_signatureAlgorithms_signatures_dSASignature()
throws Exception {
@@ -265,7 +266,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_signatureAlgorithms_signatures_rSASignature()
throws Exception {
@@ -294,7 +295,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_transforms_signatures_base64DecodeSignature()
throws Exception {
@@ -323,7 +324,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_transforms_signatures_c14nSignature() throws Exception {
File filename = resolveFile(gregorsDir, "transforms", "signatures", "c14nSignature.xml");
@@ -351,7 +352,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_transforms_signatures_envelopedSignatureSignature()
throws Exception {
@@ -380,7 +381,7 @@ public class IAIKTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_transforms_signatures_xPathSignature() throws Exception {
File filename = resolveFile(gregorsDir, "transforms", "signatures", "xPathSignature.xml");
diff --git a/src/test/java/org/apache/xml/security/test/dom/interop/IBMTest.java b/src/test/java/org/apache/xml/security/test/dom/interop/IBMTest.java
index d996fe63..4d2e8cb1 100644
--- a/src/test/java/org/apache/xml/security/test/dom/interop/IBMTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/interop/IBMTest.java
@@ -24,6 +24,8 @@ import java.nio.file.Files;
import org.apache.xml.security.test.dom.utils.resolver.OfflineResolver;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -79,7 +81,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_hmac() throws Exception {
if (!runTests) {
return;
@@ -109,7 +111,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_detached_dsa() throws Exception {
if (!runTests) {
return;
@@ -138,7 +140,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_detached_rsa() throws Exception {
if (!runTests) {
return;
@@ -167,7 +169,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloped_dsa() throws Exception {
if (!runTests) {
return;
@@ -196,7 +198,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloped_rsa() throws Exception {
if (!runTests) {
return;
@@ -225,7 +227,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_dsa() throws Exception {
if (!runTests) {
return;
@@ -254,7 +256,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_rsa() throws Exception {
if (!runTests) {
return;
@@ -283,7 +285,7 @@ public class IBMTest extends InteropTestBase {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_dsa_soaped_broken() throws Exception {
if (!runTests) {
return;
@@ -317,7 +319,7 @@ public class IBMTest extends InteropTestBase {
* @throws Exception
* $todo$ implement exclusive-c14n
*/
- @org.junit.jupiter.api.Disabled
+ @Disabled
public void _not_active_test_enveloping_exclusive() throws Exception {
// exclusive c14n not supported yet
}
@@ -328,7 +330,7 @@ public class IBMTest extends InteropTestBase {
* @throws Exception
* $todo$ implement exclusive-c14n
*/
- @org.junit.jupiter.api.Disabled
+ @Disabled
public void _not_active_test_enveloping_exclusive_soaped() throws Exception {
// exclusive c14n not supported yet
}
diff --git a/src/test/java/org/apache/xml/security/test/dom/interop/RSASecurityTest.java b/src/test/java/org/apache/xml/security/test/dom/interop/RSASecurityTest.java
index 6e5cc5de..e3aff54e 100644
--- a/src/test/java/org/apache/xml/security/test/dom/interop/RSASecurityTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/interop/RSASecurityTest.java
@@ -24,6 +24,7 @@ import java.io.File;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -48,7 +49,7 @@ public class RSASecurityTest extends InteropTestBase {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping() throws Exception {
File filename = new File(blakesDir, "certj201_enveloping.xml");
@@ -63,7 +64,7 @@ public class RSASecurityTest extends InteropTestBase {
assertTrue(verify, filename.toString());
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloped() throws Exception {
File filename = new File(blakesDir, "certj201_enveloped.xml");
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java
index f73d880e..bd910044 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/DEREncodedKeyValueTest.java
@@ -31,6 +31,7 @@ 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;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -57,7 +58,7 @@ public class DEREncodedKeyValueTest {
ecKeyControl = loadPublicKey("ec.key", "EC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSchema() throws Exception {
DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), rsaKeyControl);
Element element = derEncodedKeyValue.getElement();
@@ -66,7 +67,7 @@ public class DEREncodedKeyValueTest {
assertEquals("DEREncodedKeyValue", element.getLocalName());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAPublicKeyFromElement() throws Exception {
Document doc = loadXML("DEREncodedKeyValue-RSA.xml");
NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpec11NS, Constants._TAG_DERENCODEDKEYVALUE);
@@ -78,7 +79,7 @@ public class DEREncodedKeyValueTest {
assertEquals(ID_CONTROL, derEncodedKeyValue.getId());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDSAPublicKeyFromElement() throws Exception {
Document doc = loadXML("DEREncodedKeyValue-DSA.xml");
NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpec11NS, Constants._TAG_DERENCODEDKEYVALUE);
@@ -90,7 +91,7 @@ public class DEREncodedKeyValueTest {
assertEquals(ID_CONTROL, derEncodedKeyValue.getId());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECPublicKeyFromElement() throws Exception {
Document doc = loadXML("DEREncodedKeyValue-EC.xml");
NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpec11NS, Constants._TAG_DERENCODEDKEYVALUE);
@@ -102,28 +103,28 @@ public class DEREncodedKeyValueTest {
assertEquals(ID_CONTROL, derEncodedKeyValue.getId());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAPublicKeyFromKey() throws Exception {
DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), rsaKeyControl);
assertEquals(rsaKeyControl, derEncodedKeyValue.getPublicKey());
assertArrayEquals(rsaKeyControl.getEncoded(), derEncodedKeyValue.getBytesFromTextChild());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDSAPublicKeyFromKey() throws Exception {
DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), dsaKeyControl);
assertEquals(dsaKeyControl, derEncodedKeyValue.getPublicKey());
assertArrayEquals(dsaKeyControl.getEncoded(), derEncodedKeyValue.getBytesFromTextChild());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECPublicKeyFromKey() throws Exception {
DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), ecKeyControl);
assertEquals(ecKeyControl, derEncodedKeyValue.getPublicKey());
assertArrayEquals(ecKeyControl.getEncoded(), derEncodedKeyValue.getBytesFromTextChild());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testId() throws Exception {
DEREncodedKeyValue derEncodedKeyValue = new DEREncodedKeyValue(TestUtils.newDocument(), rsaKeyControl);
assertEquals("", derEncodedKeyValue.getId());
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java
index 75b82c74..46a59233 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/KeyInfoReferenceTest.java
@@ -19,13 +19,14 @@
package org.apache.xml.security.test.dom.keys;
import java.io.File;
-import java.io.FileInputStream;
+import java.nio.file.FileSystems;
import org.apache.xml.security.keys.content.KeyInfoReference;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -37,12 +38,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class KeyInfoReferenceTest {
- private static final String SEP = System.getProperty("file.separator");
+ private static final String SEP = FileSystems.getDefault().getSeparator();
private static final String ID_CONTROL = "abc123";
private static final String URI_CONTROL = "http://www.example.org/keyinfo.xml";
- @org.junit.jupiter.api.Test
+ @Test
public void testSchema() throws Exception {
KeyInfoReference keyInfoReference = new KeyInfoReference(TestUtils.newDocument(), URI_CONTROL);
Element element = keyInfoReference.getElement();
@@ -51,7 +52,7 @@ public class KeyInfoReferenceTest {
assertEquals("KeyInfoReference", element.getLocalName());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testURIFromElement() throws Exception {
Document doc = loadXML("KeyInfoReference.xml");
NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpec11NS, Constants._TAG_KEYINFOREFERENCE);
@@ -62,13 +63,13 @@ public class KeyInfoReferenceTest {
assertEquals(ID_CONTROL, keyInfoReference.getId());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testURIOnConstruction() throws Exception {
KeyInfoReference keyInfoReference = new KeyInfoReference(TestUtils.newDocument(), URI_CONTROL);
assertEquals(URI_CONTROL, keyInfoReference.getURI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testId() throws Exception {
KeyInfoReference keyInfoReference = new KeyInfoReference(TestUtils.newDocument(), URI_CONTROL);
assertEquals("", keyInfoReference.getId());
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509CertificateTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509CertificateTest.java
index 5ac3bce6..2b0cea4b 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509CertificateTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509CertificateTest.java
@@ -27,6 +27,7 @@ import org.apache.xml.security.keys.content.x509.XMLX509Certificate;
import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -39,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
public class XMLX509CertificateTest {
- @org.junit.jupiter.api.Test
+ @Test
public void testGetX509Certificate() throws Exception {
File f = resolveFile("src", "test", "resources", "ie", "baltimore", "merlin-examples",
"merlin-xmldsig-twenty-three", "signature-x509-crt.xml");
@@ -50,7 +51,7 @@ public class XMLX509CertificateTest {
// System.out.println(cert);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEqualsAndHashCode() throws Exception {
File f = resolveFile("src/test/resources/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/lugh.crt");
X509Certificate cert;
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java
index 04d2952e..986dfb3e 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509DigestTest.java
@@ -29,6 +29,7 @@ import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -39,8 +40,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class XMLX509DigestTest {
- private static final String SEP = System.getProperty("file.separator");
-
private static final String ALG_URI_CONTROL = "http://www.w3.org/2001/04/xmlenc#sha256";
private static final String DIGEST_B64_CONTROL = "jToLQ/K7aaLHy/aXLFnjEfCwSQd9z0MrBOH6Ru/aJyY=";
@@ -57,7 +56,7 @@ public class XMLX509DigestTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSchema() throws Exception {
XMLX509Digest x509Digest = new XMLX509Digest(TestUtils.newDocument(), digestControl, ALG_URI_CONTROL);
Element element = x509Digest.getElement();
@@ -66,7 +65,7 @@ public class XMLX509DigestTest {
assertEquals("X509Digest", element.getLocalName());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDigestFromElement() throws Exception {
Document doc = loadXML("X509Digest.xml");
NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpec11NS, Constants._TAG_X509DIGEST);
@@ -77,21 +76,21 @@ public class XMLX509DigestTest {
assertArrayEquals(digestControl, x509Digest.getDigestBytes());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDigestOnConstructionWithCert() throws Exception {
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
+ @Test
public void testDigestOnConstructionWithBytes() throws Exception {
XMLX509Digest x509Digest = new XMLX509Digest(TestUtils.newDocument(), digestControl, ALG_URI_CONTROL);
assertEquals(ALG_URI_CONTROL, x509Digest.getAlgorithm());
assertArrayEquals(digestControl, x509Digest.getDigestBytes());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testGetDigestBytesFromCert() throws Exception {
assertArrayEquals(digestControl, XMLX509Digest.getDigestBytesFromCert(certControl, ALG_URI_CONTROL));
}
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java
index 36563fb1..488492cb 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509IssuerSerialTest.java
@@ -21,6 +21,7 @@ package org.apache.xml.security.test.dom.keys.content.x509;
import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial;
import org.apache.xml.security.test.dom.TestUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -31,13 +32,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
public class XMLX509IssuerSerialTest {
- private Document doc;
+ private final Document doc;
public XMLX509IssuerSerialTest() throws Exception {
doc = TestUtils.newDocument();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testGetIssuerName() throws Exception {
// Make sure hex encoded value is not escaped (see ...)
String issuer = "9.99.999=#abc123";
@@ -51,7 +52,7 @@ public class XMLX509IssuerSerialTest {
// System.out.println(is.getIssuerName());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEqualsHashcode() throws Exception {
XMLX509IssuerSerial is1 = new XMLX509IssuerSerial(doc, "1234", 0);
assertEquals("1234", is1.getIssuerName());
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SKITest.java b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SKITest.java
index 0fbe5708..be2f7cff 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SKITest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SKITest.java
@@ -31,6 +31,7 @@ import java.util.Collections;
import org.apache.xml.security.keys.content.x509.XMLX509SKI;
import org.apache.xml.security.test.dom.TestUtils;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -42,14 +43,13 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
*/
public class XMLX509SKITest {
- private static final String SEP = System.getProperty("file.separator");
private final CertificateFactory cf;
public XMLX509SKITest() throws Exception {
cf = CertificateFactory.getInstance("X.509");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testGetSKIBytesFromCert() throws Exception {
File f = resolveFile("src/test/resources/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/lugh.crt");
X509Certificate cert;
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SubjectNameTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SubjectNameTest.java
index 740afc1a..469e0196 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SubjectNameTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/content/x509/XMLX509SubjectNameTest.java
@@ -25,6 +25,7 @@ import java.security.cert.X509Certificate;
import org.apache.xml.security.keys.content.x509.XMLX509SubjectName;
import org.apache.xml.security.test.dom.TestUtils;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -36,9 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
*/
public class XMLX509SubjectNameTest {
- private static final String SEP = System.getProperty("file.separator");
-
- @org.junit.jupiter.api.Test
+ @Test
public void testEqualsAndHashCode() throws Exception {
File f = resolveFile("src/test/resources/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/certs/lugh.crt");
X509Certificate cert;
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/DEREncodedKeyValueResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/DEREncodedKeyValueResolverTest.java
index 06bca461..9231ac92 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/DEREncodedKeyValueResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/DEREncodedKeyValueResolverTest.java
@@ -20,11 +20,11 @@ package org.apache.xml.security.test.dom.keys.keyresolver;
import java.security.PublicKey;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
import org.apache.xml.security.Init;
import org.apache.xml.security.keys.KeyInfo;
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import static org.apache.xml.security.test.stax.utils.KeyLoader.loadPublicKey;
import static org.apache.xml.security.test.stax.utils.KeyLoader.loadXML;
@@ -32,9 +32,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class DEREncodedKeyValueResolverTest {
- private PublicKey rsaKeyControl;
- private PublicKey dsaKeyControl;
- private PublicKey ecKeyControl;
+ private final PublicKey rsaKeyControl;
+ private final PublicKey dsaKeyControl;
+ private final PublicKey ecKeyControl;
public DEREncodedKeyValueResolverTest() throws Exception {
@@ -47,7 +47,7 @@ public class DEREncodedKeyValueResolverTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAPublicKey() throws Exception {
Document doc = loadXML("DEREncodedKeyValue-RSA.xml");
Element element = doc.getDocumentElement();
@@ -56,7 +56,7 @@ public class DEREncodedKeyValueResolverTest {
assertEquals(rsaKeyControl, keyInfo.getPublicKey());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDSAPublicKey() throws Exception {
Document doc = loadXML("DEREncodedKeyValue-DSA.xml");
Element element = doc.getDocumentElement();
@@ -65,7 +65,7 @@ public class DEREncodedKeyValueResolverTest {
assertEquals(dsaKeyControl, keyInfo.getPublicKey());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECPublicKey() throws Exception {
Document doc = loadXML("DEREncodedKeyValue-EC.xml");
Element element = doc.getDocumentElement();
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyInfoReferenceResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyInfoReferenceResolverTest.java
index 1ee696a6..6e496f01 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyInfoReferenceResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyInfoReferenceResolverTest.java
@@ -34,6 +34,7 @@ import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.JavaUtils;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -51,7 +52,7 @@ public class KeyInfoReferenceResolverTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSAPublicKey() throws Exception {
PublicKey rsaKeyControl = loadPublicKey("rsa-KeyInfoReference.key", "RSA");
@@ -65,7 +66,7 @@ public class KeyInfoReferenceResolverTest {
assertEquals(rsaKeyControl, keyInfo.getPublicKey());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testX509Certificate() throws Exception {
X509Certificate certControl = loadCertificate("cert-KeyInfoReference.crt");
@@ -80,7 +81,7 @@ public class KeyInfoReferenceResolverTest {
assertEquals(certControl.getPublicKey(), keyInfo.getPublicKey());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testWrongReferentType() throws Exception {
Document doc = loadXML("KeyInfoReference-WrongReferentType.xml");
markKeyInfoIdAttrs(doc);
@@ -99,7 +100,7 @@ public class KeyInfoReferenceResolverTest {
assertNull(keyInfo.getPublicKey());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSameDocumentReferenceChain() throws Exception {
Document doc = loadXML("KeyInfoReference-ReferenceChain.xml");
markKeyInfoIdAttrs(doc);
@@ -112,7 +113,7 @@ public class KeyInfoReferenceResolverTest {
assertNull(keyInfo.getPublicKey());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSameDocumentReferenceChainWithSecureValidation() throws Exception {
Document doc = loadXML("KeyInfoReference-ReferenceChain.xml");
markKeyInfoIdAttrs(doc);
@@ -126,7 +127,7 @@ public class KeyInfoReferenceResolverTest {
assertNull(keyInfo.getPublicKey());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyInfoReferenceToRetrievalMethodNotAllowed() throws Exception {
Document doc = loadXML("KeyInfoReference-RSA-RetrievalMethod.xml");
markKeyInfoIdAttrs(doc);
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java
index 9d4adca5..13a34165 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/KeyResolverTest.java
@@ -57,6 +57,7 @@ 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.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
@@ -71,8 +72,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
*/
public class KeyResolverTest {
- private static final String SEP = System.getProperty("file.separator");
-
public KeyResolverTest() {
org.apache.xml.security.Init.init();
}
@@ -80,7 +79,7 @@ public class KeyResolverTest {
/**
* Test key resolvers through a KeyInfo.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyResolvers() throws Exception {
//
@@ -190,7 +189,7 @@ public class KeyResolverTest {
* Decrypt the data by resolving the Key Encryption Key.
* This test verifies if a KeyResolver can return a PrivateKey.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testResolvePrivateKey() throws Exception {
// See if AES-128 is available...
String algorithmId =
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/RetrievalMethodResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/RetrievalMethodResolverTest.java
index 64c85992..b00007bd 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/RetrievalMethodResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/RetrievalMethodResolverTest.java
@@ -23,6 +23,7 @@ import java.security.Security;
import org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI;
import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
@@ -38,7 +39,7 @@ public class RetrievalMethodResolverTest {
Security.insertProviderAt(new XMLDSigRI(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testReferenceToSameRetrievalMethod() throws Exception {
String filename = "src/test/resources/org/apache/xml/security/keyresolver/retrievalmethod1.xml";
Document doc = XMLUtils.read(resolveFile(filename), false);
@@ -49,7 +50,7 @@ public class RetrievalMethodResolverTest {
keyInfo.getX509Certificate();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testLoopBetweenRetrievalMethods() throws Exception {
String filename = "src/test/resources/org/apache/xml/security/keyresolver/retrievalmethod2.xml";
Document doc = XMLUtils.read(resolveFile(filename), false);
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/X509DigestResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/X509DigestResolverTest.java
index 49804664..e5811ca9 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/X509DigestResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/keyresolver/X509DigestResolverTest.java
@@ -29,6 +29,7 @@ import org.apache.xml.security.keys.storage.StorageResolver;
import org.apache.xml.security.keys.storage.implementations.SingleCertificateResolver;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -38,8 +39,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
public class X509DigestResolverTest {
- private static final String SEP = System.getProperty("file.separator");
-
private final X509Certificate certControl;
private final StorageResolver storageResolver;
@@ -54,7 +53,7 @@ public class X509DigestResolverTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDigest() throws Exception {
Document doc = loadXML("X509Digest.xml");
Element element = doc.getDocumentElement();
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/storage/KeyStoreResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/storage/KeyStoreResolverTest.java
index 51f8ad10..5fd78bd5 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/storage/KeyStoreResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/storage/KeyStoreResolverTest.java
@@ -26,6 +26,7 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.xml.security.keys.storage.implementations.KeyStoreResolver;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class KeyStoreResolverTest {
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyStoreResolver() throws Exception {
//
diff --git a/src/test/java/org/apache/xml/security/test/dom/keys/storage/StorageResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/keys/storage/StorageResolverTest.java
index e3ef8652..e90b56ec 100644
--- a/src/test/java/org/apache/xml/security/test/dom/keys/storage/StorageResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/keys/storage/StorageResolverTest.java
@@ -27,6 +27,7 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.xml.security.keys.storage.StorageResolver;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -39,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class StorageResolverTest {
- @org.junit.jupiter.api.Test
+ @Test
public void testStorageResolver() throws Exception {
//
diff --git a/src/test/java/org/apache/xml/security/test/dom/parser/XMLParserTest.java b/src/test/java/org/apache/xml/security/test/dom/parser/XMLParserTest.java
index 28379640..70029631 100644
--- a/src/test/java/org/apache/xml/security/test/dom/parser/XMLParserTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/parser/XMLParserTest.java
@@ -38,6 +38,7 @@ import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -54,7 +55,7 @@ public class XMLParserTest {
static org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(XMLParserTest.class);
- private KeyPair rsaKeyPair;
+ private final KeyPair rsaKeyPair;
@BeforeAll
public static void setup() {
@@ -71,7 +72,7 @@ public class XMLParserTest {
rsaKeyPair = KeyPairGenerator.getInstance("RSA").genKeyPair();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA1() throws Exception {
assertFalse(CustomXMLParserImpl.isCalled());
diff --git a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenAlgorithmTest.java
index 627b978c..ef901afb 100644
--- a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenAlgorithmTest.java
@@ -26,6 +26,7 @@ import org.apache.xml.security.signature.XMLSignatureException;
import org.apache.xml.security.test.dom.interop.InteropTestBase;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
@@ -46,7 +47,7 @@ public class ForbiddenAlgorithmTest extends InteropTestBase {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testMD5Digest() throws Exception {
boolean success = readAndVerifySignature("signature-joseph-exc.xml", false);
diff --git a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java
index f5879f3c..d9c96822 100644
--- a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRefCountTest.java
@@ -34,6 +34,7 @@ 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.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -50,7 +51,7 @@ public class ForbiddenRefCountTest extends InteropTestBase {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testReferenceCount() throws Exception {
Document doc = getOriginalDocument();
signDocument(doc, 31);
diff --git a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenReferenceTest.java b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenReferenceTest.java
index 7e976948..ac05b243 100644
--- a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenReferenceTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenReferenceTest.java
@@ -28,6 +28,7 @@ import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
@@ -44,7 +45,7 @@ public class ForbiddenReferenceTest extends InteropTestBase {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testLocalFilesystem() throws Exception {
try {
readAndVerifyManifest("signature.xml");
diff --git a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRetrievalMethodTest.java b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRetrievalMethodTest.java
index 344bd51d..c4d777a0 100644
--- a/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRetrievalMethodTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/secure_val/ForbiddenRetrievalMethodTest.java
@@ -24,6 +24,7 @@ import java.io.File;
import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -39,7 +40,7 @@ public class ForbiddenRetrievalMethodTest {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testMultipleRetrievalMethods() throws Exception {
String filename = "src/test/resources/org/apache/xml/security/keyresolver/retrievalmethod3.xml";
File fis = XmlSecTestEnvironment.resolveFile(filename);
diff --git a/src/test/java/org/apache/xml/security/test/dom/secure_val/WrappingAttackTest.java b/src/test/java/org/apache/xml/security/test/dom/secure_val/WrappingAttackTest.java
index 0918bbb3..c057311c 100644
--- a/src/test/java/org/apache/xml/security/test/dom/secure_val/WrappingAttackTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/secure_val/WrappingAttackTest.java
@@ -26,6 +26,7 @@ import org.apache.xml.security.signature.XMLSignatureException;
import org.apache.xml.security.test.dom.interop.InteropTestBase;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
@@ -43,7 +44,7 @@ public class WrappingAttackTest extends InteropTestBase {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testWrappingAttack() throws Exception {
boolean success = readAndVerifySignature("manifestSignatureWrapping.xml");
assertTrue(success);
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java
index c004e7a6..14d158b4 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java
@@ -52,6 +52,7 @@ import org.apache.xml.security.transforms.params.XPathContainer;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.ElementProxy;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -78,7 +79,7 @@ public class CreateSignatureTest {
* Test for bug 36044 - Canonicalizing an empty node-set throws an
* ArrayIndexOutOfBoundsException.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testEmptyNodeSet() throws Exception {
Document doc = TestUtils.newDocument();
Element envelope = doc.createElementNS("http://www.usps.gov/", "Envelope");
@@ -122,18 +123,18 @@ public class CreateSignatureTest {
sig.sign(privateKey);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testOne() throws Exception {
doVerify(doSign());
doVerify(doSign());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testTwo() throws Exception {
doSignWithCert();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testWithNSPrefixDisabled() throws Exception {
String prefix = ElementProxy.getDefaultPrefix(Constants.SignatureSpecNS);
try {
@@ -146,7 +147,7 @@ public class CreateSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXPathSignature() throws Exception {
Document doc = TestUtils.newDocument();
doc.appendChild(doc.createComment(" Comment before "));
@@ -199,7 +200,7 @@ public class CreateSignatureTest {
assertTrue(signature.checkSignatureValue(kp.getPublic()));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCanonicalizedOctetStream() throws Exception {
String signedXML = doSign();
@@ -241,7 +242,7 @@ public class CreateSignatureTest {
assertTrue(si.verify(false));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA256Digest() throws Exception {
PrivateKey privateKey = kp.getPrivate();
Document doc = TestUtils.newDocument();
@@ -280,7 +281,7 @@ public class CreateSignatureTest {
doVerify(signedContent);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureProperties() throws Exception {
PrivateKey privateKey = kp.getPrivate();
Document doc = TestUtils.newDocument();
@@ -329,7 +330,7 @@ public class CreateSignatureTest {
doVerify(signedContent, 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAddDuplicateKeyInfo() throws Exception {
PrivateKey privateKey = kp.getPrivate();
Document doc = TestUtils.newDocument();
@@ -376,7 +377,7 @@ public class CreateSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testWrongSignatureName() throws Exception {
PrivateKey privateKey = kp.getPrivate();
Document doc = TestUtils.newDocument();
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureXalanTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureXalanTest.java
index 2e598c0c..5668ddaa 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureXalanTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureXalanTest.java
@@ -38,6 +38,7 @@ import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -62,7 +63,7 @@ public class CreateSignatureXalanTest {
System.clearProperty("org.apache.xml.security.resource.config");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXFilter2Signature() throws Exception {
Document doc = TestUtils.newDocument();
doc.appendChild(doc.createComment(" Comment before "));
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java
index 1818fa6c..a9257033 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/ECDSASignatureTest.java
@@ -43,6 +43,8 @@ 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.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
@@ -56,7 +58,6 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
*/
public class ECDSASignatureTest {
- private static final String SEP = System.getProperty("file.separator");
private static final String ECDSA_JKS =
"src/test/resources/org/apache/xml/security/samples/input/ecdsa.jks";
private static final String ECDSA_JKS_PASSWORD = "security";
@@ -69,14 +70,14 @@ public class ECDSASignatureTest {
org.apache.xml.security.Init.init();
try {
- int javaVersion = Integer.parseInt(System.getProperty("java.specification.version"));
+ int javaVersion = Integer.getInteger("java.specification.version", 0);
isJDK16up = javaVersion >= 16;
} catch (NumberFormatException ex) {
// ignore
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testOne() throws Exception {
//
// This test fails with the IBM JDK
@@ -98,8 +99,8 @@ public class ECDSASignatureTest {
}
// Failing with more recent BouncyCastle libraries
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void testTwo() throws Exception {
File file = resolveFile("src/test/resources/org/apache/xml/security/samples/input/ecdsaSignature.xml");
try (InputStream is = new FileInputStream(file)) {
@@ -107,8 +108,8 @@ public class ECDSASignatureTest {
}
}
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void testThree() throws Exception {
File file = resolveFile("src/test/resources/at/buergerkarte/testresp.xml");
try (InputStream is = new FileInputStream(file)) {
@@ -116,7 +117,7 @@ public class ECDSASignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyValue() throws Exception {
//
// This test fails with the IBM JDK
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/EDDSASignatureTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/EDDSASignatureTest.java
index 2735ff99..33aeedf8 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/EDDSASignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/EDDSASignatureTest.java
@@ -43,6 +43,7 @@ import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
@@ -57,7 +58,7 @@ public class EDDSASignatureTest extends EdDSATestAbstract {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEd22519() throws Exception {
KeyStore keyStore = KeyStore.getInstance(EDDSA_KS_TYPE);
@@ -69,7 +70,7 @@ public class EDDSASignatureTest extends EdDSATestAbstract {
doVerify(doSign(privateKey, (X509Certificate) keyStore.getCertificate("Ed25519"), null, XMLSignature.ALGO_ID_SIGNATURE_EDDSA_ED25519));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEd22519VerifyXML() throws Exception {
try (InputStream xmlSignatureExample
@@ -78,7 +79,7 @@ public class EDDSASignatureTest extends EdDSATestAbstract {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEd448VerifyXML() throws Exception {
try (InputStream xmlSignatureExample
@@ -87,7 +88,7 @@ public class EDDSASignatureTest extends EdDSATestAbstract {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testEd448() throws Exception {
KeyStore keyStore = KeyStore.getInstance(EDDSA_KS_TYPE);
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java
index ab0f7920..ba752a71 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/HMACOutputLengthTest.java
@@ -34,6 +34,7 @@ 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.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -48,7 +49,7 @@ public class HMACOutputLengthTest {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_hmac_sha1_trunclen_0() throws Exception {
try {
validate("signature-enveloping-hmac-sha1-trunclen-0-attack.xml");
@@ -61,7 +62,7 @@ public class HMACOutputLengthTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_hmac_sha1_trunclen_8() throws Exception {
try {
validate("signature-enveloping-hmac-sha1-trunclen-8-attack.xml");
@@ -73,7 +74,7 @@ public class HMACOutputLengthTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_generate_hmac_sha1_40() throws Exception {
Document doc = TestUtils.newDocument();
try {
@@ -90,7 +91,7 @@ public class HMACOutputLengthTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testValidHMACOutputLength() throws Exception {
Document doc = TestUtils.newDocument();
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/InvalidKeyTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/InvalidKeyTest.java
index cf1ce127..e55feb0c 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/InvalidKeyTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/InvalidKeyTest.java
@@ -26,6 +26,7 @@ import java.security.PublicKey;
import org.apache.xml.security.Init;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -44,7 +45,7 @@ public class InvalidKeyTest {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test() throws Exception {
KeyStore trustStore = KeyStore.getInstance("JKS");
try (FileInputStream input = new FileInputStream(
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/KeyValueTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/KeyValueTest.java
index eb70c9e7..d5670637 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/KeyValueTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/KeyValueTest.java
@@ -29,6 +29,7 @@ import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -37,13 +38,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
public class KeyValueTest {
- private static final String SEP = System.getProperty("file.separator");
-
static {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testDSAPublicKey() throws Exception {
String path =
"src/test/resources/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-dsa.xml";
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/NoKeyInfoTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/NoKeyInfoTest.java
index cbee8626..1cbcfd58 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/NoKeyInfoTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/NoKeyInfoTest.java
@@ -27,6 +27,7 @@ import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -39,7 +40,7 @@ public class NoKeyInfoTest {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testNullKeyInfo() throws Exception {
String filename = "src/test/resources/ie/baltimore/merlin-examples/merlin-xmldsig-twenty-three/signature-enveloping-hmac-sha1.xml";
File f = XmlSecTestEnvironment.resolveFile(filename);
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/ProcessingInstructionTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/ProcessingInstructionTest.java
index 7491d71e..9fc60e9b 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/ProcessingInstructionTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/ProcessingInstructionTest.java
@@ -35,6 +35,7 @@ import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.utils.resolver.ResourceResolverContext;
import org.apache.xml.security.utils.resolver.ResourceResolverException;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -57,7 +58,7 @@ public class ProcessingInstructionTest {
dir = resolveFile("src", "test", "resources", "org", "apache", "xml", "security", "testcases");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testProcessingInstruction() throws Exception {
File f = new File(dir, "upp_sign.xml");
Document doc = XMLUtils.read(f, false);
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/Santuario499Test.java b/src/test/java/org/apache/xml/security/test/dom/signature/Santuario499Test.java
index d104c1bf..82655383 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/Santuario499Test.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/Santuario499Test.java
@@ -28,6 +28,7 @@ import org.apache.xml.security.Init;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -44,7 +45,7 @@ public class Santuario499Test {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXSLTTransform() throws Exception {
URL signatureFile = this.getClass().getResource("Arbeidstijd_anonymous.xml");
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java
index bec03970..91c96cf5 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/SignatureReferenceTest.java
@@ -54,6 +54,7 @@ import org.apache.xml.security.utils.resolver.ResourceResolverContext;
import org.apache.xml.security.utils.resolver.ResourceResolverException;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
import org.apache.xml.security.utils.resolver.implementations.ResolverXPointer;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -76,7 +77,7 @@ public class SignatureReferenceTest {
ElementProxy.setDefaultPrefix(Constants.SignatureSpecNS, "ds");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigningVerifyingReference() throws Throwable {
Document doc = getOriginalDocument();
XMLSignature signature = signDocument(doc);
@@ -105,7 +106,7 @@ public class SignatureReferenceTest {
}
// See SANTUARIO-465
- @org.junit.jupiter.api.Test
+ @Test
public void testNoReferenceChildren() throws ParserConfigurationException, XMLSecurityException {
Document doc = TestUtils.newDocument();
Element referenceElement = doc.createElementNS(Constants.SignatureSpecNS, "Reference");
@@ -139,7 +140,7 @@ public class SignatureReferenceTest {
new WrappedReference(referenceElement, "_54321", null);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testManifestReferences() throws Throwable {
XPathFactory xpf = XPathFactory.newInstance();
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java
index 2cf66cdd..9fbcfadd 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/SignatureTest.java
@@ -33,6 +33,7 @@ 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.resolver.implementations.ResolverXPointer;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -49,12 +50,12 @@ public class SignatureTest {
keyStore = XmlSecTestEnvironment.getTestKeyStore();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigning() throws Throwable {
signDocument(getOriginalDocument());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigningVerifyingFromRebuildSignature() throws Throwable {
Document doc = getOriginalDocument();
signDocument(doc);
@@ -66,7 +67,7 @@ public class SignatureTest {
assertTrue(signature.checkSignatureValue(pubKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigningVerifyingFromRebuildSignatureWithProvider() throws Throwable {
Provider provider = new org.bouncycastle.jce.provider.BouncyCastleProvider();
Document doc = getOriginalDocument();
@@ -81,7 +82,7 @@ public class SignatureTest {
assertTrue(signature.checkSignatureValue(pubKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigningVerifyingFromExistingSignature() throws Throwable {
Document doc = getOriginalDocument();
XMLSignature signature = signDocument(doc);
@@ -90,7 +91,7 @@ public class SignatureTest {
assertTrue(signature.checkSignatureValue(pubKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigningVerifyingFromExistingSignatureWithProvider() throws Throwable {
Provider provider = new org.bouncycastle.jce.provider.BouncyCastleProvider();
Document doc = getOriginalDocument();
@@ -101,7 +102,7 @@ public class SignatureTest {
assertTrue(signature.checkSignatureValue(pubKey));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigningVerifyingFromExistingSignatureSameThread()
throws Throwable {
Document doc = getOriginalDocument();
@@ -117,7 +118,7 @@ public class SignatureTest {
assertTrue(r.result);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSigningVerifyingFromExistingSignatureSeparateThread()
throws Throwable {
Document doc = getOriginalDocument();
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/UnknownAlgoSignatureTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/UnknownAlgoSignatureTest.java
index b122f1f5..86952cbe 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/UnknownAlgoSignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/UnknownAlgoSignatureTest.java
@@ -35,6 +35,7 @@ import org.apache.xml.security.signature.XMLSignatureException;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -71,12 +72,12 @@ public class UnknownAlgoSignatureTest {
publicKey = cert.getPublicKey();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testGood() throws Exception {
assertTrue(checkSignature("signature-good.xml"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testBadC14NAlgo() throws Exception {
try {
assertTrue(checkSignature("signature-bad-c14n-algo.xml"));
@@ -86,7 +87,7 @@ public class UnknownAlgoSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testBadSigAlgo() throws Exception {
try {
assertTrue(checkSignature("signature-bad-sig-algo.xml"));
@@ -96,7 +97,7 @@ public class UnknownAlgoSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testBadTransformAlgo() throws Exception {
try {
assertTrue(checkReferences("signature-bad-transform-algo.xml"));
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java
index 4ec469b9..f8a2dfdb 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/X509DataTest.java
@@ -32,6 +32,7 @@ import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.dom.TestUtils;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -43,7 +44,7 @@ public class X509DataTest {
KeyStore ks;
- @org.junit.jupiter.api.Test
+ @Test
public void testAddX509SubjectName() throws Exception {
Init.init();
diff --git a/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java b/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java
index e1cf8c84..93261748 100644
--- a/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/signature/XmlSecTest.java
@@ -39,6 +39,7 @@ 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.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -52,12 +53,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class XmlSecTest {
- @org.junit.jupiter.api.Test
+ @Test
public void testCheckXmlSignatureSoftwareStack() throws Exception {
checkXmlSignatureSoftwareStack(false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCheckXmlSignatureSoftwareStackWithCert() throws Exception {
checkXmlSignatureSoftwareStack(true);
}
diff --git a/src/test/java/org/apache/xml/security/test/dom/transforms/EmptyNamespaceTest.java b/src/test/java/org/apache/xml/security/test/dom/transforms/EmptyNamespaceTest.java
index 4d95eae8..a46fe0ef 100644
--- a/src/test/java/org/apache/xml/security/test/dom/transforms/EmptyNamespaceTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/transforms/EmptyNamespaceTest.java
@@ -18,13 +18,6 @@
*/
package org.apache.xml.security.test.dom.transforms;
-import org.apache.xml.security.c14n.implementations.Canonicalizer20010315Excl;
-import org.apache.xml.security.c14n.implementations.Canonicalizer20010315ExclOmitComments;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_Excl;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_ExclOmitCommentsTransformer;
-import org.apache.xml.security.utils.XMLUtils;
-import org.w3c.dom.Document;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@@ -33,6 +26,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.xml.security.c14n.implementations.Canonicalizer20010315Excl;
+import org.apache.xml.security.c14n.implementations.Canonicalizer20010315ExclOmitComments;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_Excl;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_ExclOmitCommentsTransformer;
+import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+
import static org.junit.jupiter.api.Assertions.assertEquals;
public class EmptyNamespaceTest {
@@ -65,7 +66,7 @@ public class EmptyNamespaceTest {
"\t</ec:SubmitRetrieveInterchangeAgreementsRequestResponse>\n" +
"</SOAP-ENV:Body>";
- @org.junit.jupiter.api.Test
+ @Test
public void doStAXTest() throws Exception {
org.apache.xml.security.Init.init();
org.apache.xml.security.stax.config.Init.init(null, EmptyNamespaceTest.class);
@@ -89,7 +90,7 @@ public class EmptyNamespaceTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void doDOMTest() throws Exception {
org.apache.xml.security.Init.init();
org.apache.xml.security.stax.config.Init.init(null, EmptyNamespaceTest.class);
diff --git a/src/test/java/org/apache/xml/security/test/dom/transforms/TransformTest.java b/src/test/java/org/apache/xml/security/test/dom/transforms/TransformTest.java
index f975601c..31d469aa 100644
--- a/src/test/java/org/apache/xml/security/test/dom/transforms/TransformTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/transforms/TransformTest.java
@@ -23,6 +23,7 @@ import org.apache.xml.security.exceptions.AlgorithmAlreadyRegisteredException;
import org.apache.xml.security.transforms.Transform;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.transforms.implementations.TransformC14N11;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -32,14 +33,14 @@ public class TransformTest {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAlreadyRegisteredException() throws Exception {
assertThrows(AlgorithmAlreadyRegisteredException.class, () ->
Transform.register(Transforms.TRANSFORM_C14N11_OMIT_COMMENTS, TransformC14N11.class)
);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testAlreadyRegisteredExceptionFromString() throws Exception {
assertThrows(AlgorithmAlreadyRegisteredException.class, () ->
Transform.register(Transforms.TRANSFORM_C14N11_OMIT_COMMENTS,
diff --git a/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java b/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java
index b5ec5a13..3e95fc07 100644
--- a/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformBase64DecodeTest.java
@@ -32,6 +32,7 @@ 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.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -50,7 +51,7 @@ public class TransformBase64DecodeTest {
org.apache.xml.security.Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test1() throws Exception {
// base64 encoded
String s1 =
@@ -72,7 +73,7 @@ public class TransformBase64DecodeTest {
assertEquals(result, "The URI of the transform is http://www.w3.org/2000/09/xmldsig#base64");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test2() throws Exception {
// base64 encoded twice
String s2 =
@@ -94,7 +95,7 @@ public class TransformBase64DecodeTest {
assertEquals(result, "The URI of the transform is http://www.w3.org/2000/09/xmldsig#base64");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test3() throws Exception {
//J-
String input = ""
diff --git a/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformXSLTTest.java b/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformXSLTTest.java
index 400ed345..2120c0b7 100644
--- a/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformXSLTTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/TransformXSLTTest.java
@@ -29,6 +29,7 @@ import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.transforms.Transform;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -48,7 +49,7 @@ public class TransformXSLTTest {
* Make sure Transform.performTransform does not throw NullPointerException.
* See bug 41927 for more info.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test1() throws Exception {
Document doc1 = getDocument(SIGNATURE_FILE);
Document doc2 = getDocument(STYLESHEET_FILE);
diff --git a/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/Xpath2TransformationTest.java b/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/Xpath2TransformationTest.java
index b677723d..09a92e4a 100644
--- a/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/Xpath2TransformationTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/transforms/implementations/Xpath2TransformationTest.java
@@ -25,6 +25,7 @@ import org.apache.xml.security.Init;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -35,7 +36,7 @@ public class Xpath2TransformationTest {
Init.init();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXpath2Transform() throws Exception {
String sig="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
"<edoc:EDOC xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:edoc=\"http://www.imtf.com/hypersuite/edoc/2.0/\" sysid=\"CC9CC230-C0A8024E01A3CA10-AC154F78\">\r\n" +
diff --git a/src/test/java/org/apache/xml/security/test/dom/utils/JDKXPathFactoryTest.java b/src/test/java/org/apache/xml/security/test/dom/utils/JDKXPathFactoryTest.java
index 7328373d..161082b0 100644
--- a/src/test/java/org/apache/xml/security/test/dom/utils/JDKXPathFactoryTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/utils/JDKXPathFactoryTest.java
@@ -47,6 +47,7 @@ import org.apache.xml.security.utils.I18n;
import org.apache.xml.security.utils.JDKXPathFactory;
import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.utils.resolver.ResourceResolver;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -77,7 +78,7 @@ public class JDKXPathFactoryTest {
kp = KeyPairGenerator.getInstance("RSA").genKeyPair();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testXPathSignature() throws Exception {
Document doc = TestUtils.newDocument();
doc.appendChild(doc.createComment(" Comment before "));
diff --git a/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java b/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java
index 35d669d3..aec79ffb 100644
--- a/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/utils/resolver/ResourceResolverTest.java
@@ -19,12 +19,11 @@
package org.apache.xml.security.test.dom.utils.resolver;
-import java.io.File;
-
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.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -51,7 +50,7 @@ public class ResourceResolverTest {
/**
* Tests registering a custom resolver implementation.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testCustomResolver() throws Exception {
String className =
"org.apache.xml.security.test.dom.utils.resolver.OfflineResolver";
@@ -80,7 +79,7 @@ public class ResourceResolverTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testLocalFileWithEmptyBaseURI() throws Exception {
Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
@@ -98,7 +97,7 @@ public class ResourceResolverTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testIsSafeURIToResolveFile() throws Exception {
Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
@@ -110,7 +109,7 @@ public class ResourceResolverTest {
assertFalse(resolverContext.isURISafeToResolve());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testIsSafeURIToResolveFileBaseURI() throws Exception {
Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
@@ -122,7 +121,7 @@ public class ResourceResolverTest {
assertFalse(resolverContext.isURISafeToResolve());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testIsSafeURIToResolveHTTP() throws Exception {
Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
@@ -133,7 +132,7 @@ public class ResourceResolverTest {
assertFalse(resolverContext.isURISafeToResolve());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testIsSafeURIToResolveHTTPBaseURI() throws Exception {
Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
@@ -144,7 +143,7 @@ public class ResourceResolverTest {
assertFalse(resolverContext.isURISafeToResolve());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testIsSafeURIToResolveLocalReference() throws Exception {
Document doc = TestUtils.newDocument();
Attr uriAttr = doc.createAttribute("URI");
diff --git a/src/test/java/org/apache/xml/security/test/dom/version/VersionTest.java b/src/test/java/org/apache/xml/security/test/dom/version/VersionTest.java
index 4aa484b3..bbcd2234 100644
--- a/src/test/java/org/apache/xml/security/test/dom/version/VersionTest.java
+++ b/src/test/java/org/apache/xml/security/test/dom/version/VersionTest.java
@@ -22,6 +22,8 @@ package org.apache.xml.security.test.dom.version;
import java.security.Provider;
import java.security.Security;
+import org.junit.jupiter.api.Test;
+
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -35,7 +37,7 @@ public class VersionTest {
* A unit test for the algorithm below to convert a version number
* to a double.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testConvertVersion() throws Exception {
String version = convertVersion("1.4.4");
assertEquals("1.44", version);
@@ -47,7 +49,7 @@ public class VersionTest {
assertEquals("1.4", version);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testVersion() throws Exception {
Provider provider = Security.getProvider("ApacheXMLDSig");
if (provider != null) {
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorExceptionTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorExceptionTest.java
index bef3f0af..aa455f6c 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorExceptionTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorExceptionTest.java
@@ -25,8 +25,11 @@ package org.apache.xml.security.test.javax.xml.crypto;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Arrays;
+
import javax.xml.crypto.KeySelectorException;
+import org.junit.jupiter.api.Test;
+
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -38,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class KeySelectorExceptionTest {
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test KeySelectorException()
KeySelectorException kse = new KeySelectorException();
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorTest.java
index cf0bb96f..2ff6fbb9 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/KeySelectorTest.java
@@ -21,14 +21,18 @@
*/
package org.apache.xml.security.test.javax.xml.crypto;
-import java.util.*;
-
-
import java.security.Key;
import java.security.cert.X509Certificate;
-import javax.xml.crypto.*;
-import javax.xml.crypto.dsig.keyinfo.*;
-import javax.xml.crypto.dsig.*;
+import java.util.Collections;
+
+import javax.xml.crypto.KeySelector;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+import javax.xml.crypto.dsig.keyinfo.KeyInfo;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.X509Data;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -37,25 +41,28 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
*/
public class KeySelectorTest {
- private Key key;
- private KeySelector selector1;
+ private final Key key;
+ private final KeySelector selector1;
private class MyOwnKey implements Key {
private static final long serialVersionUID = -3288147894137347920L;
- private String algo;
- private byte[] val;
+ private final String algo;
+ private final byte[] val;
MyOwnKey(String algorithm, byte[] value) {
algo = algorithm;
val = value.clone();
}
+ @Override
public String getAlgorithm() {
return algo;
}
+ @Override
public byte[] getEncoded() {
return val;
}
+ @Override
public String getFormat() {
return "RAW";
}
@@ -67,7 +74,7 @@ public class KeySelectorTest {
selector1 = KeySelector.singletonKeySelector(key);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testselect() throws Exception {
KeyInfoFactory factory = KeyInfoFactory.getInstance
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/OctetStreamDataTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/OctetStreamDataTest.java
index a8fc2634..c18bb92d 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/OctetStreamDataTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/OctetStreamDataTest.java
@@ -22,9 +22,12 @@
package org.apache.xml.security.test.javax.xml.crypto;
-import java.io.*;
-import java.util.*;
-import javax.xml.crypto.*;
+import java.io.ByteArrayInputStream;
+import java.util.Random;
+
+import javax.xml.crypto.OctetStreamData;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -38,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class OctetStreamDataTest {
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
// test OctetStreamData(InputStream) and
// OctetStreamData(InputStream, String, String)
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore18Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore18Test.java
index 4d83b36a..11db5823 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore18Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore18Test.java
@@ -31,6 +31,7 @@ import javax.xml.crypto.URIDereferencer;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -57,7 +58,7 @@ public class Baltimore18Test {
ud = new LocalHttpCacheURIDereferencer();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureKeyname() throws Exception {
String file = "signature-keyname.xml";
@@ -66,7 +67,7 @@ public class Baltimore18Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureRetrievalmethodRawx509crt() throws Exception {
String file = "signature-retrievalmethod-rawx509crt.xml";
@@ -75,7 +76,7 @@ public class Baltimore18Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureX509CrtCrl() throws Exception {
String file = "signature-x509-crt-crl.xml";
@@ -84,7 +85,7 @@ public class Baltimore18Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureX509Crt() throws Exception {
String file = "signature-x509-crt.xml";
@@ -93,7 +94,7 @@ public class Baltimore18Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureX509Is() throws Exception {
String file = "signature-x509-is.xml";
@@ -102,7 +103,7 @@ public class Baltimore18Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureX509Ski() throws Exception {
String file = "signature-x509-ski.xml";
@@ -111,7 +112,7 @@ public class Baltimore18Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignatureX509Sn() throws Exception {
String file = "signature-x509-sn.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23Test.java
index 4368590e..24e5ce10 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23Test.java
@@ -25,12 +25,14 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.security.Security;
+
import javax.xml.crypto.KeySelector;
import javax.xml.crypto.URIDereferencer;
import javax.xml.crypto.dsig.XMLSignatureException;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
@@ -57,7 +59,7 @@ public class Baltimore23Test {
ud = new LocalHttpCacheURIDereferencer();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloped_dsa() throws Exception {
String file = "signature-enveloped-dsa.xml";
@@ -67,7 +69,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_b64_dsa() throws Exception {
String file = "signature-enveloping-b64-dsa.xml";
@@ -77,7 +79,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_dsa() throws Exception {
String file = "signature-enveloping-dsa.xml";
@@ -87,7 +89,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_external_b64_dsa() throws Exception {
String file = "signature-external-b64-dsa.xml";
@@ -97,7 +99,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_external_dsa() throws Exception {
String file = "signature-external-dsa.xml";
@@ -107,7 +109,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_rsa() throws Exception {
String file = "signature-enveloping-rsa.xml";
@@ -117,7 +119,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_hmac_sha1() throws Exception {
String file = "signature-enveloping-hmac-sha1.xml";
@@ -128,7 +130,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_hmac_sha1_40() throws Exception {
String file = "signature-enveloping-hmac-sha1-40.xml";
@@ -144,7 +146,7 @@ public class Baltimore23Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_keyname() throws Exception {
String file = "signature-keyname.xml";
@@ -154,7 +156,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_retrievalmethod_rawx509crt() throws Exception {
String file = "signature-retrievalmethod-rawx509crt.xml";
@@ -164,7 +166,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_x509_crt_crl() throws Exception {
String file = "signature-x509-crt-crl.xml";
@@ -174,7 +176,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_x509_crt() throws Exception {
String file = "signature-x509-crt.xml";
@@ -184,7 +186,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_x509_is() throws Exception {
String file = "signature-x509-is.xml";
@@ -194,7 +196,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_x509_ski() throws Exception {
String file = "signature-x509-ski.xml";
@@ -204,7 +206,7 @@ public class Baltimore23Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_x509_sn() throws Exception {
String file = "signature-x509-sn.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23XalanTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23XalanTest.java
index b85309a4..51792eaa 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23XalanTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/Baltimore23XalanTest.java
@@ -32,6 +32,7 @@ import javax.xml.crypto.URIDereferencer;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -68,7 +69,7 @@ public class Baltimore23XalanTest {
ud = new LocalHttpCacheURIDereferencer();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature() throws Exception {
//
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreExcC14n1Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreExcC14n1Test.java
index 3535f84a..9df104d5 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreExcC14n1Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreExcC14n1Test.java
@@ -27,6 +27,7 @@ import java.security.Security;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -49,7 +50,7 @@ public class BaltimoreExcC14n1Test {
validator = new SignatureValidator(base);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testExcSignature() throws Exception {
String file = "exc-signature.xml";
boolean coreValidity = validator.validate(file, new KeySelectors.KeyValueKeySelector());
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreIaik2Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreIaik2Test.java
index 4cf75a94..84d6ed13 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreIaik2Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreIaik2Test.java
@@ -29,6 +29,7 @@ import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -53,7 +54,7 @@ public class BaltimoreIaik2Test {
validator = new SignatureValidator(dir);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignature() throws Exception {
String file = "signature.xml";
boolean coreValidity = validator.validate(file, new KeySelectors.KeyValueKeySelector());
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreXPathFilter2ThreeTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreXPathFilter2ThreeTest.java
index 6b0c330c..2e9e39d7 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreXPathFilter2ThreeTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/BaltimoreXPathFilter2ThreeTest.java
@@ -26,6 +26,7 @@ import java.io.File;
import java.security.Security;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -48,7 +49,7 @@ public class BaltimoreXPathFilter2ThreeTest {
validator = new SignatureValidator(file);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignSpec() throws Exception {
String file = "sign-spec.xml";
@@ -61,7 +62,7 @@ public class BaltimoreXPathFilter2ThreeTest {
assertTrue(coreValidity, "Signature failed core validation#2");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignXfdl() throws Exception {
String file = "sign-xfdl.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/C14N11Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/C14N11Test.java
index 0df90cc8..f91ce208 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/C14N11Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/C14N11Test.java
@@ -21,12 +21,14 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.security.Security;
+
import javax.xml.crypto.KeySelector;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -55,104 +57,104 @@ public class C14N11Test {
sks = new KeySelectors.SecretKeySelector("secret".getBytes(StandardCharsets.US_ASCII));
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlid_1() throws Exception {
test_c14n11("xmlid-1");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlid_2() throws Exception {
test_c14n11("xmlid-2");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlspace_1() throws Exception {
test_c14n11("xmlspace-1");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlspace_2() throws Exception {
test_c14n11("xmlspace-2");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlspace_3() throws Exception {
test_c14n11("xmlspace-3");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlspace_4() throws Exception {
test_c14n11("xmlspace-4");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmllang_1() throws Exception {
test_c14n11("xmllang-1");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmllang_2() throws Exception {
test_c14n11("xmllang-2");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmllang_3() throws Exception {
test_c14n11("xmllang-3");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmllang_4() throws Exception {
test_c14n11("xmllang-4");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_prop_1() throws Exception {
test_c14n11("xmlbase-prop-1");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_prop_2() throws Exception {
test_c14n11("xmlbase-prop-2");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_prop_3() throws Exception {
test_c14n11("xmlbase-prop-3");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_prop_4() throws Exception {
test_c14n11("xmlbase-prop-4");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_prop_5() throws Exception {
test_c14n11("xmlbase-prop-5");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_prop_6() throws Exception {
test_c14n11("xmlbase-prop-6");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_prop_7() throws Exception {
test_c14n11("xmlbase-prop-7");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_c14n11spec_102() throws Exception {
String[] vendors = {"IAIK", "IBM", "ORCL", "SUN", "UPC"};
test_c14n11("xmlbase-c14n11spec-102", vendors);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_c14n11spec2_102() throws Exception {
String[] vendors = {"IAIK", "IBM", "ORCL", "SUN"};
test_c14n11("xmlbase-c14n11spec2-102", vendors);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xmlbase_c14n11spec3_103() throws Exception {
String[] vendors = {"IAIK", "IBM", "ORCL", "SUN", "UPC"};
test_c14n11("xmlbase-c14n11spec3-103", vendors);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CanonicalizationMethodTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CanonicalizationMethodTest.java
index 383154b4..87b4dcec 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CanonicalizationMethodTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CanonicalizationMethodTest.java
@@ -22,12 +22,18 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.security.*;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Security;
import java.security.spec.AlgorithmParameterSpec;
-import javax.xml.crypto.dsig.*;
+
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec;
+import org.junit.jupiter.api.Test;
+
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -61,7 +67,7 @@ public class CanonicalizationMethodTest {
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testIsFeatureSupported() throws Exception {
CanonicalizationMethod cm;
for (int i = 0; i < C14N_ALGOS.length; i++) {
@@ -80,7 +86,7 @@ public class CanonicalizationMethodTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
// test newAlgorithmMethod(String algorithm,
// AlgorithmParameterSpec params)
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ClassLoaderTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ClassLoaderTest.java
index 1f65f1c0..83262e3e 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ClassLoaderTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ClassLoaderTest.java
@@ -29,6 +29,7 @@ import java.security.Security;
import javax.xml.crypto.dsig.CanonicalizationMethod;
import org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
@@ -42,7 +43,7 @@ public class ClassLoaderTest {
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(ClassLoaderTest.class);
- @org.junit.jupiter.api.Test
+ @Test
public void testMultipleLoaders() throws Exception {
File file0 = resolveFile("build", "classes");
File file1 = resolveFile("build", "test");
@@ -62,7 +63,7 @@ public class ClassLoaderTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testProviderMultipleLoaders() throws Exception {
File file0 = resolveFile("build", "classes");
File file1 = resolveFile("build", "test");
@@ -95,7 +96,7 @@ public class ClassLoaderTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testProviderMultipleLoadersTwo() throws Exception {
File file0 = resolveFile("build", "classes");
File file1 = resolveFile("build", "test");
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ComRSASecurityTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ComRSASecurityTest.java
index 38e6ed90..a27c7074 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ComRSASecurityTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ComRSASecurityTest.java
@@ -27,6 +27,7 @@ import java.security.Security;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -49,7 +50,7 @@ public class ComRSASecurityTest {
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_certj201_enveloping() throws Exception {
String file = "certj201_enveloping.xml";
@@ -58,7 +59,7 @@ public class ComRSASecurityTest {
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_certj201_enveloped() throws Exception {
String file = "certj201_enveloped.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateBaltimore23Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateBaltimore23Test.java
index 83431634..3856ba05 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateBaltimore23Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateBaltimore23Test.java
@@ -30,6 +30,7 @@ import java.io.StringWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
+import java.nio.file.FileSystems;
import java.security.Key;
import java.security.KeyStore;
import java.security.PublicKey;
@@ -80,6 +81,7 @@ import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -140,7 +142,7 @@ public class CreateBaltimore23Test {
ud = new LocalHttpCacheURIDereferencer();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_enveloped_dsa() throws Exception {
// create SignedInfo
SignedInfo si = fac.newSignedInfo
@@ -174,17 +176,17 @@ public class CreateBaltimore23Test {
assertTrue(sig2.validate(dvc));
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_enveloping_b64_dsa() throws Exception {
test_create_signature_enveloping(dsaSha1, dsa, signingKey, kvks, true);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_enveloping_dsa() throws Exception {
test_create_signature_enveloping(dsaSha1, dsa, signingKey, kvks, false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_enveloping_hmac_sha1_40()
throws Exception {
SignatureMethod hmacSha1 = fac.newSignatureMethod
@@ -199,7 +201,7 @@ public class CreateBaltimore23Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_enveloping_hmac_sha1()
throws Exception {
SignatureMethod hmacSha1 = fac.newSignatureMethod
@@ -208,23 +210,23 @@ public class CreateBaltimore23Test {
TestUtils.getSecretKey("secret".getBytes(StandardCharsets.US_ASCII)), sks, false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_enveloping_rsa() throws Exception {
test_create_signature_enveloping(rsaSha1, rsa,
TestUtils.getPrivateKey("RSA"), kvks, false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_external_b64_dsa() throws Exception {
test_create_signature_external(dsaSha1, dsa, signingKey, kvks, true);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_external_dsa() throws Exception {
test_create_signature_external(dsaSha1, dsa, signingKey, kvks, false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_keyname() throws Exception {
KeyInfo kn = kifac.newKeyInfo(Collections.singletonList
(kifac.newKeyName("mullan")));
@@ -232,7 +234,7 @@ public class CreateBaltimore23Test {
new X509KeySelector(ks), false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_retrievalmethod_rawx509crt()
throws Exception {
KeyInfo rm = kifac.newKeyInfo(Collections.singletonList
@@ -242,7 +244,7 @@ public class CreateBaltimore23Test {
new X509KeySelector(ks), false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_x509_crt_crl() throws Exception {
//
@@ -266,7 +268,7 @@ public class CreateBaltimore23Test {
test_create_signature_external(dsaSha1, crt_crl, signingKey, new X509KeySelector(ks), false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_x509_crt() throws Exception {
//
// This test fails with the IBM JDK
@@ -282,7 +284,7 @@ public class CreateBaltimore23Test {
new X509KeySelector(ks), false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_x509_is() throws Exception {
//
// This test fails with the IBM JDK
@@ -300,7 +302,7 @@ public class CreateBaltimore23Test {
new X509KeySelector(ks), false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_x509_ski() throws Exception {
KeyInfo ski = kifac.newKeyInfo(Collections.singletonList
(kifac.newX509Data(Collections.singletonList
@@ -310,7 +312,7 @@ public class CreateBaltimore23Test {
KeySelector.singletonKeySelector(validatingKey), false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature_x509_sn() throws Exception {
//
// This test fails with the IBM JDK
@@ -327,7 +329,7 @@ public class CreateBaltimore23Test {
new X509KeySelector(ks), false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_signature() throws Exception {
//
@@ -623,10 +625,10 @@ public class CreateBaltimore23Test {
DOMValidateContext dvc = new DOMValidateContext
(new X509KeySelector(ks), sigElement);
File f = new File(
- System.getProperty("dir.test.vector.baltimore") +
- System.getProperty("file.separator") +
- "merlin-xmldsig-twenty-three" +
- System.getProperty("file.separator"));
+ System.getProperty("dir.test.vector.baltimore") +
+ FileSystems.getDefault().getSeparator() +
+ "merlin-xmldsig-twenty-three" +
+ FileSystems.getDefault().getSeparator());
dvc.setBaseURI(f.toURI().toString());
dvc.setURIDereferencer(ud);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropExcC14NTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropExcC14NTest.java
index 33f9f566..2b689f66 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropExcC14NTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropExcC14NTest.java
@@ -22,8 +22,6 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.io.File;
-import java.io.FileInputStream;
import java.security.Key;
import java.security.KeyStore;
import java.security.PublicKey;
@@ -53,6 +51,7 @@ import javax.xml.crypto.dsig.spec.TransformParameterSpec;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -89,7 +88,7 @@ public class CreateInteropExcC14NTest {
validatingKey = signingCert.getPublicKey();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_Y1() throws Exception {
List<Reference> refs = new ArrayList<>(4);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXFilter2Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXFilter2Test.java
index a5a0b760..33c55bf5 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXFilter2Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXFilter2Test.java
@@ -22,8 +22,6 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.io.File;
-import java.io.FileInputStream;
import java.security.Key;
import java.security.KeyStore;
import java.security.PublicKey;
@@ -53,6 +51,7 @@ import javax.xml.crypto.dsig.spec.XPathType;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -93,7 +92,7 @@ public class CreateInteropXFilter2Test {
@SuppressWarnings({
"rawtypes", "unchecked"
})
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_sign_spec() throws Exception {
List<Reference> refs = new ArrayList<>(2);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXMLDSig11Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXMLDSig11Test.java
index 1e62f514..f859f649 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXMLDSig11Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreateInteropXMLDSig11Test.java
@@ -19,19 +19,35 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
import java.nio.charset.StandardCharsets;
-import java.security.*;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.Security;
import java.security.spec.ECGenParameterSpec;
import java.util.Collections;
import javax.xml.crypto.KeySelector;
-import javax.xml.crypto.dom.*;
-import javax.xml.crypto.dsig.*;
-import javax.xml.crypto.dsig.dom.*;
-import javax.xml.crypto.dsig.keyinfo.*;
-import javax.xml.crypto.dsig.spec.*;
+import javax.xml.crypto.dom.DOMStructure;
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.SignedInfo;
+import javax.xml.crypto.dsig.XMLObject;
+import javax.xml.crypto.dsig.XMLSignature;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+import javax.xml.crypto.dsig.dom.DOMSignContext;
+import javax.xml.crypto.dsig.dom.DOMValidateContext;
+import javax.xml.crypto.dsig.keyinfo.KeyInfo;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
-import org.w3c.dom.*;
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Text;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -43,15 +59,33 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class CreateInteropXMLDSig11Test {
- private KeySelector kvks, sks;
- private CanonicalizationMethod withoutComments;
- private DigestMethod sha1, sha256, sha384, sha512;
- private SignatureMethod ecdsaSha1, ecdsaSha256, ecdsaSha384, ecdsaSha512,
- rsaSha256, rsaSha384, rsaSha512, hmacSha256,
- hmacSha384, hmacSha512;
- private KeyInfo p256ki, p384ki, p521ki, rsaki, rsa2048ki;
- private XMLSignatureFactory fac;
- private KeyPair p256, p384, p521, rsa2048;
+ private final KeySelector kvks;
+ private final KeySelector sks;
+ private final CanonicalizationMethod withoutComments;
+ private final DigestMethod sha1;
+ private final DigestMethod sha256;
+ private final DigestMethod sha384;
+ private final DigestMethod sha512;
+ private SignatureMethod ecdsaSha1;
+ private SignatureMethod ecdsaSha256;
+ private SignatureMethod ecdsaSha384;
+ private SignatureMethod ecdsaSha512;
+ private final SignatureMethod rsaSha256;
+ private final SignatureMethod rsaSha384;
+ private final SignatureMethod rsaSha512;
+ private final SignatureMethod hmacSha256;
+ private final SignatureMethod hmacSha384;
+ private final SignatureMethod hmacSha512;
+ private KeyInfo p256ki;
+ private KeyInfo p384ki;
+ private KeyInfo p521ki;
+ private final KeyInfo rsaki;
+ private final KeyInfo rsa2048ki;
+ private final XMLSignatureFactory fac;
+ private KeyPair p256;
+ private KeyPair p384;
+ private KeyPair p521;
+ private final KeyPair rsa2048;
private boolean ecSupport = true;
static {
@@ -127,7 +161,7 @@ public class CreateInteropXMLDSig11Test {
sks = new KeySelectors.SecretKeySelector("testkey".getBytes(StandardCharsets.US_ASCII));
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p256_sha1() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha1, sha1, p256ki,
@@ -135,7 +169,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p256_sha256() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha256, sha256, p256ki,
@@ -143,7 +177,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p256_sha384() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha384, sha384, p256ki,
@@ -151,7 +185,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p256_sha512() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha512, sha512, p256ki,
@@ -159,7 +193,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p384_sha1() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha1, sha1, p384ki,
@@ -167,7 +201,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p384_sha256() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha256, sha256, p384ki,
@@ -175,7 +209,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p384_sha384() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha384, sha384, p384ki,
@@ -183,7 +217,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p384_sha512() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha512, sha512, p384ki,
@@ -191,7 +225,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p521_sha1() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha1, sha1, p521ki,
@@ -199,7 +233,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p521_sha256() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha256, sha256, p521ki,
@@ -207,7 +241,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p521_sha384() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha384, sha384, p521ki,
@@ -215,7 +249,7 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_p521_sha512() throws Exception {
if (ecSupport) {
test_create_signature_enveloping(ecdsaSha512, sha512, p521ki,
@@ -223,57 +257,57 @@ public class CreateInteropXMLDSig11Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_rsa_sha256() throws Exception {
test_create_signature_enveloping(rsaSha256, sha1, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_rsa_sha384() throws Exception {
test_create_signature_enveloping(rsaSha384, sha1, rsa2048ki,
rsa2048.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_rsa_sha512() throws Exception {
test_create_signature_enveloping(rsaSha512, sha1, rsa2048ki,
rsa2048.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_sha256_rsa_sha256() throws Exception {
test_create_signature_enveloping(rsaSha256, sha256, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_sha384_rsa_sha256() throws Exception {
test_create_signature_enveloping(rsaSha256, sha384, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_sha512_rsa_sha256() throws Exception {
test_create_signature_enveloping(rsaSha256, sha512, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_hmac_sha256() throws Exception {
test_create_signature_enveloping(hmacSha256, sha1, rsaki,
TestUtils.getSecretKey
("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_hmac_sha384() throws Exception {
test_create_signature_enveloping(hmacSha384, sha1, rsaki,
TestUtils.getSecretKey
("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_enveloping_hmac_sha512() throws Exception {
test_create_signature_enveloping(hmacSha512, sha1, rsaki,
TestUtils.getSecretKey
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreatePhaosXMLDSig3Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreatePhaosXMLDSig3Test.java
index 689f327b..43cf0c61 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreatePhaosXMLDSig3Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/CreatePhaosXMLDSig3Test.java
@@ -42,6 +42,7 @@ import javax.xml.crypto.dsig.spec.HMACParameterSpec;
import javax.xml.crypto.dsig.spec.TransformParameterSpec;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -57,7 +58,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class CreatePhaosXMLDSig3Test {
- private XMLSignatureFactory fac;
+ private final XMLSignatureFactory fac;
static {
Security.insertProviderAt
@@ -69,12 +70,12 @@ public class CreatePhaosXMLDSig3Test {
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_hmac_sha1_exclusive_c14n_comments_detached() throws Exception {
test_create_hmac_sha1_exclusive_c14n_comments_detached(false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_hmac_sha1_40_exclusive_c14n_comments_detached()
throws Exception {
try {
@@ -132,7 +133,7 @@ public class CreatePhaosXMLDSig3Test {
assertTrue(sig2.validate(dvc));
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_create_hmac_sha1_exclusive_c14n_enveloped() throws Exception {
// create reference
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DetachedTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DetachedTest.java
index 97156653..44a4163d 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DetachedTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DetachedTest.java
@@ -21,17 +21,30 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.util.Collections;
+import java.util.Iterator;
+
import javax.xml.crypto.URIDereferencer;
-import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.SignedInfo;
+import javax.xml.crypto.dsig.XMLSignature;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+import javax.xml.crypto.dsig.XMLValidateContext;
import javax.xml.crypto.dsig.dom.DOMSignContext;
import javax.xml.crypto.dsig.dom.DOMValidateContext;
-import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.dsig.keyinfo.KeyInfo;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.KeyValue;
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
-
-import java.security.*;
-import java.util.*;
-
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -94,7 +107,7 @@ public class DetachedTest {
//
}
- @org.junit.jupiter.api.Test
+ @Test
public void test() {
try {
//
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DigestMethodTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DigestMethodTest.java
index 48a47432..27aaf3d5 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DigestMethodTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/DigestMethodTest.java
@@ -21,10 +21,13 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import javax.xml.crypto.dsig.*;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
-import java.security.*;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -38,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class DigestMethodTest {
- private XMLSignatureFactory factory;
+ private final XMLSignatureFactory factory;
private static final String[] MD_ALGOS = {
DigestMethod.SHA1
@@ -49,11 +52,10 @@ public class DigestMethodTest {
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() throws Exception {
DigestMethod dm;
- for (int i = 0; i < MD_ALGOS.length; i++) {
- String algo = MD_ALGOS[i];
+ for (String algo : MD_ALGOS) {
dm = factory.newDigestMethod(algo, null);
try {
dm.isFeatureSupported(null);
@@ -63,14 +65,13 @@ public class DigestMethodTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
// test DSigStructureFactory.newDigestMethod
// (String algorithm, AlgorithmParameterSpec params)
// for generating DigestMethod objects
DigestMethod dm;
- for (int i = 0; i < MD_ALGOS.length; i++) {
- String algo = MD_ALGOS[i];
+ for (String algo : MD_ALGOS) {
dm = factory.newDigestMethod(algo, null);
assertEquals(dm.getAlgorithm(), algo);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EdDSATestAbstract.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EdDSATestAbstract.java
index 879e9b96..fb16d961 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EdDSATestAbstract.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EdDSATestAbstract.java
@@ -18,13 +18,16 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
+import java.security.Security;
+
+import javax.xml.crypto.dsig.dom.DOMValidateContext;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
-import javax.xml.crypto.dsig.dom.DOMValidateContext;
-import java.security.Security;
-
/**
* Abstract/super class for EdDSA signature tests
*/
@@ -36,7 +39,7 @@ public abstract class EdDSATestAbstract {
public static final String EDDSA_KS_TYPE = "PKCS12";
private static boolean bcAddedForTheTest = false;
- @org.junit.jupiter.api.BeforeAll
+ @BeforeAll
public static void beforeAll() {
Security.insertProviderAt
(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1);
@@ -55,7 +58,7 @@ public abstract class EdDSATestAbstract {
}
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void afterAll() {
if (bcAddedForTheTest) {
Security.removeProvider(org.bouncycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EnvelopingSignatureTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EnvelopingSignatureTest.java
index 22737a72..ac0bb956 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EnvelopingSignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/EnvelopingSignatureTest.java
@@ -18,9 +18,6 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
import java.io.InputStream;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@@ -53,15 +50,18 @@ import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
/**
* A test for Enveloping XML Signature
*/
public class EnvelopingSignatureTest {
- private KeyPair rsaKeyPair;
- private XMLSignatureFactory fac;
- private KeyInfoFactory kif;
- private DocumentBuilderFactory dbf;
+ private final KeyPair rsaKeyPair;
+ private final XMLSignatureFactory fac;
+ private final KeyInfoFactory kif;
+ private final DocumentBuilderFactory dbf;
static {
Security.insertProviderAt(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/HMACSignatureAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/HMACSignatureAlgorithmTest.java
index c0492c7b..40ccdf8f 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/HMACSignatureAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/HMACSignatureAlgorithmTest.java
@@ -42,7 +42,10 @@ import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.crypto.dsig.spec.HMACParameterSpec;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
@@ -57,18 +60,18 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class HMACSignatureAlgorithmTest {
private static boolean bcInstalled;
- private KeySelector sks;
- private CanonicalizationMethod withoutComments;
- private DigestMethod sha1;
- private SignatureMethod hmacSha1, hmacSha224, hmacSha256, hmacSha384, hmacSha512, ripemd160, hmacSha256ParamSpec;
- private XMLSignatureFactory fac;
+ private final KeySelector sks;
+ private final CanonicalizationMethod withoutComments;
+ private final DigestMethod sha1;
+ private final SignatureMethod hmacSha1, hmacSha224, hmacSha256, hmacSha384, hmacSha512, ripemd160, hmacSha256ParamSpec;
+ private final XMLSignatureFactory fac;
static {
Security.insertProviderAt
(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1);
}
- @org.junit.jupiter.api.BeforeAll
+ @BeforeAll
public static void setup() throws Exception {
//
// If the BouncyCastle provider is not installed, then try to load it
@@ -112,48 +115,48 @@ public class HMACSignatureAlgorithmTest {
sks = new KeySelectors.SecretKeySelector("testkey".getBytes(StandardCharsets.US_ASCII));
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA1() throws Exception {
test_create_signature_enveloping(hmacSha1, sha1, null,
TestUtils.getSecretKey("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_224() throws Exception {
test_create_signature_enveloping(hmacSha224, sha1, null,
TestUtils.getSecretKey("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_256() throws Exception {
test_create_signature_enveloping(hmacSha256, sha1, null,
TestUtils.getSecretKey("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_256_ParamSpec() throws Exception {
test_create_signature_enveloping(hmacSha256ParamSpec, sha1, null,
TestUtils.getSecretKey("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_384() throws Exception {
test_create_signature_enveloping(hmacSha384, sha1, null,
TestUtils.getSecretKey("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACSHA_512() throws Exception {
test_create_signature_enveloping(hmacSha512, sha1, null,
TestUtils.getSecretKey("testkey".getBytes(StandardCharsets.US_ASCII)), sks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testHMACRIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(ripemd160, sha1, null,
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikCoreFeaturesTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikCoreFeaturesTest.java
index 1bf32c74..ede6adc9 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikCoreFeaturesTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikCoreFeaturesTest.java
@@ -39,6 +39,7 @@ import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolvePath;
@@ -65,7 +66,7 @@ public class IaikCoreFeaturesTest {
validator = new SignatureValidator(resolvePath(base, "coreFeatures", "signatures").toFile());
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_anonymousReferenceSignature() throws Exception {
String file = "anonymousReferenceSignature.xml";
@@ -74,7 +75,7 @@ public class IaikCoreFeaturesTest {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_manifestSignature() throws Exception {
String file = "manifestSignature.xml";
@@ -83,7 +84,7 @@ public class IaikCoreFeaturesTest {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signatureTypesSignature() throws Exception {
String file = "signatureTypesSignature.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikSignatureAlgosTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikSignatureAlgosTest.java
index 3776bd7a..7c4ffc75 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikSignatureAlgosTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikSignatureAlgosTest.java
@@ -29,6 +29,7 @@ import java.security.Security;
import javax.xml.crypto.dsig.XMLSignatureException;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolvePath;
@@ -54,7 +55,7 @@ public class IaikSignatureAlgosTest {
validator = new SignatureValidator(resolveFile(base, "signatureAlgorithms", "signatures"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_dsaSignature() throws Exception {
String file = "dSASignature.xml";
@@ -63,7 +64,7 @@ public class IaikSignatureAlgosTest {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_rsaSignature() throws Exception {
String file = "rSASignature.xml";
@@ -72,7 +73,7 @@ public class IaikSignatureAlgosTest {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_hmacShortSignature() throws Exception {
String file = "hMACShortSignature.xml";
@@ -86,7 +87,7 @@ public class IaikSignatureAlgosTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_hmacSignature() throws Exception {
String file = "hMACSignature.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikTransformsTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikTransformsTest.java
index a3a25b93..4fc8893d 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikTransformsTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/IaikTransformsTest.java
@@ -28,6 +28,7 @@ import java.security.Security;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolvePath;
@@ -52,7 +53,7 @@ public class IaikTransformsTest {
validator = new SignatureValidator(resolveFile(base, "transforms", "signatures"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_base64DecodeSignature() throws Exception {
String file = "base64DecodeSignature.xml";
@@ -62,7 +63,7 @@ public class IaikTransformsTest {
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_envelopedSignatureSignature() throws Exception {
String file = "envelopedSignatureSignature.xml";
@@ -71,7 +72,7 @@ public class IaikTransformsTest {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_c14nSignature() throws Exception {
String file = "c14nSignature.xml";
@@ -80,7 +81,7 @@ public class IaikTransformsTest {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_xPathSignature() throws Exception {
String file = "xPathSignature.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropC14nTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropC14nTest.java
index 8f3ace8c..bba16848 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropC14nTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropC14nTest.java
@@ -28,6 +28,8 @@ import java.security.Security;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -51,7 +53,7 @@ public class InteropC14nTest {
base = resolveFile("src", "test", "resources", "interop", "c14n");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_y1_exc_signature() throws Exception {
validator = new SignatureValidator(new File(base, "Y1"));
String file = "exc-signature.xml";
@@ -73,7 +75,7 @@ public class InteropC14nTest {
}
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_y3_signature() throws Exception {
validator = new SignatureValidator(new File(base, "Y3"));
String file = "signature.xml";
@@ -87,7 +89,7 @@ public class InteropC14nTest {
assertTrue(coreValidity, "Signature failed core validation#2");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_y4_signature() throws Exception {
validator = new SignatureValidator(new File(base, "Y4"));
String file = "signature.xml";
@@ -101,8 +103,8 @@ public class InteropC14nTest {
assertTrue(coreValidity, "Signature failed core validation#2");
}
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void test_y5_signature() throws Exception {
validator = new SignatureValidator(new File(base, "Y5"));
String file = "signature.xml";
@@ -116,8 +118,8 @@ public class InteropC14nTest {
assertTrue(coreValidity, "Signature failed core validation#2");
}
- @org.junit.jupiter.api.Test
- @org.junit.jupiter.api.Disabled
+ @Test
+ @Disabled
public void test_y5_signatureCommented() throws Exception {
validator = new SignatureValidator(new File(base, "Y5"));
String file = "signatureCommented.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropXMLDSig11Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropXMLDSig11Test.java
index f53c38ae..9785f47e 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropXMLDSig11Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/InteropXMLDSig11Test.java
@@ -23,10 +23,12 @@ import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
+
import javax.xml.crypto.KeySelector;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -63,131 +65,131 @@ public class InteropXMLDSig11Test {
sks = new KeySelectors.SecretKeySelector("testkey".getBytes(StandardCharsets.US_ASCII));
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p256_sha1() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p256_sha1", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p256_sha256() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p256_sha256", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p256_sha384() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p256_sha384", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p256_sha512() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p256_sha512", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p384_sha1() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p384_sha1", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p384_sha256() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p384_sha256", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p384_sha384() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p384_sha384", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p384_sha512() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p384_sha512", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p521_sha1() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p521_sha1", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p521_sha256() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p521_sha256", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p521_sha384() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p521_sha384", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_p521_sha512() throws Exception {
if (ecSupport) {
test_xmldsig11("signature-enveloping-p521_sha512", "oracle");
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_rsa_sha256() throws Exception {
test_xmldsig11("signature-enveloping-rsa-sha256", "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_rsa_sha384() throws Exception {
test_xmldsig11("signature-enveloping-rsa_sha384", "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_rsa_sha512() throws Exception {
test_xmldsig11("signature-enveloping-rsa_sha512", "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_sha256_rsa_sha256() throws Exception {
test_xmldsig11("signature-enveloping-sha256-rsa-sha256", "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_sha384_rsa_sha256() throws Exception {
test_xmldsig11("signature-enveloping-sha384-rsa_sha256", "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_sha512_rsa_sha256() throws Exception {
test_xmldsig11("signature-enveloping-sha512-rsa_sha256", "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_hmac_sha256() throws Exception {
test_xmldsig11("signature-enveloping-hmac-sha256", sks, "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_hmac_sha384() throws Exception {
test_xmldsig11("signature-enveloping-hmac-sha384", sks, "oracle");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_enveloping_hmac_sha512() throws Exception {
test_xmldsig11("signature-enveloping-hmac-sha512", sks, "oracle");
}
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenRefCountTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenRefCountTest.java
index 5ebc1873..03a04ae6 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenRefCountTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenRefCountTest.java
@@ -29,6 +29,7 @@ import org.apache.jcp.xml.dsig.internal.dom.DOMSignedInfo;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -42,7 +43,7 @@ public class JSRForbiddenRefCountTest {
Security.insertProviderAt(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testReferenceCount() throws Exception {
Element signedInfoElement =
getSignedInfoElement("src/test/resources/interop/c14n/Y4", "signature-manifest.xml");
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenReferenceTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenReferenceTest.java
index 1b854e36..7e706d59 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenReferenceTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRForbiddenReferenceTest.java
@@ -29,6 +29,7 @@ import javax.xml.crypto.dsig.dom.DOMValidateContext;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -53,7 +54,7 @@ public class JSRForbiddenReferenceTest {
}
- @org.junit.jupiter.api.Test
+ @Test
public void testLocalFilesystem() throws Exception {
String file = "signature-external-c14n-xmlatrs.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRWrappingAttackTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRWrappingAttackTest.java
index 6d56acb3..1a669806 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRWrappingAttackTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/JSRWrappingAttackTest.java
@@ -20,7 +20,6 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig;
import java.io.File;
-import java.io.FileInputStream;
import java.security.Security;
import javax.xml.crypto.dsig.XMLSignatureException;
@@ -28,6 +27,7 @@ import javax.xml.crypto.dsig.dom.DOMValidateContext;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -54,7 +54,7 @@ public class JSRWrappingAttackTest {
}
- @org.junit.jupiter.api.Test
+ @Test
public void testWrappingAttack() throws Exception {
String file = "manifestSignatureWrapping.xml";
Document doc = XMLUtils.read(new File(dir, file), false);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ManifestTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ManifestTest.java
index 25c62c58..d40f3c6d 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ManifestTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ManifestTest.java
@@ -22,8 +22,15 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.util.*;
-import javax.xml.crypto.dsig.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListIterator;
+
+import javax.xml.crypto.dsig.Manifest;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -37,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*
*/
public class ManifestTest {
- private XMLSignatureFactory fac;
+ private final XMLSignatureFactory fac;
private static Reference VALID_REF = new
TestUtils.MyOwnDOMReference("ref#1", true);
@@ -50,7 +57,7 @@ public class ManifestTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
Manifest man = null;
String id = "manifest_id";
@@ -142,7 +149,7 @@ public class ManifestTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() throws Exception {
List<Reference> refs = new ArrayList<>();
refs.add(VALID_REF);
@@ -157,7 +164,7 @@ public class ManifestTest {
assertFalse(man.isFeatureSupported("not supported"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetReferences() throws Exception {
List<Reference> refs = new ArrayList<>();
refs.add(VALID_REF);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PKSignatureAlgorithmTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PKSignatureAlgorithmTest.java
index 3416415d..5a40ec73 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PKSignatureAlgorithmTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PKSignatureAlgorithmTest.java
@@ -47,8 +47,10 @@ import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import org.apache.jcp.xml.dsig.internal.dom.RSAPSSParameterSpec;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
@@ -62,17 +64,18 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class PKSignatureAlgorithmTest {
- private KeySelector kvks;
- private CanonicalizationMethod withoutComments;
- private DigestMethod sha1;
- private SignatureMethod rsaSha1, rsaSha224, rsaSha256, rsaSha384, rsaSha512, rsaRipemd160;
- private SignatureMethod rsaSha1Mgf1, rsaSha224Mgf1, rsaSha256Mgf1, rsaSha384Mgf1, rsaSha512Mgf1, rsaPss, rsaPssSha512;
- private SignatureMethod ecdsaSha1, ecdsaSha224, ecdsaSha256, ecdsaSha384, ecdsaSha512, ecdsaRipemd160;
- private XMLSignatureFactory fac;
- private KeyPair rsaKeyPair, ecKeyPair;
- private KeyInfo rsaki, ecki;
+ private final KeySelector kvks;
+ private final CanonicalizationMethod withoutComments;
+ private final DigestMethod sha1;
+ private final SignatureMethod rsaSha1, rsaSha224, rsaSha256, rsaSha384, rsaSha512, rsaRipemd160;
+ private final SignatureMethod rsaSha1Mgf1, rsaSha224Mgf1, rsaSha256Mgf1, rsaSha384Mgf1, rsaSha512Mgf1, rsaPss, rsaPssSha512;
+ private final SignatureMethod ecdsaSha1, ecdsaSha224, ecdsaSha256, ecdsaSha384, ecdsaSha512, ecdsaRipemd160;
+ private final XMLSignatureFactory fac;
+ private final KeyPair rsaKeyPair, ecKeyPair;
+ private final KeyInfo rsaki;
+ private KeyInfo ecki;
private boolean ecAlgParamsSupport = true;
- private boolean isJDK11;
+ private final boolean isJDK11;
private static boolean bcInstalled;
static {
@@ -168,133 +171,133 @@ public class PKSignatureAlgorithmTest {
isJDK11 = System.getProperty("java.version").startsWith("11");
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA1() throws Exception {
test_create_signature_enveloping(rsaSha1, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_224() throws Exception {
test_create_signature_enveloping(rsaSha224, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_256() throws Exception {
test_create_signature_enveloping(rsaSha256, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_384() throws Exception {
test_create_signature_enveloping(rsaSha384, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA_512() throws Exception {
test_create_signature_enveloping(rsaSha512, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_RIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaRipemd160, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA1_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha1Mgf1, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA224_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha224Mgf1, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA256_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha256Mgf1, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA384_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha384Mgf1, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_SHA512_MGF1() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha512Mgf1, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_PSS() throws Exception {
Assumptions.assumeTrue(bcInstalled || org.apache.xml.security.test.dom.TestUtils.isJava11Compatible());
test_create_signature_enveloping(rsaPss, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRSA_PSS_SHA512() throws Exception {
Assumptions.assumeTrue(bcInstalled || org.apache.xml.security.test.dom.TestUtils.isJava11Compatible());
test_create_signature_enveloping(rsaPssSha512, sha1, rsaki,
rsaKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA1() throws Exception {
Assumptions.assumeTrue(ecAlgParamsSupport && ecki != null && !isJDK11);
test_create_signature_enveloping(ecdsaSha1, sha1, ecki,
ecKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA224() throws Exception {
Assumptions.assumeTrue(ecAlgParamsSupport && ecki != null && !isJDK11);
test_create_signature_enveloping(ecdsaSha224, sha1, ecki,
ecKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA256() throws Exception {
Assumptions.assumeTrue(ecAlgParamsSupport && ecki != null && !isJDK11);
test_create_signature_enveloping(ecdsaSha256, sha1, ecki,
ecKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA384() throws Exception {
Assumptions.assumeTrue(ecAlgParamsSupport && ecki != null && !isJDK11);
test_create_signature_enveloping(ecdsaSha384, sha1, ecki,
ecKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_SHA512() throws Exception {
Assumptions.assumeTrue(ecAlgParamsSupport && ecki != null && !isJDK11);
test_create_signature_enveloping(ecdsaSha512, sha1, ecki,
ecKeyPair.getPrivate(), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testECDSA_RIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
Assumptions.assumeTrue(ecAlgParamsSupport && ecki != null);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3Test.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3Test.java
index 9c2b0b63..73aea3eb 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3Test.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3Test.java
@@ -25,6 +25,7 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.security.Security;
+
import javax.xml.crypto.KeySelector;
import javax.xml.crypto.URIDereferencer;
import javax.xml.crypto.dsig.XMLSignatureException;
@@ -32,6 +33,7 @@ import javax.xml.crypto.dsig.dom.DOMValidateContext;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -60,7 +62,7 @@ public class PhaosXMLDSig3Test {
ud = new LocalHttpCacheURIDereferencer();
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_dsa_detached() throws Exception {
String file = "signature-dsa-detached.xml";
@@ -73,7 +75,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_dsa_enveloped() throws Exception {
String file = "signature-dsa-enveloped.xml";
@@ -82,7 +84,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_dsa_enveloping() throws Exception {
String file = "signature-dsa-enveloping.xml";
@@ -91,7 +93,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_dsa_manifest() throws Exception {
String file = "signature-dsa-manifest.xml";
@@ -100,7 +102,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_hmac_sha1_40_c14n_comments_detached()
throws Exception {
String file = "signature-hmac-sha1-40-c14n-comments-detached.xml";
@@ -116,7 +118,7 @@ public class PhaosXMLDSig3Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_hmac_sha1_40_exclusive_c14n_comments_detached()
throws Exception {
String file = "signature-hmac-sha1-40-exclusive-c14n-comments-detached.xml";
@@ -132,7 +134,7 @@ public class PhaosXMLDSig3Test {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_hmac_sha1_exclusive_c14n_comments_detached()
throws Exception {
String file = "signature-hmac-sha1-exclusive-c14n-comments-detached.xml";
@@ -143,7 +145,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_hmac_sha1_exclusive_c14n_enveloped()
throws Exception {
String file = "signature-hmac-sha1-exclusive-c14n-enveloped.xml";
@@ -154,7 +156,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_detached_b64_transform() throws Exception {
String file = "signature-rsa-detached-b64-transform.xml";
@@ -163,7 +165,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_detached_xpath_transform() throws Exception {
String file = "signature-rsa-detached-xpath-transform.xml";
@@ -172,7 +174,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_detached_xslt_transform_bad_rm() throws Exception {
String file = "signature-rsa-detached-xslt-transform-bad-retrieval-method.xml";
@@ -184,7 +186,7 @@ public class PhaosXMLDSig3Test {
} catch (XMLSignatureException xse) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_detached_xslt_transform_rm() throws Exception {
String file = "signature-rsa-detached-xslt-transform-retrieval-method.xml";
@@ -194,7 +196,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_detached_xslt_transform() throws Exception {
String file = "signature-rsa-detached-xslt-transform.xml";
@@ -203,7 +205,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_detached() throws Exception {
String file = "signature-rsa-detached.xml";
@@ -215,7 +217,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_enveloped_bad_digest_val() throws Exception {
String file = "signature-rsa-enveloped-bad-digest-val.xml";
@@ -224,7 +226,7 @@ public class PhaosXMLDSig3Test {
assertFalse(coreValidity, "Signature should fail core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_enveloped() throws Exception {
String file = "signature-rsa-enveloped.xml";
@@ -233,7 +235,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_enveloping() throws Exception {
String file = "signature-rsa-enveloping.xml";
@@ -242,7 +244,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_manifest_x509_data_cert_chain() throws Exception {
String file = "signature-rsa-manifest-x509-data-cert-chain.xml";
@@ -251,7 +253,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_manifest_x509_data_cert() throws Exception {
String file = "signature-rsa-manifest-x509-data-cert.xml";
@@ -260,7 +262,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_manifest_x509_data_issuer_serial() throws Exception {
String file = "signature-rsa-manifest-x509-data-issuer-serial.xml";
@@ -269,7 +271,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_manifest_x509_data_ski() throws Exception {
String file = "signature-rsa-manifest-x509-data-ski.xml";
@@ -278,7 +280,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_manifest_x509_data_subject_name() throws Exception {
String file = "signature-rsa-manifest-x509-data-subject-name.xml";
@@ -287,7 +289,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_manifest_x509_data() throws Exception {
String file = "signature-rsa-manifest-x509-data.xml";
@@ -296,7 +298,7 @@ public class PhaosXMLDSig3Test {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_manifest() throws Exception {
String file = "signature-rsa-manifest.xml";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3XalanTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3XalanTest.java
index 59140201..250fc263 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3XalanTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/PhaosXMLDSig3XalanTest.java
@@ -28,6 +28,7 @@ import java.security.Security;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import static org.apache.xml.security.test.XmlSecTestEnvironment.resolveFile;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -64,7 +65,7 @@ public class PhaosXMLDSig3XalanTest {
validator = new SignatureValidator(base);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_rsa_xpath_transform_enveloped() throws Exception {
String file = "signature-rsa-xpath-transform-enveloped.xml";
boolean coreValidity = validator.validate(file, new KeySelectors.RawX509KeySelector());
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ReferenceTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ReferenceTest.java
index a4824df9..246c3e93 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ReferenceTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ReferenceTest.java
@@ -22,17 +22,34 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.io.*;
+import java.io.InputStream;
import java.security.MessageDigest;
import java.security.Security;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+
import javax.xml.crypto.URIDereferencer;
-import javax.xml.crypto.dsig.*;
-import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.Transform;
+import javax.xml.crypto.dsig.XMLSignContext;
+import javax.xml.crypto.dsig.XMLSignature;
+import javax.xml.crypto.dsig.XMLSignatureException;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+import javax.xml.crypto.dsig.XMLValidateContext;
import javax.xml.crypto.dsig.dom.DOMSignContext;
import javax.xml.crypto.dsig.dom.DOMValidateContext;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.crypto.dsig.spec.TransformParameterSpec;
+
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@@ -49,10 +66,10 @@ import static org.junit.jupiter.api.Assertions.fail;
*
*/
public class ReferenceTest {
- private XMLSignatureFactory fac;
- private KeyInfoFactory kifac;
- private DigestMethod dmSHA1;
- private String uri = "http://www.ietf.org/rfc/rfc3275.txt";
+ private final XMLSignatureFactory fac;
+ private final KeyInfoFactory kifac;
+ private final DigestMethod dmSHA1;
+ private final String uri = "http://www.ietf.org/rfc/rfc3275.txt";
private static final String[] CRYPTO_ALGS = { "RSA", "DSA" };
private static final String[] SIG_ALGS = {
@@ -74,7 +91,7 @@ public class ReferenceTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
Reference ref;
// test XMLSignatureFactory.newReference(String uri,
@@ -185,7 +202,7 @@ public class ReferenceTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() throws Exception {
Reference ref = fac.newReference(null, dmSHA1, null, null, null);
try {
@@ -196,12 +213,12 @@ public class ReferenceTest {
assertFalse(ref.isFeatureSupported("not supported"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testvalidate() throws Exception {
testvalidate(false);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testvalidateWithCaching() throws Exception {
testvalidate(true);
}
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SecureXSLTTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SecureXSLTTest.java
index ab486357..201a16ed 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SecureXSLTTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SecureXSLTTest.java
@@ -28,6 +28,7 @@ import javax.xml.crypto.dsig.dom.DOMValidateContext;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -45,17 +46,17 @@ public class SecureXSLTTest {
Security.insertProviderAt(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignature1() throws Exception {
testSignature(new File(BASEDIR, "signature1.xml"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignature2() throws Exception {
testSignature(new File(BASEDIR, "signature2.xml"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignature3() throws Exception {
testSignature(new File(BASEDIR, "signature3.xml"));
}
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureDigestMethodTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureDigestMethodTest.java
index 7f8d283f..8ec45b5f 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureDigestMethodTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureDigestMethodTest.java
@@ -40,6 +40,7 @@ import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
@@ -53,13 +54,13 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class SignatureDigestMethodTest {
- private KeySelector kvks;
- private CanonicalizationMethod withoutComments;
- private DigestMethod sha1, sha224, sha256, sha384, sha512, ripemd160,
+ private final KeySelector kvks;
+ private final CanonicalizationMethod withoutComments;
+ private final DigestMethod sha1, sha224, sha256, sha384, sha512, ripemd160,
whirlpool, sha3_224, sha3_256, sha3_384, sha3_512;
- private SignatureMethod rsaSha1;
- private KeyInfo rsaki;
- private XMLSignatureFactory fac;
+ private final SignatureMethod rsaSha1;
+ private final KeyInfo rsaki;
+ private final XMLSignatureFactory fac;
private boolean bcInstalled;
static {
@@ -98,72 +99,72 @@ public class SignatureDigestMethodTest {
kvks = new KeySelectors.KeyValueKeySelector();
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA1() throws Exception {
test_create_signature_enveloping(rsaSha1, sha1, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA224() throws Exception {
test_create_signature_enveloping(rsaSha1, sha224, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA256() throws Exception {
test_create_signature_enveloping(rsaSha1, sha256, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA384() throws Exception {
test_create_signature_enveloping(rsaSha1, sha384, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA512() throws Exception {
test_create_signature_enveloping(rsaSha1, sha512, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testRIPEMD160() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha1, ripemd160, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testWHIRLPOOL() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha1, whirlpool, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_224() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha1, sha3_224, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_256() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha1, sha3_256, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_384() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha1, sha3_384, rsaki,
TestUtils.getPrivateKey("RSA"), kvks);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSHA3_512() throws Exception {
Assumptions.assumeTrue(bcInstalled);
test_create_signature_enveloping(rsaSha1, sha3_512, rsaki,
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureMethodTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureMethodTest.java
index 59872a91..6b9d8251 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureMethodTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignatureMethodTest.java
@@ -21,10 +21,13 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import javax.xml.crypto.dsig.*;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
-import java.security.*;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -51,11 +54,10 @@ public class SignatureMethodTest {
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() throws Exception {
SignatureMethod sm;
- for (int i = 0; i < SIG_ALGOS.length; i++) {
- String algo = SIG_ALGOS[i];
+ for (String algo : SIG_ALGOS) {
sm = factory.newSignatureMethod(algo, null);
try {
sm.isFeatureSupported(null);
@@ -66,14 +68,13 @@ public class SignatureMethodTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
// test XMLSignatureFactory.newAlgorithmMethod
// (String algorithm, AlgorithmParameterSpec params)
// for generating SignatureMethod objects
SignatureMethod sm;
- for (int i = 0; i < SIG_ALGOS.length; i++) {
- String algo = SIG_ALGOS[i];
+ for (String algo : SIG_ALGOS) {
sm = factory.newSignatureMethod(algo, null);
assertEquals(sm.getAlgorithm(), algo);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertiesTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertiesTest.java
index 389560a4..df98c392 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertiesTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertiesTest.java
@@ -22,8 +22,15 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.util.*;
-import javax.xml.crypto.dsig.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.crypto.dsig.SignatureProperties;
+import javax.xml.crypto.dsig.SignatureProperty;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,9 +45,9 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class SignaturePropertiesTest {
- private XMLSignatureFactory factory;
- private String id = "id";
- private SignatureProperty prop;
+ private final XMLSignatureFactory factory;
+ private final String id = "id";
+ private final SignatureProperty prop;
public SignaturePropertiesTest() throws Exception {
factory = XMLSignatureFactory.getInstance
@@ -51,7 +58,7 @@ public class SignaturePropertiesTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test XMLSignatureFactory.newSignatureProperties(List, String)
SignatureProperties props;
@@ -103,7 +110,7 @@ public class SignaturePropertiesTest {
assertEquals(props.getId(), id);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
List<SignatureProperty> list = new ArrayList<>();
list.add(prop);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertyTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertyTest.java
index 83e1199d..8ab1ed5c 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertyTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignaturePropertyTest.java
@@ -22,9 +22,14 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.xml.crypto.XMLStructure;
-import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dsig.SignatureProperty;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -39,9 +44,9 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class SignaturePropertyTest {
- private XMLSignatureFactory factory;
- private String target = "target";
- private String id = "id";
+ private final XMLSignatureFactory factory;
+ private final String target = "target";
+ private final String id = "id";
public SignaturePropertyTest() throws Exception {
factory = XMLSignatureFactory.getInstance
@@ -49,7 +54,7 @@ public class SignaturePropertyTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test XMLSignatureFactory.newSignatureProperty(List, String, String)
SignatureProperty prop;
@@ -106,7 +111,7 @@ public class SignaturePropertyTest {
assertNotNull(prop);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
List<XMLStructure> list = new ArrayList<>();
list.add(new TestUtils.MyOwnXMLStructure());
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignedInfoTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignedInfoTest.java
index 524d0f28..14fefb81 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignedInfoTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/SignedInfoTest.java
@@ -23,10 +23,19 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig;
import java.security.Security;
-import java.util.*;
-import javax.xml.crypto.dsig.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.SignedInfo;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
+import org.junit.jupiter.api.Test;
+
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -39,10 +48,10 @@ import static org.junit.jupiter.api.Assertions.fail;
*
*/
public class SignedInfoTest {
- private XMLSignatureFactory fac;
- private CanonicalizationMethod cm;
- private SignatureMethod sm;
- private List<Reference> references;
+ private final XMLSignatureFactory fac;
+ private final CanonicalizationMethod cm;
+ private final SignatureMethod sm;
+ private final List<Reference> references;
static {
Security.insertProviderAt
@@ -63,7 +72,7 @@ public class SignedInfoTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test XMLSignatureFactory.newSignedInfo(
// CanonicalizationMethod cm,
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/TransformTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/TransformTest.java
index 4471ac43..d76f3f93 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/TransformTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/TransformTest.java
@@ -21,17 +21,21 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Security;
import java.util.Collections;
+
import javax.xml.crypto.XMLStructure;
-import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dsig.Transform;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
import javax.xml.crypto.dsig.spec.TransformParameterSpec;
-import javax.xml.crypto.dsig.spec.XPathType;
-import javax.xml.crypto.dsig.spec.XPathFilterParameterSpec;
import javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec;
+import javax.xml.crypto.dsig.spec.XPathFilterParameterSpec;
+import javax.xml.crypto.dsig.spec.XPathType;
import javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec;
-
-import java.security.*;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -65,11 +69,10 @@ public class TransformTest {
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() throws Exception {
Transform tm;
- for (int i = 0; i < TRANSFORM_ALGOS.length; i++) {
- String algo = TRANSFORM_ALGOS[i];
+ for (String algo : TRANSFORM_ALGOS) {
TransformParameterSpec params = null;
if (algo.equals(Transform.XPATH)) {
params = new XPathFilterParameterSpec("xPath");
@@ -83,7 +86,7 @@ public class TransformTest {
tm = factory.newTransform(algo, params);
try {
tm.isFeatureSupported(null);
- fail(TRANSFORM_ALGOS[i] +
+ fail(algo +
": Should raise a NPE for null feature");
} catch (NullPointerException npe) {}
@@ -91,14 +94,13 @@ public class TransformTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
// test newTransform(String algorithm,
// AlgorithmParameterSpec params)
// for generating Transform objects
Transform tm;
- for (int i = 0; i < TRANSFORM_ALGOS.length; i++) {
- String algo = TRANSFORM_ALGOS[i];
+ for (String algo : TRANSFORM_ALGOS) {
TransformParameterSpec params = null;
if (algo.equals(Transform.XPATH)) {
params = new XPathFilterParameterSpec("xPath");
@@ -115,16 +117,16 @@ public class TransformTest {
assertEquals(tm.getAlgorithm(), algo);
assertEquals(tm.getParameterSpec(), params);
} catch (Exception ex) {
- fail(TRANSFORM_ALGOS[i] + ": Unexpected exception " + ex);
+ fail(algo + ": Unexpected exception " + ex);
}
try {
tm = factory.newTransform
(algo, new TestUtils.MyOwnC14nParameterSpec());
- fail(TRANSFORM_ALGOS[i] +
+ fail(algo +
": Should raise an IAPE for invalid parameters");
} catch (InvalidAlgorithmParameterException iape) {
} catch (Exception ex) {
- fail(TRANSFORM_ALGOS[i] +
+ fail(algo +
": Should raise a IAPE instead of " + ex);
}
}
@@ -148,6 +150,7 @@ public class TransformTest {
}
private static class XSLTStructure implements XMLStructure {
+ @Override
public boolean isFeatureSupported(String feature) { return false; }
}
}
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ValidateSignatureTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ValidateSignatureTest.java
index 9d04eb39..0ba22d5d 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ValidateSignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/ValidateSignatureTest.java
@@ -35,6 +35,7 @@ import javax.xml.crypto.dsig.dom.DOMValidateContext;
import org.apache.xml.security.test.javax.xml.crypto.KeySelectors;
import org.apache.xml.security.utils.resolver.ResourceResolver;
import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -68,7 +69,7 @@ public class ValidateSignatureTest {
* Validates a signature that references an element with an ID attribute.
* The element's ID needs to be registered so that it can be found.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_with_ID() throws Exception {
String file = "envelopingSignature.xml";
@@ -81,7 +82,7 @@ public class ValidateSignatureTest {
assertTrue(coreValidity, "Signature failed core validation");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_external_c14n_xmlattrs() throws Exception {
String file = "signature-external-c14n-xmlatrs.xml";
@@ -93,7 +94,7 @@ public class ValidateSignatureTest {
/**
* This test checks that the signature is verified before the references.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test_invalid_signature() throws Exception {
InvalidURIDereferencer ud = new InvalidURIDereferencer();
@@ -103,7 +104,7 @@ public class ValidateSignatureTest {
assertTrue(ud.dereferenced, "References validated before signature");
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_hmac_sha1_trunclen_0() throws Exception {
try {
validator.validate
@@ -116,7 +117,7 @@ public class ValidateSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_enveloping_hmac_sha1_trunclen_8() throws Exception {
try {
@@ -132,7 +133,7 @@ public class ValidateSignatureTest {
// Bug 47761: validates an xml signature containing a reference with
// xmlns:xml attributes. C14n should not emit these attributes.
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_exclc14n_xmlnamespace() throws Exception {
String file = "demo.signed.xml";
boolean coreValidity = validator.validate(file,
@@ -143,7 +144,7 @@ public class ValidateSignatureTest {
// Bug https://issues.apache.org/jira/browse/SANTUARIO-295
// Validates a signature with an XPathFilter2 Transform with an intersect
// filter that produces an empty node-set.
- @org.junit.jupiter.api.Test
+ @Test
public void test_signature_xpathfilter2() throws Exception {
String file = "xmldsig-xfilter2.xml";
boolean coreValidity = validator.validate
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/X509KeySelector.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/X509KeySelector.java
index 2c31902e..10223a7c 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/X509KeySelector.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/X509KeySelector.java
@@ -26,16 +26,30 @@ import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.PublicKey;
+import java.security.cert.CertSelector;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
-import java.security.cert.CertSelector;
-import java.security.cert.X509Certificate;
import java.security.cert.X509CertSelector;
-import java.util.*;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+
import javax.security.auth.x500.X500Principal;
-import javax.xml.crypto.*;
-import javax.xml.crypto.dsig.*;
-import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.AlgorithmMethod;
+import javax.xml.crypto.KeySelector;
+import javax.xml.crypto.KeySelectorException;
+import javax.xml.crypto.KeySelectorResult;
+import javax.xml.crypto.OctetStreamData;
+import javax.xml.crypto.XMLCryptoContext;
+import javax.xml.crypto.XMLStructure;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.keyinfo.KeyInfo;
+import javax.xml.crypto.dsig.keyinfo.KeyName;
+import javax.xml.crypto.dsig.keyinfo.RetrievalMethod;
+import javax.xml.crypto.dsig.keyinfo.X509Data;
+import javax.xml.crypto.dsig.keyinfo.X509IssuerSerial;
import org.apache.jcp.xml.dsig.internal.dom.DOMRetrievalMethod;
@@ -60,7 +74,7 @@ import org.apache.jcp.xml.dsig.internal.dom.DOMRetrievalMethod;
*/
public class X509KeySelector extends KeySelector {
- private KeyStore ks;
+ private final KeyStore ks;
private boolean trusted = true;
/**
@@ -127,6 +141,7 @@ public class X509KeySelector extends KeySelector {
* @throws ClassCastException if the data type of <code>method</code>
* is not supported by this key selector
*/
+ @Override
public KeySelectorResult select(KeyInfo keyInfo,
KeySelector.Purpose purpose, AlgorithmMethod method,
XMLCryptoContext context) throws KeySelectorException {
@@ -264,6 +279,7 @@ public class X509KeySelector extends KeySelector {
private static class SimpleKeySelectorResult implements KeySelectorResult {
private final Key key;
SimpleKeySelectorResult(Key key) { this.key = key; }
+ @Override
public Key getKey() { return key; }
}
@@ -353,10 +369,7 @@ public class X509KeySelector extends KeySelector {
return ksr;
}
if (!certs.isEmpty() && !trusted) {
- // try to find public key in certs in X509Data
- Iterator<X509Certificate> i = certs.iterator();
- while (i.hasNext()) {
- X509Certificate cert = i.next();
+ for (X509Certificate cert : certs) {
if (subjectcs.match(cert)) {
return new SimpleKeySelectorResult(cert.getPublicKey());
}
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLObjectTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLObjectTest.java
index 3cfb0f32..6c6c827f 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLObjectTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLObjectTest.java
@@ -22,9 +22,14 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.xml.crypto.XMLStructure;
-import javax.xml.crypto.dsig.*;
+import javax.xml.crypto.dsig.XMLObject;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -39,10 +44,10 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class XMLObjectTest {
- private XMLSignatureFactory factory;
- private String id = "id";
- private String mimeType = "mime";
- private String encoding = "encoding";
+ private final XMLSignatureFactory factory;
+ private final String id = "id";
+ private final String mimeType = "mime";
+ private final String encoding = "encoding";
public XMLObjectTest() throws Exception {
factory = XMLSignatureFactory.getInstance
@@ -50,7 +55,7 @@ public class XMLObjectTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test XMLSignatureFactory.newXMLObject(List, String, String, String)
XMLObject obj;
@@ -93,7 +98,7 @@ public class XMLObjectTest {
assertArrayEquals(unmodifiable.toArray(), list.toArray());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
List<XMLStructure> list = new ArrayList<>();
list.add(new TestUtils.MyOwnXMLStructure());
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignContextTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignContextTest.java
index 53727683..c6d28171 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignContextTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignContextTest.java
@@ -21,15 +21,16 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import javax.xml.crypto.dsig.*;
-import javax.xml.crypto.dsig.dom.DOMSignContext;
-import javax.xml.crypto.KeySelector;
-import javax.xml.crypto.URIDereferencer;
-
+import java.security.Key;
-import java.security.*;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
+import javax.xml.crypto.KeySelector;
+import javax.xml.crypto.URIDereferencer;
+import javax.xml.crypto.dsig.XMLSignContext;
+import javax.xml.crypto.dsig.dom.DOMSignContext;
+
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -43,9 +44,9 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class XMLSignContextTest {
- private XMLSignContext defContext;
- private Key[] KEYS;
- private Document doc;
+ private final XMLSignContext defContext;
+ private final Key[] KEYS;
+ private final Document doc;
public XMLSignContextTest() throws Exception {
// set up the signingKeys
@@ -59,7 +60,7 @@ public class XMLSignContextTest {
defContext = new DOMSignContext(sk, doc);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetBaseURI() throws Exception {
assertNull(defContext.getBaseURI());
@@ -71,7 +72,7 @@ public class XMLSignContextTest {
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetProperty() throws Exception {
String name = "key";
assertNull(defContext.getProperty(name));
@@ -92,7 +93,7 @@ public class XMLSignContextTest {
assertNull(defContext.getProperty(name));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetURIDereferencer() throws Exception {
assertNull(defContext.getURIDereferencer());
byte[] data = "simpleDereferencer".getBytes();
@@ -104,7 +105,7 @@ public class XMLSignContextTest {
assertNull(defContext.getURIDereferencer());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetKeySelector() throws Exception {
defContext.setKeySelector(null);
assertNull(defContext.getKeySelector());
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureFactoryTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureFactoryTest.java
index d5457d6c..8e10be4d 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureFactoryTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureFactoryTest.java
@@ -38,6 +38,7 @@ import javax.xml.crypto.dsig.dom.DOMValidateContext;
import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -66,7 +67,7 @@ public class XMLSignatureFactoryTest {
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetInstance() {
try {
XMLSignatureFactory.getInstance("non-existent");
@@ -99,13 +100,13 @@ public class XMLSignatureFactoryTest {
} catch (NullPointerException npe) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetMechanismType() {
assertNotNull(factory);
assertEquals("DOM", factory.getMechanismType());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
try {
factory.isFeatureSupported(null);
@@ -115,14 +116,14 @@ public class XMLSignatureFactoryTest {
assertFalse(factory.isFeatureSupported("not supported"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetKeyInfoFactory() throws Exception {
KeyInfoFactory kifac = factory.getKeyInfoFactory();
assertEquals(kifac.getMechanismType(), factory.getMechanismType());
assertEquals(kifac.getProvider(), factory.getProvider());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testunmarshalXMLSignature() throws Exception {
XMLSignature stuff;
try {
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureTest.java
index 2893138c..559746b6 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLSignatureTest.java
@@ -60,6 +60,7 @@ import javax.xml.crypto.dsig.spec.TransformParameterSpec;
import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -129,7 +130,7 @@ public class XMLSignatureTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
XMLSignature sig = null;
// test XMLSignatureFactory.newXMLSignature(SignedInfo, KeyInfo)
@@ -178,7 +179,7 @@ public class XMLSignatureTest {
assertEquals(sig.getSignedInfo(), defSi);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() throws Exception {
XMLSignature sig = fac.newXMLSignature(defSi, null);
@@ -191,7 +192,7 @@ public class XMLSignatureTest {
assertFalse(sig.isFeatureSupported("not supported"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsignANDvalidate() throws Exception {
XMLSignature sig;
SignedInfo si;
@@ -224,7 +225,7 @@ public class XMLSignatureTest {
assertTrue(status);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignWithProvider() throws Exception {
XMLSignature sig;
SignedInfo si;
@@ -260,7 +261,7 @@ public class XMLSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignWithEmptyNSPrefix() throws Exception {
SignedInfo si = createSignedInfo(SIG_METHODS[1]);
KeyInfo ki = kifac.newKeyInfo(Collections.singletonList
@@ -278,7 +279,7 @@ public class XMLSignatureTest {
*/
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignWithReferenceManifestDependencies() throws Exception {
// create references
DigestMethod dm = fac.newDigestMethod(DigestMethod.SHA1, null);
@@ -335,7 +336,7 @@ public class XMLSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSignTemplateWithObjectNSDefs() throws Exception {
File f = resolveFile(
"src/test/resources/org/apache/xml/security/test/javax/xml/crypto/dsig/signature-enveloping-rsa-template.xml");
@@ -372,7 +373,7 @@ public class XMLSignatureTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCreateSignatureWithEmptyId() throws Exception {
// create references
DigestMethod dm = fac.newDigestMethod(DigestMethod.SHA1, null);
@@ -401,7 +402,7 @@ public class XMLSignatureTest {
sig.sign(dsc);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testCreateDSA2048Signature() throws Exception {
// check if SHA256withDSA is supported
@@ -428,7 +429,7 @@ public class XMLSignatureTest {
assertTrue(sig.validate(validateContext));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testBadXPointer() throws Exception {
Document doc = TestUtils.newDocument();
Element root = doc.createElementNS(null, "Root");
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLValidateContextTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLValidateContextTest.java
index fbf76226..6bd83091 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLValidateContextTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/XMLValidateContextTest.java
@@ -21,13 +21,14 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig;
-import javax.xml.crypto.*;
-import javax.xml.crypto.dsig.dom.DOMValidateContext;
-import javax.xml.crypto.dsig.*;
-
-
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
+import javax.xml.crypto.KeySelector;
+import javax.xml.crypto.URIDereferencer;
+import javax.xml.crypto.dsig.XMLValidateContext;
+import javax.xml.crypto.dsig.dom.DOMValidateContext;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -40,8 +41,8 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class XMLValidateContextTest {
- private XMLValidateContext defContext;
- private KeySelector[] KEY_SELECTORS;
+ private final XMLValidateContext defContext;
+ private final KeySelector[] KEY_SELECTORS;
public XMLValidateContextTest() throws Exception {
// set up the default XMLValidateContext
@@ -53,18 +54,18 @@ public class XMLValidateContextTest {
KEY_SELECTORS[0] = KeySelector.singletonKeySelector(sk);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetKeySelector() throws Exception {
defContext.setKeySelector(null);
assertNull(defContext.getKeySelector());
- for (int i = 0; i < KEY_SELECTORS.length; i++) {
- defContext.setKeySelector(KEY_SELECTORS[i]);
- assertEquals(defContext.getKeySelector(), KEY_SELECTORS[i]);
+ for (KeySelector element : KEY_SELECTORS) {
+ defContext.setKeySelector(element);
+ assertEquals(defContext.getKeySelector(), element);
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetBaseURI() throws Exception {
assertNull(defContext.getBaseURI());
@@ -75,7 +76,7 @@ public class XMLValidateContextTest {
assertNull(defContext.getBaseURI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetProperty() throws Exception {
String name = "key";
assertNull(defContext.getProperty(name));
@@ -96,7 +97,7 @@ public class XMLValidateContextTest {
assertNull(defContext.getProperty(name));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testsetngetURIDereferencer() throws Exception {
assertNull(defContext.getURIDereferencer());
byte[] data = "simpleDereferencer".getBytes();
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/dom/DOMValidateContextTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/dom/DOMValidateContextTest.java
index 9c452a69..b2bdad44 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/dom/DOMValidateContextTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/dom/DOMValidateContextTest.java
@@ -28,6 +28,7 @@ import javax.xml.crypto.dsig.dom.DOMValidateContext;
import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.javax.xml.crypto.dsig.TestUtils;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -49,7 +50,7 @@ public class DOMValidateContextTest {
domVC = (DOMValidateContext) TestUtils.getXMLValidateContext("DOM", input, "Reference");
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() throws Exception {
assertNotNull(domVC);
try {
@@ -61,7 +62,7 @@ public class DOMValidateContextTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSetGetProperty() throws Exception {
try {
domVC.setProperty(null, "value");
@@ -84,7 +85,7 @@ public class DOMValidateContextTest {
assertEquals(domVC.getProperty(pname), pvalue2);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testSetGetNode() throws Exception {
try {
domVC.setNode(null);
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoFactoryTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoFactoryTest.java
index 46159f29..e6145dee 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoFactoryTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoFactoryTest.java
@@ -23,11 +23,21 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig.keyinfo;
import java.math.BigInteger;
-import java.util.*;
import java.security.KeyException;
import java.security.PublicKey;
-import javax.xml.crypto.dsig.keyinfo.*;
-import javax.xml.crypto.*;
+import java.util.Collections;
+
+import javax.xml.crypto.NoSuchMechanismException;
+import javax.xml.crypto.dsig.keyinfo.KeyInfo;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.KeyName;
+import javax.xml.crypto.dsig.keyinfo.KeyValue;
+import javax.xml.crypto.dsig.keyinfo.PGPData;
+import javax.xml.crypto.dsig.keyinfo.RetrievalMethod;
+import javax.xml.crypto.dsig.keyinfo.X509Data;
+import javax.xml.crypto.dsig.keyinfo.X509IssuerSerial;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -49,7 +59,7 @@ public class KeyInfoFactoryTest {
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetInstance() {
try {
KeyInfoFactory.getInstance("non-existent");
@@ -62,13 +72,13 @@ public class KeyInfoFactoryTest {
} catch (NullPointerException npe) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetMechanismType() {
assertNotNull(factory);
assertEquals("DOM", factory.getMechanismType());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
try {
factory.isFeatureSupported(null);
@@ -78,7 +88,7 @@ public class KeyInfoFactoryTest {
assertFalse(factory.isFeatureSupported("not supported"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testnewKeyInfo() {
String id = "keyId";
// test newKeyInfo(List, String)
@@ -91,7 +101,7 @@ public class KeyInfoFactoryTest {
} catch (NullPointerException npe) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testnewKeyName() {
final String name = "keyName";
KeyName kn = factory.newKeyName(name);
@@ -102,18 +112,21 @@ public class KeyInfoFactoryTest {
} catch (NullPointerException npe) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testnewKeyValue() {
// test newKeyValue(PublicKey pk)
PublicKey myPubKey = new PublicKey() {
private static final long serialVersionUID = 2756606866185189114L;
+ @Override
public byte[] getEncoded() {
return new byte[20];
}
+ @Override
public String getFormat() {
return "none";
}
+ @Override
public String getAlgorithm() {
return "test";
}
@@ -132,7 +145,7 @@ public class KeyInfoFactoryTest {
} catch (NullPointerException npe) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testnewPGPKeyId() {
byte[] valid_id = {
0x01, 0x02, 0x03, 0x04,
@@ -180,7 +193,7 @@ public class KeyInfoFactoryTest {
} catch (IllegalArgumentException ex) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testnewRetrievalMethod() throws Exception {
final String uri = "#X509CertChain";
// test RetrievalMethod(String)
@@ -209,7 +222,7 @@ public class KeyInfoFactoryTest {
assertEquals(type, rm.getType());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testnewX509Data() {
// test newX509Data(List)
X509Data x509 =
@@ -217,7 +230,7 @@ public class KeyInfoFactoryTest {
assertNotNull(x509);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testnewX509IssuerSerial() {
String name = "CN=valeriep";
// test newX509IssuerSerial(String, BigInteger)
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoTest.java
index 9c7f9c05..5bce58bf 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyInfoTest.java
@@ -34,6 +34,7 @@ import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
import org.apache.jcp.xml.dsig.internal.dom.DOMUtils;
import org.apache.xml.security.test.dom.TestUtils;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -49,21 +50,21 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class KeyInfoTest {
- private KeyInfoFactory fac;
+ private final KeyInfoFactory fac;
public KeyInfoTest() throws Exception {
fac = KeyInfoFactory.getInstance
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetId() {
KeyInfo ki = fac.newKeyInfo
(Collections.singletonList(fac.newKeyName("foo")), "skeleton");
assertNotNull(ki.getId());
}
- @org.junit.jupiter.api.Test
+ @Test
@SuppressWarnings("unchecked")
public void testgetContent() {
KeyInfo[] infos = new KeyInfo[2];
@@ -71,20 +72,19 @@ public class KeyInfoTest {
(Collections.singletonList(fac.newKeyName("foo")), "skeleton");
infos[1] = fac.newKeyInfo
(Collections.singletonList(fac.newKeyName("foo")));
- for (int j = 0; j < infos.length; j++) {
- KeyInfo ki = infos[j];
+ for (KeyInfo ki : infos) {
List<XMLStructure> li = ki.getContent();
assertNotNull(ki.getContent());
Object[] content = li.toArray();
- for (int i = 0; i < content.length; i++) {
- if (!(content[i] instanceof XMLStructure)) {
+ for (Object element : content) {
+ if (!(element instanceof XMLStructure)) {
fail("KeyInfo element has the wrong type");
}
}
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
final String id = "keyId";
// test newKeyInfo(List, String id)
@@ -99,7 +99,7 @@ public class KeyInfoTest {
ki = fac.newKeyInfo(Collections.singletonList(fac.newKeyName("foo")));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
KeyInfo ki = fac.newKeyInfo
(Collections.singletonList(fac.newKeyName("foo")), "keyid");
@@ -111,7 +111,7 @@ public class KeyInfoTest {
assertFalse(ki.isFeatureSupported("not supported"));
}
- @org.junit.jupiter.api.Test
+ @Test
public void testMarshal() throws Exception {
KeyInfo ki = fac.newKeyInfo
(Collections.singletonList(fac.newKeyName("foo")), "keyid");
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyNameTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyNameTest.java
index dc8a5ea9..6b2d54b3 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyNameTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyNameTest.java
@@ -22,7 +22,10 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig.keyinfo;
-import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.KeyName;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -36,20 +39,20 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class KeyNameTest {
- private KeyInfoFactory fac;
+ private final KeyInfoFactory fac;
public KeyNameTest() throws Exception {
fac = KeyInfoFactory.getInstance
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetName() {
KeyName kn = fac.newKeyName("skeleton");
assertNotNull(kn.getName());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
final String name = "keyName";
KeyName kn = fac.newKeyName(name);
@@ -60,7 +63,7 @@ public class KeyNameTest {
} catch (NullPointerException npe) {}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
KeyName kn = fac.newKeyName("keyName");
try {
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyValueTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyValueTest.java
index 0ddd6bf5..718d15fe 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyValueTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/KeyValueTest.java
@@ -22,8 +22,16 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig.keyinfo;
-import java.security.*;
-import javax.xml.crypto.dsig.keyinfo.*;
+import java.security.KeyException;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.PublicKey;
+import java.security.SecureRandom;
+
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.KeyValue;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -38,8 +46,8 @@ import static org.junit.jupiter.api.Assertions.fail;
public class KeyValueTest {
private static final String[] ALGOS = { "DSA", "RSA" };
- private KeyInfoFactory fac;
- private PublicKey keys[];
+ private final KeyInfoFactory fac;
+ private final PublicKey keys[];
public KeyValueTest() throws Exception {
fac = KeyInfoFactory.getInstance
@@ -52,7 +60,7 @@ public class KeyValueTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetPublicKey() {
try {
KeyValue kv = fac.newKeyValue(keys[0]);
@@ -62,20 +70,20 @@ public class KeyValueTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test newKeyValue(PublicKey pk)
- for (int i = 0; i < keys.length; i++) {
+ for (PublicKey key : keys) {
try {
- KeyValue kv = fac.newKeyValue(keys[i]);
- assertEquals(keys[i], kv.getPublicKey());
+ KeyValue kv = fac.newKeyValue(key);
+ assertEquals(key, kv.getPublicKey());
} catch (KeyException ke) {
fail("Should pass instead of throwing KeyException");
}
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
KeyValue kv = null;
try {
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/PGPDataTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/PGPDataTest.java
index e755ec5b..f1489a7c 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/PGPDataTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/PGPDataTest.java
@@ -24,8 +24,12 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig.keyinfo;
import java.util.ArrayList;
import java.util.List;
-import javax.xml.crypto.*;
-import javax.xml.crypto.dsig.keyinfo.*;
+
+import javax.xml.crypto.XMLStructure;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.PGPData;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -39,8 +43,8 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class PGPDataTest {
- private KeyInfoFactory fac;
- private byte[][] values = {
+ private final KeyInfoFactory fac;
+ private final byte[][] values = {
{
0x01, 0x02, 0x03, 0x04,
0x05, 0x06, 0x07, 0x08
@@ -56,21 +60,21 @@ public class PGPDataTest {
}
@SuppressWarnings("rawtypes")
- @org.junit.jupiter.api.Test
+ @Test
public void testgetExternalElements() {
PGPData[] pds = {
fac.newPGPData(values[0]),
fac.newPGPData(values[0], values[1], null),
fac.newPGPData(values[1], null)
};
- for (int i = 0; i<pds.length; i++) {
+ for (PGPData pd : pds) {
@SuppressWarnings("unchecked")
- List<XMLStructure> li = pds[i].getExternalElements();
+ List<XMLStructure> li = pd.getExternalElements();
assertNotNull(li);
if (!li.isEmpty()) {
Object[] types = li.toArray();
- for (int j = 0; j < types.length; j++) {
- if (!(types[j] instanceof XMLStructure)) {
+ for (Object type : types) {
+ if (!(type instanceof XMLStructure)) {
fail("PGP element has the wrong type");
}
}
@@ -87,7 +91,7 @@ public class PGPDataTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetKeyId() {
PGPData pd = fac.newPGPData(values[0]);
assertNotNull(pd.getKeyId());
@@ -96,7 +100,7 @@ public class PGPDataTest {
pd = fac.newPGPData(values[1], null);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetKeyPacket() {
PGPData pd = fac.newPGPData(values[0]);
pd = fac.newPGPData(values[0], values[1], null);
@@ -105,7 +109,7 @@ public class PGPDataTest {
assertNotNull(pd.getKeyPacket());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test newPGPKeyData(byte[])
PGPData pd = fac.newPGPData(values[0]);
@@ -121,7 +125,7 @@ public class PGPDataTest {
assertArrayEquals(values[1], pd.getKeyPacket());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
PGPData pd = null;
for (int i = 0; i < 3; i++) {
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/RetrievalMethodTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/RetrievalMethodTest.java
index e88da0d0..545725ce 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/RetrievalMethodTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/RetrievalMethodTest.java
@@ -22,7 +22,10 @@
package org.apache.xml.security.test.javax.xml.crypto.dsig.keyinfo;
-import javax.xml.crypto.dsig.keyinfo.*;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.RetrievalMethod;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -37,32 +40,32 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class RetrievalMethodTest {
- private KeyInfoFactory fac;
+ private final KeyInfoFactory fac;
public RetrievalMethodTest() throws Exception {
fac = KeyInfoFactory.getInstance
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetURI() {
RetrievalMethod rm = fac.newRetrievalMethod("#X509Data");
assertNotNull(rm.getURI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetTransforms() {
RetrievalMethod rm = fac.newRetrievalMethod("#X509Data");
assertNotNull(rm.getTransforms());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetType() {
RetrievalMethod rm = fac.newRetrievalMethod("#X509Data");
assertNull(rm.getType());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructors() {
final String uri = "#X509CertChain";
// test RetrievalMethod(String)
@@ -86,7 +89,7 @@ public class RetrievalMethodTest {
assertEquals(type, rm.getType());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() throws Exception {
String uri = "#X509CertChain";
String type = "http://www.w3.org/2000/09/xmldsig#X509Data";
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509DataTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509DataTest.java
index d179552b..517cadc0 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509DataTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509DataTest.java
@@ -21,13 +21,16 @@
*/
package org.apache.xml.security.test.javax.xml.crypto.dsig.keyinfo;
-import java.util.*;
+import java.security.cert.X509CRL;
import java.security.cert.X509Certificate;
+import java.util.Collections;
+import java.util.List;
+import javax.xml.crypto.XMLStructure;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.X509Data;
-import java.security.cert.X509CRL;
-import javax.xml.crypto.*;
-import javax.xml.crypto.dsig.keyinfo.*;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -40,40 +43,40 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class X509DataTest {
- private KeyInfoFactory fac;
+ private final KeyInfoFactory fac;
public X509DataTest() throws Exception {
fac = KeyInfoFactory.getInstance
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetTypes() {
X509Data x509 = fac.newX509Data(Collections.singletonList("cn=foo"));
List<?> li = x509.getContent();
assertNotNull(li);
if (!li.isEmpty()) {
Object[] content = li.toArray();
- for (int j=0; j<content.length; j++) {
- if (!(content[j] instanceof String) &&
- !(content[j] instanceof byte[]) &&
- !(content[j] instanceof X509Certificate) &&
- !(content[j] instanceof X509CRL) &&
- !(content[j] instanceof XMLStructure)) {
+ for (Object element : content) {
+ if (!(element instanceof String) &&
+ !(element instanceof byte[]) &&
+ !(element instanceof X509Certificate) &&
+ !(element instanceof X509CRL) &&
+ !(element instanceof XMLStructure)) {
fail("X509 element has the wrong type");
}
}
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test newX509Data()
X509Data x509 = fac.newX509Data(Collections.singletonList("cn=foo"));
assertNotNull(x509);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
X509Data x509 = fac.newX509Data(Collections.singletonList("cn=foo"));
diff --git a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509IssuerSerialTest.java b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509IssuerSerialTest.java
index bb519c2d..4e24fb40 100644
--- a/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509IssuerSerialTest.java
+++ b/src/test/java/org/apache/xml/security/test/javax/xml/crypto/dsig/keyinfo/X509IssuerSerialTest.java
@@ -23,7 +23,11 @@ package org.apache.xml.security.test.javax.xml.crypto.dsig.keyinfo;
import java.math.BigInteger;
-import javax.xml.crypto.dsig.keyinfo.*;
+
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.X509IssuerSerial;
+
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -37,8 +41,8 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class X509IssuerSerialTest {
- private KeyInfoFactory fac;
- private String name;
+ private final KeyInfoFactory fac;
+ private final String name;
public X509IssuerSerialTest() throws Exception {
fac = KeyInfoFactory.getInstance
@@ -46,19 +50,19 @@ public class X509IssuerSerialTest {
name = "CN = Wolfgang";
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetIssuerName() {
X509IssuerSerial x509is = fac.newX509IssuerSerial(name, BigInteger.ZERO);
assertNotNull(x509is.getIssuerName());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testgetSerialNumber() {
X509IssuerSerial x509is = fac.newX509IssuerSerial(name, BigInteger.ZERO);
assertNotNull(x509is.getSerialNumber());
}
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructor() {
// test newX509IssuerSerial(String, BigInteger)
X509IssuerSerial x509is = fac.newX509IssuerSerial(name, BigInteger.ONE);
@@ -70,7 +74,7 @@ public class X509IssuerSerialTest {
* Confirm that an IllegalArgumentException is thrown when an issuer
* distinguished name does not conform to RFC 2253.
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testConstructorBadIssuerName() {
// test newX509IssuerSerial(String, BigInteger)
String badName = "cn=bad,=+bad,";
@@ -83,7 +87,7 @@ public class X509IssuerSerialTest {
}
}
- @org.junit.jupiter.api.Test
+ @Test
public void testisFeatureSupported() {
X509IssuerSerial x509is = fac.newX509IssuerSerial(name, BigInteger.ONE);
diff --git a/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer11Test.java b/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer11Test.java
index c657799c..77a9926d 100644
--- a/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer11Test.java
+++ b/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer11Test.java
@@ -18,13 +18,11 @@
*/
package org.apache.xml.security.test.stax.c14n;
-import org.junit.jupiter.api.Test;
-
-import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer11_OmitCommentsTransformer;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer11_WithCommentsTransformer;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.CanonicalizerBase;
-import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
@@ -32,12 +30,13 @@ import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLResolver;
import javax.xml.stream.XMLStreamException;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
+import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer11_OmitCommentsTransformer;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer11_WithCommentsTransformer;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.CanonicalizerBase;
+import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -220,7 +219,7 @@ public class Canonicalizer11Test {
* @see <A HREF="http://www.w3.org/TR/2007/CR-xml-c14n11-20070621/#Example-DocSubsetsXMLAttrs">the example from the spec</A>
*/
@Test
- @org.junit.jupiter.api.Disabled
+ @Disabled
public void test38() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
diff --git a/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java b/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java
index 65713702..496358fc 100644
--- a/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315ExclusiveTest.java
@@ -18,15 +18,17 @@
*/
package org.apache.xml.security.test.stax.c14n;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_Excl;
-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.w3c.dom.Document;
-import org.w3c.dom.Element;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
@@ -37,13 +39,16 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-
-import java.io.*;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_Excl;
+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.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -61,7 +66,7 @@ public class Canonicalizer20010315ExclusiveTest {
this.xmlInputFactory.setEventAllocator(new XMLSecEventAllocator());
}
- @org.junit.jupiter.api.Test
+ @Test
public void test221excl() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -103,7 +108,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertTrue(equals);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test222excl() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -130,7 +135,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertTrue(equals);
}
- @org.junit.jupiter.api.Test
+ @Test
public void test24excl() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -157,7 +162,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertTrue(equals);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testComplexDocexcl() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -183,7 +188,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertTrue(equals);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testNodeSet() throws Exception {
final String XML =
@@ -234,7 +239,7 @@ public class Canonicalizer20010315ExclusiveTest {
* "Canonicalizer can't handle dynamical created DOM correctly"
* https://issues.apache.org/jira/browse/SANTUARIO-263
*/
- @org.junit.jupiter.api.Test
+ @Test
public void test24Aexcl() throws Exception {
Document doc = TestUtils.newDocument();
Element local = doc.createElementNS("foo:bar", "dsig:local");
@@ -276,7 +281,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList1() throws Exception {
final String XML =
"<env:Envelope"
@@ -339,7 +344,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList2() throws Exception {
final String XML =
"<env:Envelope"
@@ -413,7 +418,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList3() throws Exception {
final String XML =
"<env:Envelope"
@@ -476,7 +481,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testDefaultNSInInclusiveNamespacePrefixList4() throws Exception {
final String XML =
"<env:Envelope"
@@ -539,7 +544,7 @@ public class Canonicalizer20010315ExclusiveTest {
*
* @throws Exception
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs1() throws Exception {
final String XML =
"<env:Envelope"
@@ -580,7 +585,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertEquals(new String(baos.toByteArray(), java.nio.charset.StandardCharsets.UTF_8), c14nXML);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs2() throws Exception {
final String XML =
"<env:Envelope"
@@ -622,7 +627,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertEquals(new String(baos.toByteArray(), java.nio.charset.StandardCharsets.UTF_8), c14nXML);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs3() throws Exception {
final String XML =
"<Envelope"
@@ -664,7 +669,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertEquals(new String(baos.toByteArray(), java.nio.charset.StandardCharsets.UTF_8), c14nXML);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs4() throws Exception {
final String XML =
"<Envelope"
@@ -706,7 +711,7 @@ public class Canonicalizer20010315ExclusiveTest {
assertEquals(new String(baos.toByteArray(), java.nio.charset.StandardCharsets.UTF_8), c14nXML);
}
- @org.junit.jupiter.api.Test
+ @Test
public void testPropagateDefaultNs5() throws Exception {
final String XML =
"<env:Envelope"
diff --git a/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315Test.java b/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315Test.java
index 1c5a5878..872f6ad3 100644
--- a/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315Test.java
+++ b/src/test/java/org/apache/xml/security/test/stax/c14n/Canonicalizer20010315Test.java
@@ -18,14 +18,11 @@
*/
package org.apache.xml.security.test.stax.c14n;
-import org.apache.xml.security.test.stax.utils.UnixInputStream;
-import org.junit.jupiter.api.Test;
-
-import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_OmitCommentsTransformer;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_WithCommentsTransformer;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.CanonicalizerBase;
-import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
@@ -33,12 +30,13 @@ import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLResolver;
import javax.xml.stream.XMLStreamException;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
+import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_OmitCommentsTransformer;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_WithCommentsTransformer;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.CanonicalizerBase;
+import org.apache.xml.security.test.stax.utils.UnixInputStream;
+import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git a/src/test/java/org/apache/xml/security/test/stax/c14n/Santuario191Test.java b/src/test/java/org/apache/xml/security/test/stax/c14n/Santuario191Test.java
index 35537533..9b469d0e 100644
--- a/src/test/java/org/apache/xml/security/test/stax/c14n/Santuario191Test.java
+++ b/src/test/java/org/apache/xml/security/test/stax/c14n/Santuario191Test.java
@@ -18,20 +18,18 @@
*/
package org.apache.xml.security.test.stax.c14n;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
-import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer11_OmitCommentsTransformer;
-import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
+import java.io.ByteArrayOutputStream;
+import java.io.StringReader;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
-
-import java.io.ByteArrayOutputStream;
-import java.io.StringReader;
+import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
+import org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer11_OmitCommentsTransformer;
+import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
diff --git a/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionCreationTest.java b/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionCreationTest.java
index abe68076..b7fa1a48 100644
--- a/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionCreationTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionCreationTest.java
@@ -50,6 +50,7 @@ import org.apache.xml.security.stax.ext.XMLSecurityProperties;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.test.stax.utils.XmlReaderToWriter;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -99,7 +100,7 @@ public class KeyWrapEncryptionCreationTest {
xmlInputFactory.setEventAllocator(new XMLSecEventAllocator());
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
diff --git a/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionVerificationTest.java b/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionVerificationTest.java
index a8fd82d2..eeb0c6dc 100644
--- a/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionVerificationTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/encryption/KeyWrapEncryptionVerificationTest.java
@@ -54,6 +54,7 @@ import org.apache.xml.security.test.stax.signature.TestSecurityEventListener;
import org.apache.xml.security.test.stax.utils.StAX2DOM;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -72,8 +73,8 @@ public class KeyWrapEncryptionVerificationTest {
private static boolean bcInstalled;
private static KeyPair rsaKeyPair;
- private XMLInputFactory xmlInputFactory;
- private TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ private final XMLInputFactory xmlInputFactory;
+ private final TransformerFactory transformerFactory = TransformerFactory.newInstance();
@BeforeAll
public static void setup() throws Exception {
@@ -106,7 +107,7 @@ public class KeyWrapEncryptionVerificationTest {
xmlInputFactory.setEventAllocator(new XMLSecEventAllocator());
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
diff --git a/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionCreationTest.java b/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionCreationTest.java
index 38a9249e..4f0dcf8d 100644
--- a/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionCreationTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionCreationTest.java
@@ -45,6 +45,7 @@ import org.apache.xml.security.stax.ext.XMLSecurityProperties;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.test.stax.utils.XmlReaderToWriter;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -91,7 +92,7 @@ public class SymmetricEncryptionCreationTest {
xmlInputFactory.setEventAllocator(new XMLSecEventAllocator());
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
diff --git a/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionVerificationTest.java b/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionVerificationTest.java
index 22c42d8e..95f7e516 100644
--- a/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionVerificationTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/encryption/SymmetricEncryptionVerificationTest.java
@@ -53,6 +53,7 @@ import org.apache.xml.security.test.stax.signature.TestSecurityEventListener;
import org.apache.xml.security.test.stax.utils.StAX2DOM;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.utils.XMLUtils;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -70,8 +71,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class SymmetricEncryptionVerificationTest {
private static boolean bcInstalled;
- private XMLInputFactory xmlInputFactory;
- private TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ private final XMLInputFactory xmlInputFactory;
+ private final TransformerFactory transformerFactory = TransformerFactory.newInstance();
@BeforeAll
public static void setup() throws Exception {
@@ -102,7 +103,7 @@ public class SymmetricEncryptionVerificationTest {
xmlInputFactory.setEventAllocator(new XMLSecEventAllocator());
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
diff --git a/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java b/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java
index 326beae5..a0dcf94f 100644
--- a/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java
+++ b/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java
@@ -65,6 +65,7 @@ import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.test.stax.utils.XmlReaderToWriter;
import org.apache.xml.security.utils.XMLUtils;
import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -106,7 +107,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA2048Outbound() throws Exception {
assumeFalse(isIBMJdK);
@@ -127,7 +128,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA2048EncryptDecrypt() throws Exception {
assumeFalse(isIBMJdK);
@@ -166,7 +167,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072() throws Exception {
assumeFalse(isIBMJdK);
@@ -189,7 +190,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep-mgf1p, Digest:SHA256, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072EncryptDecrypt() throws Exception {
assumeFalse(isIBMJdK);
@@ -230,7 +231,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA384, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072OAEP() throws Exception {
assumeFalse(isIBMJdK);
@@ -253,7 +254,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA384, MGF:SHA1, PSource: None
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA3072OAEPEncryptDecrypt() throws Exception {
assumeFalse(isIBMJdK);
@@ -294,7 +295,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA512, MGF:SHA1, PSource: Specified 8 bytes
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA4096() throws Exception {
assumeFalse(isIBMJdK);
@@ -317,7 +318,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA512, MGF:SHA1, PSource: Specified 8 bytes
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA4096EncryptDecrypt() throws Exception {
assumeFalse(isIBMJdK);
@@ -359,7 +360,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA512, MGF:SHA512, PSource: Specified 8 bytes
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testKeyWrappingRSA4096MGFSHA512EncryptDecrypt() throws Exception {
assumeFalse(isIBMJdK);
@@ -401,7 +402,7 @@ public class XMLEncryption11Test {
/**
* rsa-oaep, Digest:SHA512, MGF:SHA512, PSource: Specified 8 bytes
*/
- @org.junit.jupiter.api.Test
+ @Test
public void testAESGCMAuthentication() throws Exception {
assumeFalse(isIBMJdK);
diff --git a/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureCreationTest.java b/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureCreationTest.java
index 4b990ec9..0334ce08 100644
--- a/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureCreationTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureCreationTest.java
@@ -18,7 +18,6 @@
*/
package org.apache.xml.security.test.stax.signature;
-import java.io.File;
import java.lang.reflect.Constructor;
import java.security.Key;
import java.security.Provider;
@@ -35,13 +34,12 @@ import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureInput;
import org.apache.xml.security.stax.ext.SecurePart;
-import org.apache.xml.security.test.XmlSecTestEnvironment;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.utils.resolver.ResourceResolverContext;
import org.apache.xml.security.utils.resolver.ResourceResolverException;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
-
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.w3c.dom.Document;
@@ -85,7 +83,7 @@ public class AbstractSignatureCreationTest {
}
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
diff --git a/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java b/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java
index af88a9ab..3762b922 100644
--- a/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java
@@ -18,7 +18,6 @@
*/
package org.apache.xml.security.test.stax.signature;
-import java.io.File;
import java.lang.reflect.Constructor;
import java.security.Key;
import java.security.Provider;
@@ -34,10 +33,6 @@ import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.stax.config.Init;
@@ -60,9 +55,12 @@ import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
-
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -104,7 +102,7 @@ public class AbstractSignatureVerificationTest {
}
}
- @org.junit.jupiter.api.AfterAll
+ @AfterAll
public static void cleanup() throws Exception {
Security.removeProvider("BC");
}
diff --git a/src/test/java/org/apache/xml/security/test/stax/signature/SignatureEncryptionTest.java b/src/test/java/org/apache/xml/security/test/stax/signature/SignatureEncryptionTest.java
index cf0a4f32..496d90ff 100644
--- a/src/test/java/org/apache/xml/security/test/stax/signature/SignatureEncryptionTest.java
+++ b/src/test/java/org/apache/xml/security/test/stax/signature/SignatureEncryptionTest.java
@@ -37,10 +37,6 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
import org.apache.xml.security.encryption.XMLCipher;
import org.apache.xml.security.stax.ext.InboundXMLSec;
import org.apache.xml.security.stax.ext.OutboundXMLSec;
@@ -52,8 +48,10 @@ import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
import org.apache.xml.security.test.stax.utils.StAX2DOM;
import org.apache.xml.security.test.stax.utils.XmlReaderToWriter;
import org.apache.xml.security.utils.XMLUtils;
-
import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;