You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/12/19 13:16:11 UTC
svn commit: r1720903 [4/4] - in /webservices/wss4j/trunk: ./
policy/src/main/java/org/apache/wss4j/policy/
policy/src/main/java/org/apache/wss4j/policy/model/
policy/src/test/java/org/apache/wss4j/policy/tests/
ws-security-common/src/main/java/org/apac...
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/SecurityHeaderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/SecurityHeaderTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/SecurityHeaderTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/SecurityHeaderTest.java Sat Dec 19 12:16:09 2015
@@ -22,6 +22,7 @@ package org.apache.wss4j.dom.misc;
import org.apache.wss4j.dom.common.SOAPUtil;
import org.apache.wss4j.dom.common.SecurityTestUtil;
import org.apache.wss4j.dom.engine.WSSecurityEngine;
+import org.junit.Test;
import org.apache.wss4j.common.ext.WSSecurityException;
import org.w3c.dom.Document;
@@ -91,7 +92,7 @@ public class SecurityHeaderTest extends
/**
* Test for processing multiple security headers with the same (null) actor
*/
- @org.junit.Test
+ @Test
public void testDuplicateNullActor() throws Exception {
Document doc = SOAPUtil.toSOAPPart(DUPLICATE_NULL_ACTOR_MSG);
try {
@@ -105,7 +106,7 @@ public class SecurityHeaderTest extends
/**
* Test for processing multiple security headers with the same actor
*/
- @org.junit.Test
+ @Test
public void testDuplicateActor() throws Exception {
Document doc = SOAPUtil.toSOAPPart(DUPLICATE_ACTOR_MSG);
try {
@@ -119,7 +120,7 @@ public class SecurityHeaderTest extends
/**
* Test for processing multiple security headers with different actors
*/
- @org.junit.Test
+ @Test
public void testTwoActors() throws Exception {
Document doc = SOAPUtil.toSOAPPart(TWO_ACTOR_MSG);
secEngine.processSecurityHeader(doc, null, null, null);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java Sat Dec 19 12:16:09 2015
@@ -37,6 +37,7 @@ import org.apache.wss4j.common.crypto.Cr
import org.apache.wss4j.common.crypto.CryptoFactory;
import org.apache.wss4j.dom.message.WSSecEncrypt;
import org.apache.wss4j.dom.message.WSSecHeader;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -77,7 +78,7 @@ public class EncryptedKeyDataRefTest ext
* @throws Exception
* Thrown when there is an error in encryption or decryption
*/
- @org.junit.Test
+ @Test
public void testDataRefEncryptedKeyProcessor() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
WSSecEncrypt builder = new WSSecEncrypt();
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java Sat Dec 19 12:16:09 2015
@@ -37,6 +37,7 @@ import org.apache.wss4j.common.crypto.Cr
import org.apache.wss4j.common.crypto.CryptoFactory;
import org.apache.wss4j.dom.message.WSSecEncrypt;
import org.apache.wss4j.dom.message.WSSecHeader;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -77,7 +78,7 @@ public class ReferenceListDataRefTest ex
* @throws Exception
* Thrown when there is an error in encryption or decryption
*/
- @org.junit.Test
+ @Test
public void testDataRefReferenceListProcessor() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
WSSecEncrypt builder = new WSSecEncrypt();
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java Sat Dec 19 12:16:09 2015
@@ -41,6 +41,7 @@ import org.apache.wss4j.common.saml.SAML
import org.apache.wss4j.common.saml.builder.SAML1Constants;
import org.apache.wss4j.common.util.XMLUtils;
import org.apache.wss4j.dom.util.WSSecurityUtil;
+import org.junit.Test;
/**
* A set of test-cases for signing and verifying SOAP requests containing a signed
@@ -61,7 +62,7 @@ public class SamlAlgorithmSuiteTest exte
crypto = CryptoFactory.getInstance("crypto.properties");
}
- @org.junit.Test
+ @Test
public void testSignedSAML11Assertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -103,7 +104,7 @@ public class SamlAlgorithmSuiteTest exte
}
}
- @org.junit.Test
+ @Test
public void testDSASignedSAML11Assertion() throws Exception {
Crypto dsaCrypto = CryptoFactory.getInstance("wss40.properties");
@@ -146,7 +147,7 @@ public class SamlAlgorithmSuiteTest exte
verify(securityHeader, algorithmSuite, dsaCrypto);
}
- @org.junit.Test
+ @Test
public void testC14nMethod() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java Sat Dec 19 12:16:09 2015
@@ -39,6 +39,7 @@ import org.apache.wss4j.dom.handler.WSHa
import org.apache.wss4j.dom.message.WSSecHeader;
import org.apache.wss4j.dom.message.WSSecSAMLToken;
import org.joda.time.DateTime;
+import org.junit.Test;
import org.w3c.dom.Document;
/**
@@ -61,7 +62,7 @@ public class SamlAuthnTest extends org.j
secEngine.setWssConfig(config);
}
- @org.junit.Test
+ @Test
public void testSAML1AuthnAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -70,7 +71,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, true);
}
- @org.junit.Test
+ @Test
public void testSAML2AuthnAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -79,7 +80,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, true);
}
- @org.junit.Test
+ @Test
public void testSAML1FutureAuthnInstant() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -90,7 +91,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, false);
}
- @org.junit.Test
+ @Test
public void testSAML2FutureAuthnInstant() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -101,7 +102,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, false);
}
- @org.junit.Test
+ @Test
public void testSAML2StaleSessionNotOnOrAfter() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -112,7 +113,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, false);
}
- @org.junit.Test
+ @Test
public void testSAML1ValidSubjectLocality() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -123,7 +124,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, true);
}
- @org.junit.Test
+ @Test
public void testSAML2ValidSubjectLocality() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -134,7 +135,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, true);
}
- @org.junit.Test
+ @Test
public void testSAML1InvalidSubjectLocality() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -145,7 +146,7 @@ public class SamlAuthnTest extends org.j
createAndVerifyMessage(callbackHandler, false);
}
- @org.junit.Test
+ @Test
public void testSAML2InalidSubjectLocality() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlConditionsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlConditionsTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlConditionsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlConditionsTest.java Sat Dec 19 12:16:09 2015
@@ -49,6 +49,7 @@ import org.apache.wss4j.dom.handler.WSHa
import org.apache.wss4j.dom.message.WSSecHeader;
import org.apache.wss4j.dom.message.WSSecSAMLToken;
import org.joda.time.DateTime;
+import org.junit.Test;
import org.w3c.dom.Document;
/**
@@ -75,7 +76,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 1.1 authentication assertion
* with a custom Conditions statement.
*/
- @org.junit.Test
+ @Test
public void testSAML1Conditions() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -94,7 +95,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with an (invalid) custom Conditions statement.
*/
- @org.junit.Test
+ @Test
public void testSAML2InvalidAfterConditions() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -109,7 +110,7 @@ public class SamlConditionsTest extends
createAndVerifyMessage(callbackHandler, false);
}
- @org.junit.Test
+ @Test
public void testSAML2StaleNotOnOrAfter() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -124,7 +125,7 @@ public class SamlConditionsTest extends
createAndVerifyMessage(callbackHandler, false);
}
- @org.junit.Test
+ @Test
public void testSAML2FutureNotBefore() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -139,7 +140,7 @@ public class SamlConditionsTest extends
createAndVerifyMessage(callbackHandler, false);
}
- @org.junit.Test
+ @Test
public void testSAML2FutureIssueInstant() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -176,7 +177,7 @@ public class SamlConditionsTest extends
}
}
- @org.junit.Test
+ @Test
public void testSAML2StaleIssueInstant() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -214,7 +215,7 @@ public class SamlConditionsTest extends
}
}
- @org.junit.Test
+ @Test
public void testSAML2StaleIssueInstantButWithNotOnOrAfter() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -250,7 +251,7 @@ public class SamlConditionsTest extends
verify(unsignedDoc);
}
- @org.junit.Test
+ @Test
public void testSAML1StaleIssueInstant() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -292,7 +293,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with an (invalid) custom Conditions statement.
*/
- @org.junit.Test
+ @Test
public void testSAML2InvalidBeforeConditions() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -311,7 +312,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with a Conditions statement that has a NotBefore "in the future".
*/
- @org.junit.Test
+ @Test
public void testSAML2FutureTTLConditions() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -330,7 +331,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with a OneTimeUse Element
*/
- @org.junit.Test
+ @Test
public void testSAML2OneTimeUse() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -368,7 +369,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with a ProxyRestriction Element
*/
- @org.junit.Test
+ @Test
public void testSAML2ProxyRestriction() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -412,7 +413,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with an AudienceRestriction Element
*/
- @org.junit.Test
+ @Test
public void testSAML2AudienceRestriction() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -452,7 +453,7 @@ public class SamlConditionsTest extends
}
// Now test AudienceRestrictions with supplied restrictions
- @org.junit.Test
+ @Test
public void testSAML2AudienceRestrictionVerification() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -512,7 +513,7 @@ public class SamlConditionsTest extends
}
// Now test AudienceRestrictions with supplied restrictions
- @org.junit.Test
+ @Test
public void testSAML1AudienceRestrictionVerification() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -575,7 +576,7 @@ public class SamlConditionsTest extends
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with two AudienceRestriction Elements
*/
- @org.junit.Test
+ @Test
public void testSAML2AudienceRestrictionSeparateRestrictions() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -620,7 +621,7 @@ public class SamlConditionsTest extends
}
// Now test AudienceRestrictions with supplied restrictions
- @org.junit.Test
+ @Test
public void testSAML2AudienceRestrictionSeparateRestrictionsValidation() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -684,7 +685,7 @@ public class SamlConditionsTest extends
newEngine.processSecurityHeader(doc, data);
}
- @org.junit.Test
+ @Test
public void testSAML2Delegate() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlNegativeTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlNegativeTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlNegativeTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlNegativeTest.java Sat Dec 19 12:16:09 2015
@@ -46,6 +46,7 @@ import org.apache.wss4j.common.util.Load
import org.apache.wss4j.common.util.XMLUtils;
import org.apache.wss4j.dom.message.WSSecHeader;
import org.apache.wss4j.dom.message.WSSecSAMLToken;
+import org.junit.Test;
import org.w3c.dom.Document;
import javax.security.auth.callback.Callback;
@@ -102,7 +103,7 @@ public class SamlNegativeTest extends or
* authentication assertion. The assertion is altered and so the signature validation
* should fail.
*/
- @org.junit.Test
+ @Test
public void testSAML2AuthnAssertionModified() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -154,7 +155,7 @@ public class SamlNegativeTest extends or
* The signature validation should then fail - the enveloped transform is mandatory for
* a signed assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1SignedKeyHolderSigModified() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -206,7 +207,7 @@ public class SamlNegativeTest extends or
* Test that creates a signed SAML 2 Assertion using HOK, but then modifies the assertion.
* The signature verification should then fail.
*/
- @org.junit.Test
+ @Test
public void testSAML2SignedKeyHolderKeyModified() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -253,7 +254,7 @@ public class SamlNegativeTest extends or
* Test that creates a signed SAML 1.1 authentication assertion that uses holder-of-key, but
* does not include a KeyInfo in the Subject, and hence will fail processing.
*/
- @org.junit.Test
+ @Test
public void testHOKNoKeyInfo() throws Exception {
SAML1HOKNoKeyInfoCallbackHandler callbackHandler =
new SAML1HOKNoKeyInfoCallbackHandler();
@@ -292,7 +293,7 @@ public class SamlNegativeTest extends or
* Test that creates a SAML 1.1 authentication assertion that uses holder-of-key, but is
* not signed, and hence will fail processing.
*/
- @org.junit.Test
+ @Test
public void testHOKNotSigned() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -335,7 +336,7 @@ public class SamlNegativeTest extends or
* Test that creates, sends and processes a signed SAML 2 authentication assertion, but it
* is rejected in processing as the signature on the assertion is not trusted.
*/
- @org.junit.Test
+ @Test
public void testSAML2TrustFailure() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlReferenceTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlReferenceTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlReferenceTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlReferenceTest.java Sat Dec 19 12:16:09 2015
@@ -44,6 +44,7 @@ import org.apache.wss4j.common.util.Load
import org.apache.wss4j.common.util.XMLUtils;
import org.apache.wss4j.dom.message.WSSecEncrypt;
import org.apache.wss4j.dom.message.WSSecHeader;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -97,7 +98,7 @@ public class SamlReferenceTest extends o
* where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier,
* and not a direct reference.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1SVKeyIdentifier() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -160,7 +161,7 @@ public class SamlReferenceTest extends o
* and not a KeyIdentifier. This method is not spec compliant and is included to make sure
* we can process third-party Assertions referenced in this way.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1SVDirectReference() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -224,7 +225,7 @@ public class SamlReferenceTest extends o
* and not a direct reference. This tests that we can process a KeyIdentifier to a SAML
* Assertion in the KeyInfo of a Signature.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1HOKKeyIdentifier() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -287,7 +288,7 @@ public class SamlReferenceTest extends o
* we can process third-party Assertions referenced in this way. This tests that we can
* process a Direct Reference to a SAML Assertion in the KeyInfo of a Signature.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1HOKDirectReference() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -354,7 +355,7 @@ public class SamlReferenceTest extends o
* the SAML Assertion below the SecurityTokenReference, and this is causing
* SecurityTokenReference.getTokenElement to fail.
*/
- @org.junit.Test
+ @Test
public void testAssertionBelowSTR() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
WSSecHeader secHeader = new WSSecHeader(doc);
@@ -410,7 +411,7 @@ public class SamlReferenceTest extends o
* This tests that we can process a KeyIdentifier to a SAML Assertion in the KeyInfo of an
* EncryptedKey.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1HOKEKKeyIdentifier() throws Exception {
// Create a SAML assertion
@@ -487,7 +488,7 @@ public class SamlReferenceTest extends o
* third-party Assertions referenced in this way. This tests that we can process a Direct
* Reference to a SAML Assertion in the KeyInfo of an EncryptedKey.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1HOKEKDirectReference() throws Exception {
// Create a SAML assertion
@@ -560,7 +561,7 @@ public class SamlReferenceTest extends o
* where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier,
* and not a direct reference.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2SVKeyIdentifier() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -622,7 +623,7 @@ public class SamlReferenceTest extends o
* where the SecurityTokenReference that points to the SAML Assertion uses a direct reference,
* and not a KeyIdentifier. Unlike the SAML 1.1 case, this is spec-compliant.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2SVDirectReference() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -686,7 +687,7 @@ public class SamlReferenceTest extends o
* and not a direct reference. This tests that we can process a KeyIdentifier to a SAML
* Assertion in the KeyInfo of a Signature.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2HOKKeyIdentifier() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -749,7 +750,7 @@ public class SamlReferenceTest extends o
* and not a KeyIdentifier. Unlike the SAML 1.1 case, this is spec-compliant. This tests that
* we can process a Direct Reference to a SAML Assertion in the KeyInfo of a Signature.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2HOKDirectReference() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -813,7 +814,7 @@ public class SamlReferenceTest extends o
* This tests that we can process a KeyIdentifier to a SAML Assertion in the KeyInfo of an
* EncryptedKey.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2HOKEKKeyIdentifier() throws Exception {
// Create a SAML assertion
@@ -889,7 +890,7 @@ public class SamlReferenceTest extends o
* Reference. Unlike the SAML 1.1 case, this is spec-compliant. This tests that we can process
* a Direct Reference to a SAML Assertion in the KeyInfo of an EncryptedKey.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2HOKEKDirectReference() throws Exception {
// Create a SAML assertion
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java Sat Dec 19 12:16:09 2015
@@ -43,6 +43,7 @@ import org.apache.wss4j.dom.handler.Hand
import org.apache.wss4j.dom.handler.RequestData;
import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.dom.handler.WSHandlerResult;
+import org.junit.Test;
/**
* Test-case for sending SAML Assertions using the "action" approach.
@@ -66,7 +67,7 @@ public class SamlTokenActionTest extends
secEngine.setWssConfig(config);
}
- @org.junit.Test
+ @Test
public void testAssertionAction() throws Exception {
final WSSConfig cfg = WSSConfig.getNewInstance();
final RequestData reqData = new RequestData();
@@ -102,7 +103,7 @@ public class SamlTokenActionTest extends
verify(doc, callbackHandler);
}
- @org.junit.Test
+ @Test
public void testSignedAssertionAction() throws Exception {
final WSSConfig cfg = WSSConfig.getNewInstance();
final RequestData reqData = new RequestData();
@@ -139,7 +140,7 @@ public class SamlTokenActionTest extends
verify(doc, callbackHandler);
}
- @org.junit.Test
+ @Test
public void testAssertionWithSignatureAction() throws Exception {
final WSSConfig cfg = WSSConfig.getNewInstance();
final RequestData reqData = new RequestData();
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java Sat Dec 19 12:16:09 2015
@@ -54,6 +54,7 @@ import org.apache.xml.security.signature
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.transforms.params.XPath2FilterContainer;
import org.apache.xml.security.utils.Constants;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -78,7 +79,7 @@ public class SamlTokenCustomSignatureTes
/**
* Test that creates, sends and processes a signed SAML 1.1 authentication assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1AuthnAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -119,7 +120,7 @@ public class SamlTokenCustomSignatureTes
/**
* Test that creates, sends and processes a signed SAML 2.0 authentication assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML2AuthnAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -157,7 +158,7 @@ public class SamlTokenCustomSignatureTes
verifyWithoutProfile(doc);
}
- @org.junit.Test
+ @Test
public void testAddSAML1AndSign() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -197,7 +198,7 @@ public class SamlTokenCustomSignatureTes
verify(signedDoc);
}
- @org.junit.Test
+ @Test
public void testAddSAML1AndSignAction() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenDerivedTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenDerivedTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenDerivedTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenDerivedTest.java Sat Dec 19 12:16:09 2015
@@ -49,6 +49,7 @@ import org.apache.wss4j.dom.handler.WSHa
import org.apache.wss4j.dom.message.WSSecDKSign;
import org.apache.wss4j.dom.message.WSSecHeader;
import org.apache.wss4j.dom.util.WSSecurityUtil;
+import org.junit.Test;
import org.w3c.dom.Document;
/**
@@ -77,7 +78,7 @@ public class SamlTokenDerivedTest extend
* Test that creates, sends and processes a signed SAML 1.1 authentication assertion
* using a derived key.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1AuthnAssertionDerived() throws Exception {
//
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenHOKTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenHOKTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenHOKTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenHOKTest.java Sat Dec 19 12:16:09 2015
@@ -40,6 +40,7 @@ import org.apache.wss4j.common.saml.buil
import org.apache.wss4j.common.util.XMLUtils;
import org.apache.wss4j.dom.message.WSSecHeader;
import org.apache.wss4j.dom.message.WSSecSAMLToken;
+import org.junit.Test;
import org.w3c.dom.Document;
/**
@@ -68,7 +69,7 @@ public class SamlTokenHOKTest extends or
/**
* Test that creates, sends and processes a signed SAML 1.1 authentication assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1AuthnAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -109,7 +110,7 @@ public class SamlTokenHOKTest extends or
/**
* Test that creates, sends and processes a signed SAML 1.1 attribute assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1AttrAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.ATTR);
@@ -160,7 +161,7 @@ public class SamlTokenHOKTest extends or
/**
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML2AuthnAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -200,7 +201,7 @@ public class SamlTokenHOKTest extends or
/**
* Test that creates, sends and processes an unsigned SAML 2 attribute assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML2AttrAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.ATTR);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenSVTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenSVTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenSVTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenSVTest.java Sat Dec 19 12:16:09 2015
@@ -42,6 +42,7 @@ import org.apache.wss4j.dom.handler.Requ
import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.dom.handler.WSHandlerResult;
import org.apache.wss4j.dom.message.WSSecHeader;
+import org.junit.Test;
import org.w3c.dom.Document;
import java.util.Collections;
@@ -72,7 +73,7 @@ public class SamlTokenSVTest extends org
/**
* Test that creates, sends and processes a signed SAML 1.1 authentication assertion.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1AuthnAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -132,7 +133,7 @@ public class SamlTokenSVTest extends org
/**
* Test that creates, sends and processes a signed SAML 1.1 attribute assertion.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1AttrAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -192,7 +193,7 @@ public class SamlTokenSVTest extends org
/**
* Test that creates, sends and processes a signed SAML 2 authentication assertion.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2AuthnAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -252,7 +253,7 @@ public class SamlTokenSVTest extends org
/**
* Test that creates, sends and processes a signed SAML 2 attribute assertion.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2AttrAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -315,7 +316,7 @@ public class SamlTokenSVTest extends org
*
* https://issues.apache.org/jira/browse/WSS-62
*/
- @org.junit.Test
+ @Test
public void testWSS62() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.ATTR);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java Sat Dec 19 12:16:09 2015
@@ -71,6 +71,7 @@ import org.apache.xml.security.encryptio
import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.keys.content.X509Data;
import org.joda.time.DateTime;
+import org.junit.Test;
import org.opensaml.core.xml.XMLObjectBuilder;
import org.opensaml.core.xml.XMLObjectBuilderFactory;
import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
@@ -106,7 +107,7 @@ public class SamlTokenTest extends org.j
/**
* Test that creates, sends and processes an unsigned SAML 1.1 authentication assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1AuthnAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -129,7 +130,7 @@ public class SamlTokenTest extends org.j
* It set a DOM Element on the CallbackHandler rather than creating a set of beans for
* SamlAssertionWrapper to parse.
*/
- @org.junit.Test
+ @Test
public void testSAML1AuthnAssertionViaElement() throws Exception {
SAMLElementCallbackHandler callbackHandler = new SAMLElementCallbackHandler();
callbackHandler.setIssuer("www.example.com");
@@ -149,7 +150,7 @@ public class SamlTokenTest extends org.j
/**
* Test that creates, sends and processes an unsigned SAML 1.1 attribute assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1AttrAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.ATTR);
@@ -169,7 +170,7 @@ public class SamlTokenTest extends org.j
/**
* Test that creates, sends and processes an unsigned SAML 1.1 authorization assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1AuthzAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHZ);
@@ -190,7 +191,7 @@ public class SamlTokenTest extends org.j
/**
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML2AuthnAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -210,7 +211,7 @@ public class SamlTokenTest extends org.j
/**
* Test that creates, sends and processes an unsigned SAML 2 attribute assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML2AttrAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.ATTR);
@@ -230,7 +231,7 @@ public class SamlTokenTest extends org.j
/**
* Test that creates, sends and processes an unsigned SAML 2 authorization assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML2AuthzAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHZ);
@@ -252,7 +253,7 @@ public class SamlTokenTest extends org.j
* This test checks that an unsigned SAML1 sender-vouches authentication assertion
* can be created by the WSHandler implementation
*/
- @org.junit.Test
+ @Test
public void testSaml1Action() throws Exception {
final WSSConfig cfg = WSSConfig.getNewInstance();
final RequestData reqData = new RequestData();
@@ -293,7 +294,7 @@ public class SamlTokenTest extends org.j
* The issuer is different from what the custom Validator is expecting, so it throws an
* exception.
*/
- @org.junit.Test
+ @Test
public void testSAML1AuthnBadIssuerAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -307,7 +308,7 @@ public class SamlTokenTest extends org.j
* The issuer is different from what the custom Validator is expecting, so it throws an
* exception.
*/
- @org.junit.Test
+ @Test
public void testSAML2AuthnBadIssuerAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -320,7 +321,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 1.1 authentication assertion with
* a user-specified SubjectNameIDFormat.
*/
- @org.junit.Test
+ @Test
public void testSAML1SubjectNameIDFormat() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -361,7 +362,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion with
* a user-specified SubjectNameIDFormat.
*/
- @org.junit.Test
+ @Test
public void testSAML2SubjectNameIDFormat() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -402,7 +403,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 1.1 authentication assertion with
* a user-specified SubjectLocality statement.
*/
- @org.junit.Test
+ @Test
public void testSAML1SubjectLocality() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -444,7 +445,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 2.0 authentication assertion with
* a user-specified SessionNotOnOrAfter DateTime.
*/
- @org.junit.Test
+ @Test
public void testSAML2SessionNotOnOrAfter() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -485,7 +486,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion with
* a user-specified SubjectLocality statement.
*/
- @org.junit.Test
+ @Test
public void testSAML2SubjectLocality() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -527,7 +528,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 1.1 authorization assertion
* with a Resource URI.
*/
- @org.junit.Test
+ @Test
public void testSAML1Resource() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHZ);
@@ -568,7 +569,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 2 attribute assertion. The attributeValue
* has a custom XMLObject (not a String) value.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2AttrAssertionCustomAttribute() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -628,7 +629,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 2 attribute assertion. The attributeValue
* has a custom XMLObject (xsd:type="xsd:int") value.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2AttrAssertionIntegerAttribute() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -662,7 +663,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion with
* SubjectConfirmationData information.
*/
- @org.junit.Test
+ @Test
public void testSAML2SubjectConfirmationData() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -709,7 +710,7 @@ public class SamlTokenTest extends org.j
* Test that creates, sends and processes an unsigned SAML 2 authentication assertion, which
* is encrypted in a saml2:EncryptedAssertion Element in the security header
*/
- @org.junit.Test
+ @Test
public void testSAML2EncryptedAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -773,7 +774,7 @@ public class SamlTokenTest extends org.j
assertTrue(actionResult != null);
}
- @org.junit.Test
+ @Test
public void testSAML2EncryptedAssertionNoSTR() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -847,7 +848,7 @@ public class SamlTokenTest extends org.j
assertTrue(actionResult != null);
}
- @org.junit.Test
+ @Test
public void testAssertionWrapper() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -872,7 +873,7 @@ public class SamlTokenTest extends org.j
assertEquals(assertionString, secondAssertionString);
}
- @org.junit.Test
+ @Test
public void testAssertionWrapperNoDocument() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
@@ -897,7 +898,7 @@ public class SamlTokenTest extends org.j
assertEquals(assertionString, secondAssertionString);
}
- @org.junit.Test
+ @Test
public void testRequiredSubjectConfirmationMethod() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -950,7 +951,7 @@ public class SamlTokenTest extends org.j
}
}
- @org.junit.Test
+ @Test
public void testStandardSubjectConfirmationMethod() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -992,7 +993,7 @@ public class SamlTokenTest extends org.j
newEngine.processSecurityHeader(doc, requestData);
}
- @org.junit.Test
+ @Test
public void testUnsignedBearer() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -1034,7 +1035,7 @@ public class SamlTokenTest extends org.j
newEngine.processSecurityHeader(doc, requestData);
}
- @org.junit.Test
+ @Test
public void testSAML2Advice() throws Exception {
// Create a "Advice" Element first
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -1082,7 +1083,7 @@ public class SamlTokenTest extends org.j
assertFalse(receivedSamlAssertion.isSigned());
}
- @org.junit.Test
+ @Test
public void testSAML2SpecialCharacter() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.ATTR);
@@ -1127,7 +1128,7 @@ public class SamlTokenTest extends org.j
assertFalse(receivedSamlAssertion.isSigned());
}
- @org.junit.Test
+ @Test
public void testSAML2IssuerFormat() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java Sat Dec 19 12:16:09 2015
@@ -43,6 +43,7 @@ import org.apache.wss4j.common.saml.buil
import org.apache.wss4j.common.util.Loader;
import org.apache.wss4j.common.util.XMLUtils;
import org.apache.wss4j.dom.message.WSSecHeader;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -93,7 +94,7 @@ public class SignedSamlTokenHOKTest exte
/**
* Test that creates, sends and processes a signed SAML 1.1 authentication assertion.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1AuthnAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -164,7 +165,7 @@ public class SignedSamlTokenHOKTest exte
/**
* Test that creates, sends and processes a signed SAML 1.1 attribute assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML1AttrAssertion() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
callbackHandler.setStatement(SAML1CallbackHandler.Statement.ATTR);
@@ -226,7 +227,7 @@ public class SignedSamlTokenHOKTest exte
/**
* Test that creates, sends and processes a signed SAML 2 authentication assertion.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2AuthnAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -288,7 +289,7 @@ public class SignedSamlTokenHOKTest exte
/**
* Test that creates, sends and processes a signed SAML 2 attribute assertion.
*/
- @org.junit.Test
+ @Test
public void testSAML2AttrAssertion() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.ATTR);
@@ -352,7 +353,7 @@ public class SignedSamlTokenHOKTest exte
* Test that creates, sends and processes a signed SAML 1.1 authentication assertion,
* where the subject cert is referenced using IssuerSerial
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1AuthnAssertionIssuerSerial() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -413,7 +414,7 @@ public class SignedSamlTokenHOKTest exte
* Test that creates, sends and processes a signed SAML 1.1 authentication assertion,
* where the subject cert is referenced using a Key Value
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1AuthnAssertionKeyValue() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -474,7 +475,7 @@ public class SignedSamlTokenHOKTest exte
* Test that creates, sends and processes a signed SAML 2 authentication assertion,
* where the subject cert is referenced using a Key Value
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML2AuthnAssertionKeyValue() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -536,7 +537,7 @@ public class SignedSamlTokenHOKTest exte
* The difference is that we don't trust the user signature, but as we trust the
* signature of the issuer, we have (indirect) trust.
*/
- @org.junit.Test
+ @Test
@SuppressWarnings("unchecked")
public void testSAML1AuthnAssertionTrust() throws Exception {
SAML1CallbackHandler callbackHandler = new SAML1CallbackHandler();
@@ -598,7 +599,7 @@ public class SignedSamlTokenHOKTest exte
assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath);
}
- @org.junit.Test
+ @Test
@org.junit.Ignore
public void testSAML2Advice() throws Exception {
// Create a signed "Advice" Element first
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/ext/AssertionSigningTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/ext/AssertionSigningTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/ext/AssertionSigningTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/ext/AssertionSigningTest.java Sat Dec 19 12:16:09 2015
@@ -38,6 +38,7 @@ import org.apache.wss4j.dom.common.SAML2
import org.apache.wss4j.dom.common.SecurityTestUtil;
import org.apache.wss4j.dom.engine.WSSConfig;
import org.junit.Assert;
+import org.junit.Test;
import org.opensaml.xmlsec.signature.Signature;
import org.opensaml.xmlsec.signature.support.SignatureConstants;
import org.w3c.dom.Document;
@@ -90,7 +91,7 @@ public class AssertionSigningTest extend
* signature and canonicalization algorithms. The defaults should match
* otherwise the test-case fails.
*/
- @org.junit.Test
+ @Test
public void testSigningWithDefaultAlgorithms() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
@@ -131,7 +132,7 @@ public class AssertionSigningTest extend
* Test that creates an SamlAssertionWrapper object and signs using custom
* signature and canonicalization algorithms.
*/
- @org.junit.Test
+ @Test
public void testSigningWithCustomAlgorithms() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/validate/ValidatorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/validate/ValidatorTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/validate/ValidatorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/validate/ValidatorTest.java Sat Dec 19 12:16:09 2015
@@ -51,6 +51,7 @@ import org.apache.wss4j.dom.message.WSSe
import org.apache.wss4j.dom.message.WSSecTimestamp;
import org.apache.wss4j.dom.message.WSSecUsernameToken;
import org.apache.wss4j.dom.util.WSSecurityUtil;
+import org.junit.Test;
import org.w3c.dom.Document;
/**
@@ -70,7 +71,7 @@ public class ValidatorTest extends org.j
/**
* This is a test for processing an expired Timestamp.
*/
- @org.junit.Test
+ @Test
public void testExpiredTimestamp() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
@@ -104,7 +105,7 @@ public class ValidatorTest extends org.j
/**
* Test for processing an untrusted signature
*/
- @org.junit.Test
+ @Test
public void testUntrustedSignature() throws Exception {
WSSecSignature sign = new WSSecSignature();
sign.setUserInfo("wss40", "security");
@@ -148,7 +149,7 @@ public class ValidatorTest extends org.j
/**
* Test that adds a UserNameToken with (bad) password text to a WS-Security envelope
*/
- @org.junit.Test
+ @Test
public void testUsernameTokenBadText() throws Exception {
WSSecUsernameToken builder = new WSSecUsernameToken();
builder.setPasswordType(WSConstants.PASSWORD_TEXT);
@@ -183,7 +184,7 @@ public class ValidatorTest extends org.j
* In this test, a BinarySecurityToken is added to the SOAP header. A custom processor
* validates the BST and transforms it into a SAML Assertion.
*/
- @org.junit.Test
+ @Test
public void testTransformedBST() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
@@ -232,7 +233,7 @@ public class ValidatorTest extends org.j
* The second time, a custom Validator (NoOpValidator for this case) is installed for the
* BST, and so trust verification passes on the Signature.
*/
- @org.junit.Test
+ @Test
public void testValidatedBSTSignature() throws Exception {
WSSecSignature builder = new WSSecSignature();
builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConstants.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConstants.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConstants.java Sat Dec 19 12:16:09 2015
@@ -245,8 +245,9 @@ public class WSSConstants extends XMLSec
private static final Map<String, UsernameTokenPasswordType> lookup = new HashMap<>();
static {
- for (UsernameTokenPasswordType u : EnumSet.allOf(UsernameTokenPasswordType.class))
+ for (UsernameTokenPasswordType u : EnumSet.allOf(UsernameTokenPasswordType.class)) {
lookup.put(u.getNamespace(), u);
+ }
}
UsernameTokenPasswordType(String namespace) {
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java Sat Dec 19 12:16:09 2015
@@ -150,9 +150,10 @@ public class SecurityTokenFactoryImpl ex
final X509Certificate x509Certificate = x509SecurityToken.getX509Certificates()[0];
if (x509Certificate.getSerialNumber().compareTo(x509IssuerSerialType.getX509SerialNumber()) == 0 &&
- x509Certificate.getIssuerX500Principal().equals(new X500Principal(x509IssuerSerialType.getX509IssuerName())))
+ x509Certificate.getIssuerX500Principal().equals(new X500Principal(x509IssuerSerialType.getX509IssuerName()))) {
return createSecurityTokenProxy(inboundSecurityToken,
WSSecurityTokenConstants.KeyIdentifier_IssuerSerial);
+ }
}
}
//...then if none is found create a new SecurityToken instance
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java Sat Dec 19 12:16:09 2015
@@ -50,6 +50,7 @@ import org.apache.wss4j.stax.setup.Inbou
import org.apache.wss4j.stax.setup.WSSec;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -78,7 +79,7 @@ public class XOPAttachmentTest extends A
// Set up a test to encrypt the SOAP Body + an attachment, which is the same content as
// the SOAP Body. Then replace the encrypted SOAP Body with a xop:Include to the attachment,
// and modify the request to remove the encryption stuff pointing to the attachment.
- @org.junit.Test
+ @Test
public void testEncryptedSOAPBody() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
List<Attachment> attachments = createEncryptedBodyInAttachment(doc);
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XmlReaderToWriter.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XmlReaderToWriter.java?rev=1720903&r1=1720902&r2=1720903&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XmlReaderToWriter.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/XmlReaderToWriter.java Sat Dec 19 12:16:09 2015
@@ -46,10 +46,11 @@ public final class XmlReaderToWriter {
final String namespaceURI = xmlr.getNamespaceURI();
if (namespaceURI != null && namespaceURI.length() > 0) {
final String prefix = xmlr.getPrefix();
- if (prefix != null)
+ if (prefix != null) {
writer.writeStartElement(prefix, localName, namespaceURI);
- else
+ } else {
writer.writeStartElement(namespaceURI, localName);
+ }
} else {
writer.writeStartElement(localName);
}
@@ -68,10 +69,11 @@ public final class XmlReaderToWriter {
if (attUri != null && attUri.length() > 0) {
final String prefix = xmlr.getAttributePrefix(i);
- if (prefix != null)
+ if (prefix != null) {
writer.writeAttribute(prefix, attUri, xmlr.getAttributeLocalName(i), xmlr.getAttributeValue(i));
- else
+ } else {
writer.writeAttribute(attUri, xmlr.getAttributeLocalName(i), xmlr.getAttributeValue(i));
+ }
} else {
writer.writeAttribute(xmlr.getAttributeLocalName(i), xmlr.getAttributeValue(i));
}
@@ -101,10 +103,11 @@ public final class XmlReaderToWriter {
String encoding = xmlr.getCharacterEncodingScheme();
String version = xmlr.getVersion();
- if (encoding != null && version != null)
+ if (encoding != null && version != null) {
writer.writeStartDocument(encoding, version);
- else if (version != null)
+ } else if (version != null) {
writer.writeStartDocument(xmlr.getVersion());
+ }
break;
case XMLEvent.END_DOCUMENT:
writer.writeEndDocument();