Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/DerivedKeyTokenTest.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/DerivedKeyTokenTest.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/DerivedKeyTokenTest.java (original) +++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/DerivedKeyTokenTest.java Mon Apr 1 18:28:38 2013 @@ -76,7 +76,7 @@ public class DerivedKeyTokenTest extends @org.junit.Test public void testHashcode() throws Exception{ assertEquals(token.hashCode(), tokenEqual.hashCode()); - assertTrue(!(token.hashCode() == tokenNotEqual.hashCode())); + assertFalse((token.hashCode() == tokenNotEqual.hashCode())); } private static org.w3c.dom.Document createReferenceDocument(
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/ReferenceTest.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/ReferenceTest.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/ReferenceTest.java (original) +++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/ReferenceTest.java Mon Apr 1 18:28:38 2013 @@ -125,7 +125,7 @@ public class ReferenceTest extends org.j @org.junit.Test public void testHashcode() throws Exception{ assertEquals(ref.hashCode(), refEqual.hashCode()); - assertTrue(!(ref.hashCode() == refNotEqual.hashCode())); + assertFalse((ref.hashCode() == refNotEqual.hashCode())); } private static org.w3c.dom.Document Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/SecurityTokenReferenceTest.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/SecurityTokenReferenceTest.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/SecurityTokenReferenceTest.java (original) +++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/SecurityTokenReferenceTest.java Mon Apr 1 18:28:38 2013 @@ -111,7 +111,7 @@ public class SecurityTokenReferenceTest // Create the STR SecurityTokenReference str = new SecurityTokenReference(doc); str.addWSSENamespace(); - str.setKeyIdentifier((String)null, "#123"); + str.setKeyIdentifier(null, "#123"); Element strElement = str.getElement(); if (LOG.isDebugEnabled()) { 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -140,10 +140,9 @@ public class EncryptedKeyDataRefTest ext boolean found = false; for (int i = 0; i < wsResults.size(); i++) { - WSSecurityEngineResult wsSecEngineResult = - (WSSecurityEngineResult)wsResults.get(i); - int action = ((java.lang.Integer) - wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION)).intValue(); + WSSecurityEngineResult wsSecEngineResult = wsResults.get(i); + int action = (Integer) + wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION); // We want to filter only encryption results if (action != WSConstants.ENCR) { 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -136,10 +136,9 @@ public class ReferenceListDataRefTest ex boolean found = false; for (int i = 0; i < wsResults.size(); i++) { - WSSecurityEngineResult wsSecEngineResult = - (WSSecurityEngineResult)wsResults.get(i); - int action = ((java.lang.Integer) - wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION)).intValue(); + WSSecurityEngineResult wsSecEngineResult = wsResults.get(i); + int action = (Integer) + wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION); // We want to filter only encryption results if (action != WSConstants.ENCR) { 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -97,7 +97,7 @@ public class SamlConditionsTest extends SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); assertTrue(receivedSamlAssertion.getSignatureValue() == null); } 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -138,11 +138,11 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml1:Assertion", xpath); } @@ -202,11 +202,11 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml1:Assertion", xpath); } @@ -268,7 +268,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -333,7 +333,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -468,7 +468,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body/add", xpath); @@ -545,7 +545,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body/add", xpath); } @@ -603,11 +603,11 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml2:Assertion", xpath); } @@ -648,7 +648,7 @@ public class SamlReferenceTest extends o LOG.debug("Signed SAML2 message Direct Reference (sender vouches):"); LOG.debug(outputString); } - assertTrue(!outputString.contains(WSConstants.WSS_SAML2_KI_VALUE_TYPE)); + assertFalse(outputString.contains(WSConstants.WSS_SAML2_KI_VALUE_TYPE)); assertTrue(outputString.contains(WSConstants.WSS_SAML2_TOKEN_TYPE)); List<WSSecurityEngineResult> results = verify(signedDoc, crypto, null); @@ -666,11 +666,11 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml2:Assertion", xpath); } @@ -732,7 +732,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -778,7 +778,7 @@ public class SamlReferenceTest extends o LOG.debug("Signed SAML2 message Direct Reference (holder-of-key):"); LOG.debug(outputString); } - assertTrue(!outputString.contains(WSConstants.WSS_SAML2_KI_VALUE_TYPE)); + assertFalse(outputString.contains(WSConstants.WSS_SAML2_KI_VALUE_TYPE)); assertTrue(outputString.contains(WSConstants.WSS_SAML2_TOKEN_TYPE)); List<WSSecurityEngineResult> results = verify(signedDoc, trustCrypto, null); @@ -797,7 +797,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -873,7 +873,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body/add", xpath); @@ -931,7 +931,7 @@ public class SamlReferenceTest extends o LOG.debug("Encrypted SAML 2 message Direct Reference (holder-of-key):"); LOG.debug(outputString); } - assertTrue(!outputString.contains(WSConstants.WSS_SAML2_KI_VALUE_TYPE)); + assertFalse(outputString.contains(WSConstants.WSS_SAML2_KI_VALUE_TYPE)); assertTrue(outputString.contains(WSConstants.WSS_SAML2_TOKEN_TYPE)); List<WSSecurityEngineResult> results = verify(doc, trustCrypto, userCrypto); @@ -950,7 +950,7 @@ public class SamlReferenceTest extends o (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body/add", xpath); 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -123,11 +123,11 @@ public class SamlTokenDerivedTest extend (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml1:Assertion", xpath); } 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -114,11 +114,11 @@ public class SamlTokenSVTest extends org (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml1:Assertion", xpath); } @@ -174,11 +174,11 @@ public class SamlTokenSVTest extends org (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml1:Assertion", xpath); } @@ -234,11 +234,11 @@ public class SamlTokenSVTest extends org (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml2:Assertion", xpath); } @@ -294,11 +294,11 @@ public class SamlTokenSVTest extends org (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 2); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - wsDataRef = (WSDataRef)refs.get(1); + wsDataRef = refs.get(1); xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Header/wsse:Security/saml2:Assertion", xpath); } 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -104,7 +104,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); assertTrue(receivedSamlAssertion.getSignatureValue() == null); } @@ -143,7 +143,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); assertTrue(receivedSamlAssertion.getSignatureValue() == null); } @@ -181,7 +181,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -219,7 +219,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -256,7 +256,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -292,7 +292,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -330,7 +330,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -348,7 +348,7 @@ public class SamlTokenTest extends org.j reqData.setMsgContext(config); final java.util.List<Integer> actions = new java.util.ArrayList<Integer>(); - actions.add(Integer.valueOf(action)); + actions.add(action); final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG); CustomHandler handler = new CustomHandler(); handler.send( @@ -372,7 +372,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -488,7 +488,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -528,7 +528,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -569,7 +569,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -610,7 +610,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -650,7 +650,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -705,7 +705,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** @@ -751,7 +751,7 @@ public class SamlTokenTest extends org.j SamlAssertionWrapper receivedSamlAssertion = (SamlAssertionWrapper) actionResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); assertTrue(receivedSamlAssertion != null); - assertTrue(!receivedSamlAssertion.isSigned()); + assertFalse(receivedSamlAssertion.isSigned()); } /** 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=1463243&r1=1463242&r2=1463243&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 Mon Apr 1 18:28:38 2013 @@ -119,8 +119,8 @@ public class SignedSamlTokenHOKTest exte LOG.debug("Signed SAML 1.1 Authn Assertion (key holder):"); LOG.debug(outputString); } - assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmlenc#sha256") != -1); - assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256") != -1); + assertTrue(outputString.contains("http://www.w3.org/2001/04/xmlenc#sha256")); + assertTrue(outputString.contains("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256")); List<WSSecurityEngineResult> results = verify(signedDoc, trustCrypto); @@ -141,7 +141,7 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -183,8 +183,7 @@ public class SignedSamlTokenHOKTest exte LOG.debug(outputString); } - /*TODO - Re-enable this when WSS-265 is fixed: - * https://issues.apache.org/jira/browse/WSS-265 + /* https://issues.apache.org/jira/browse/WSS-265 */ List<WSSecurityEngineResult> results = verify(signedDoc, trustCrypto); // Test we processed a SAML assertion @@ -203,10 +202,9 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - */ } /** @@ -245,8 +243,8 @@ public class SignedSamlTokenHOKTest exte LOG.debug("Signed SAML 2 Authn Assertion (key holder):"); LOG.debug(outputString); } - assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmlenc#sha256") != -1); - assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256") != -1); + assertTrue(outputString.contains("http://www.w3.org/2001/04/xmlenc#sha256")); + assertTrue(outputString.contains("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256")); List<WSSecurityEngineResult> results = verify(signedDoc, trustCrypto); @@ -266,7 +264,7 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -309,9 +307,7 @@ public class SignedSamlTokenHOKTest exte LOG.debug(outputString); } - /* - * TODO - Re-enable this when WSS-265 is fixed: - * https://issues.apache.org/jira/browse/WSS-265 + /* https://issues.apache.org/jira/browse/WSS-265 */ List<WSSecurityEngineResult> results = verify(signedDoc, trustCrypto); // Test we processed a SAML assertion @@ -330,10 +326,9 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); - */ } /** @@ -392,7 +387,7 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -453,7 +448,7 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -514,7 +509,7 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } @@ -581,7 +576,7 @@ public class SignedSamlTokenHOKTest exte (List<WSDataRef>) actionResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); assertTrue(refs.size() == 1); - WSDataRef wsDataRef = (WSDataRef)refs.get(0); + WSDataRef wsDataRef = refs.get(0); String xpath = wsDataRef.getXpath(); assertEquals("/SOAP-ENV:Envelope/SOAP-ENV:Body", xpath); } Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/WSSec.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/WSSec.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/WSSec.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/WSSec.java Mon Apr 1 18:28:38 2013 @@ -43,7 +43,6 @@ import org.apache.xml.security.stax.ext. */ public class WSSec { - //todo crl check //todo outgoing client setup per policy static { Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureInputHandler.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureInputHandler.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureInputHandler.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureInputHandler.java Mon Apr 1 18:28:38 2013 @@ -80,7 +80,7 @@ public class WSSSignatureInputHandler ex if (!WSSConstants.NS_XMLDSIG_HMACSHA1.equals(algorithm) && !WSSConstants.NS_XMLDSIG_RSASHA1.equals(algorithm)) { securityContext.handleBSPRule(BSPRule.R5421); } - //todo test: + BigInteger hmacOutputLength = XMLSecurityUtils.getQNameType( signatureType.getSignedInfo().getSignatureMethod().getContent(), WSSConstants.TAG_dsig_HMACOutputLength); @@ -153,7 +153,6 @@ public class WSSSignatureInputHandler ex } signatureTokenValidator.validate(inboundSecurityToken, (WSSSecurityProperties) securityProperties); - //todo element path? //we have to emit a TokenSecurityEvent here too since it could be an embedded token inboundSecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_Signature); TokenSecurityEvent tokenSecurityEvent = WSSUtils.createTokenSecurityEvent(inboundSecurityToken, signatureType.getId()); Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/UsernameSecurityTokenImpl.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/UsernameSecurityTokenImpl.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/UsernameSecurityTokenImpl.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/UsernameSecurityTokenImpl.java Mon Apr 1 18:28:38 2013 @@ -46,7 +46,7 @@ public class UsernameSecurityTokenImpl e private String username; private String password; private String createdTime; - private String nonce; + private byte[] nonce; private byte[] salt; private Long iteration; private final WSInboundSecurityContext wsInboundSecurityContext; @@ -54,7 +54,7 @@ public class UsernameSecurityTokenImpl e private Principal principal; public UsernameSecurityTokenImpl(WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType, - String username, String password, String createdTime, String nonce, + String username, String password, String createdTime, byte[] nonce, byte[] salt, Long iteration, WSInboundSecurityContext wsInboundSecurityContext, String id, WSSecurityTokenConstants.KeyIdentifier keyIdentifier) { @@ -190,7 +190,7 @@ public class UsernameSecurityTokenImpl e } @Override - public String getNonce() { + public byte[] getNonce() { return nonce; } }; @@ -214,7 +214,7 @@ public class UsernameSecurityTokenImpl e return username; } - public String getNonce() { + public byte[] getNonce() { return nonce; } Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/UsernameSecurityToken.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/UsernameSecurityToken.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/UsernameSecurityToken.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/UsernameSecurityToken.java Mon Apr 1 18:28:38 2013 @@ -33,7 +33,7 @@ public interface UsernameSecurityToken e String getUsername(); - String getNonce(); + byte[] getNonce(); byte[] getSalt(); Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java Mon Apr 1 18:28:38 2013 @@ -23,6 +23,7 @@ import javax.security.auth.callback.Call import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; +import org.apache.commons.codec.binary.Base64; import org.apache.wss4j.binding.wss10.EncodedString; import org.apache.wss4j.binding.wss10.PasswordString; import org.apache.wss4j.binding.wss10.UsernameTokenType; @@ -100,6 +101,13 @@ public class JAASUsernameTokenValidatorI final EncodedString encodedNonce = XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_wsse_Nonce); + byte[] nonceVal = null; + if (encodedNonce != null) { + if (!WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(encodedNonce.getEncodingType())) { + throw new WSSecurityException(WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN, "badTokenType01"); + } + nonceVal = Base64.decodeBase64(encodedNonce.getValue()); + } final AttributedDateTime attributedDateTimeCreated = XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_wsu_Created); @@ -107,8 +115,7 @@ public class JAASUsernameTokenValidatorI UsernameSecurityTokenImpl usernameSecurityToken = new UsernameSecurityTokenImpl( usernameTokenPasswordType, username, password, attributedDateTimeCreated != null ? attributedDateTimeCreated.getValue() : null, - encodedNonce != null ? encodedNonce.getValue() : null, - null, null, + nonceVal, null, null, tokenContext.getWsSecurityContext(), usernameTokenType.getId(), WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference); usernameSecurityToken.setElementPath(tokenContext.getElementPath()); Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java Mon Apr 1 18:28:38 2013 @@ -119,7 +119,7 @@ public class UsernameTokenValidatorImpl UsernameSecurityTokenImpl usernameSecurityToken = new UsernameSecurityTokenImpl( usernameTokenPasswordType, username.getValue(), password, created, - encodedNonce != null ? encodedNonce.getValue() : null, salt, iteration, + nonceVal, salt, iteration, tokenContext.getWsSecurityContext(), usernameTokenType.getId(), WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference); usernameSecurityToken.setElementPath(tokenContext.getElementPath()); Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java Mon Apr 1 18:28:38 2013 @@ -511,7 +511,7 @@ public abstract class AbstractTestBase { for (WSSecurityEngineResult result : wsResult) { boolean found = false; for (WSSecurityEngineResult res : wsSecurityEngineResults) { - if (((Integer) result.get(WSSecurityEngineResult.TAG_ACTION)).equals((Integer) res.get(WSSecurityEngineResult.TAG_ACTION))) { + if (result.get(WSSecurityEngineResult.TAG_ACTION).equals(res.get(WSSecurityEngineResult.TAG_ACTION))) { found = true; break; } Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java?rev=1463243&r1=1463242&r2=1463243&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java Mon Apr 1 18:28:38 2013 @@ -1248,7 +1248,7 @@ public class InteroperabilityTest extend StringWriter stringWriter = new StringWriter(); PrintWriter pw = new PrintWriter(stringWriter); ex.printStackTrace(pw); - Assert.assertTrue(!(t instanceof NullPointerException), stringWriter.toString()); + Assert.assertFalse((t instanceof NullPointerException), stringWriter.toString()); t = t.getCause(); } }
