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 2013/12/11 18:26:53 UTC
svn commit: r1550195 [2/2] - in /webservices/wss4j/trunk: ./ integration/
integration/src/test/java/org/apache/wss4j/integration/test/kerberos/
parent/ performance/ performance/src/ performance/src/test/
performance/src/test/java/ performance/src/test/...
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java Wed Dec 11 17:26:51 2013
@@ -62,8 +62,8 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.stax.ext.SecurePart;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ConfigurationConverterTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ConfigurationConverterTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ConfigurationConverterTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ConfigurationConverterTest.java Wed Dec 11 17:26:51 2013
@@ -29,8 +29,8 @@ import org.apache.wss4j.stax.ext.WSSSecu
import org.apache.wss4j.stax.ext.WSSConstants.UsernameTokenPasswordType;
import org.apache.wss4j.stax.securityToken.WSSecurityTokenConstants;
import org.apache.wss4j.stax.test.saml.SAMLCallbackHandlerImpl;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
/**
* Some tests for the ConfigurationConverter utility
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java Wed Dec 11 17:26:51 2013
@@ -43,10 +43,11 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
import org.apache.xml.security.stax.securityEvent.SignatureValueSecurityEvent;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -60,21 +61,30 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
+@RunWith(value = org.junit.runners.Parameterized.class)
public class DerivedKeyTokenTest extends AbstractTestBase {
+
+ final int version;
+
+ public DerivedKeyTokenTest(int version) {
+ this.version = version;
+ }
@BeforeClass
- public void setUp() throws Exception {
+ public static void setUp() throws Exception {
WSSConfig.init();
}
- @DataProvider(name = "versionProvider")
- public Object[][] versionProvider() {
- return new Object[][]{
- {ConversationConstants.VERSION_05_02},
- {ConversationConstants.VERSION_05_12}
- };
+ @Parameters(name = "{0}")
+ public static Collection<Object[]> data() {
+
+ return Arrays.asList(new Object[][] {{ConversationConstants.VERSION_05_02},
+ {ConversationConstants.VERSION_05_12}
+ });
}
@Test
@@ -110,8 +120,8 @@ public class DerivedKeyTokenTest extends
}
}
- @Test(dataProvider = "versionProvider")
- public void testEncryptionDecryptionTRIPLEDESInbound(int version) throws Exception {
+ @Test
+ public void testEncryptionDecryptionTRIPLEDESInbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
@@ -235,8 +245,8 @@ public class DerivedKeyTokenTest extends
}
}
- @Test(dataProvider = "versionProvider")
- public void testEncryptionDecryptionAES128Inbound(int version) throws Exception {
+ @Test
+ public void testEncryptionDecryptionAES128Inbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
@@ -323,8 +333,8 @@ public class DerivedKeyTokenTest extends
}
}
- @Test(dataProvider = "versionProvider")
- public void testSignatureInbound(int version) throws Exception {
+ @Test
+ public void testSignatureInbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
@@ -420,8 +430,8 @@ public class DerivedKeyTokenTest extends
}
}
- @Test(dataProvider = "versionProvider")
- public void testSignatureThumbprintSHA1Inbound(int version) throws Exception {
+ @Test
+ public void testSignatureThumbprintSHA1Inbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
@@ -512,8 +522,8 @@ public class DerivedKeyTokenTest extends
}
}
- @Test(dataProvider = "versionProvider")
- public void testSignatureSKIInbound(int version) throws Exception {
+ @Test
+ public void testSignatureSKIInbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
@@ -603,8 +613,8 @@ public class DerivedKeyTokenTest extends
}
}
- @Test(dataProvider = "versionProvider")
- public void testSignatureEncryptInbound(int version) throws Exception {
+ @Test
+ public void testSignatureEncryptInbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
@@ -726,8 +736,8 @@ public class DerivedKeyTokenTest extends
}
}
- @Test(dataProvider = "versionProvider")
- public void testEncryptSignatureInbound(int version) throws Exception {
+ @Test
+ public void testEncryptSignatureInbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
{
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java Wed Dec 11 17:26:51 2013
@@ -49,8 +49,8 @@ import org.apache.xml.security.stax.secu
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
import org.apache.xml.security.utils.Base64;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -2222,7 +2222,8 @@ public class EncDecryptionTest extends A
}
}
- @Test(enabled = false) //WSS4J does not support OAEPParams atm
+ @Test
+ @org.junit.Ignore //WSS4J does not support OAEPParams atm
public void testKeyWrappingRSAOAEPAESGCM192SHA384MGF1SHA384PSourceInbound() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncryptionCRLTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncryptionCRLTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncryptionCRLTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncryptionCRLTest.java Wed Dec 11 17:26:51 2013
@@ -30,8 +30,8 @@ import javax.xml.xpath.XPathExpression;
import org.apache.wss4j.stax.ext.WSSConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.securityToken.WSSecurityTokenConstants;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/HeaderOrderingTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/HeaderOrderingTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/HeaderOrderingTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/HeaderOrderingTest.java Wed Dec 11 17:26:51 2013
@@ -32,8 +32,8 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.xml.security.stax.ext.SecurePart;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEventListener;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -42,6 +42,7 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InboundWSSecurityContextImplTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InboundWSSecurityContextImplTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InboundWSSecurityContextImplTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InboundWSSecurityContextImplTest.java Wed Dec 11 17:26:51 2013
@@ -40,12 +40,13 @@ import org.apache.xml.security.stax.ext.
import org.apache.xml.security.stax.ext.stax.XMLSecEventFactory;
import org.apache.xml.security.stax.impl.util.IDGenerator;
import org.apache.xml.security.stax.securityEvent.*;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.opensaml.common.SAMLVersion;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
import javax.xml.namespace.QName;
+
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
@@ -56,7 +57,7 @@ import java.util.List;
public class InboundWSSecurityContextImplTest {
@BeforeClass
- public void setUp() throws Exception {
+ public static void setUp() throws Exception {
WSProviderConfig.init();
Init.init(WSSec.class.getClassLoader().getResource("wss/wss-config.xml").toURI());
}
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=1550195&r1=1550194&r2=1550195&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 Wed Dec 11 17:26:51 2013
@@ -31,8 +31,8 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.ext.SecurePart;
import org.apache.xml.security.stax.securityEvent.*;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.*;
import javax.xml.namespace.QName;
@@ -49,7 +49,7 @@ import java.util.*;
public class InteroperabilityTest extends AbstractTestBase {
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityInbound() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -150,7 +150,7 @@ public class InteroperabilityTest extend
);
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityInboundSOAP12() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.2.xml");
@@ -205,7 +205,7 @@ public class InteroperabilityTest extend
securityEventListener.compare();
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityEncryptedSignatureInbound() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -355,7 +355,7 @@ public class InteroperabilityTest extend
}
*/
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityInboundReverseOrder() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -508,7 +508,7 @@ public class InteroperabilityTest extend
doInboundSecurityWithWSS4J(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityInboundSecurityHeaderTimestampOrder() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -768,154 +768,157 @@ public class InteroperabilityTest extend
*
* @throws Exception
*/
- @Test(invocationCount = 100) //retest 100 times to make sure we don't have a threading issue
+ @Test
public void testSignatureC14NInclusivePartsInbound() throws Exception {
- Document securedDocument;
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- {
- WSSSecurityProperties securityProperties = new WSSSecurityProperties();
- List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
- actions.add(WSSConstants.SIGNATURE);
- actions.add(WSSConstants.ENCRYPT);
- securityProperties.setActions(actions);
- securityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
- securityProperties.setSignatureUser("transmitter");
- securityProperties.setEncryptionUser("receiver");
- securityProperties.addSignaturePart(new SecurePart(new QName("http://www.w3.org/1999/XMLSchema", "complexType"), SecurePart.Modifier.Element));
- securityProperties.setSignatureCanonicalizationAlgorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments");
- securityProperties.setCallbackHandler(new CallbackHandlerImpl());
-
- OutboundWSSec wsSecOut = WSSec.getOutboundWSSec(securityProperties);
- XMLStreamWriter xmlStreamWriter = wsSecOut.processOutMessage(baos, "UTF-8", new ArrayList<SecurityEvent>());
- XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml"));
- XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
- xmlStreamWriter.close();
-
- securedDocument = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
- NodeList nodeList = securedDocument.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
- Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
- }
-
- {
- String action = WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT;
- Properties properties = new Properties();
- doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action, properties, false);
- }
-
- //done signature; now test sig-verification:
- {
- WSSSecurityProperties securityProperties = new WSSSecurityProperties();
- securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
- securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
- securityProperties.setCallbackHandler(new CallbackHandlerImpl());
- securityProperties.addIgnoreBSPRule(BSPRule.R5404);
- securityProperties.addIgnoreBSPRule(BSPRule.R5423);
- securityProperties.addIgnoreBSPRule(BSPRule.R5412);
- InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
-
- WSSecurityEventConstants.Event[] expectedSecurityEvents = new WSSecurityEventConstants.Event[]{
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.X509Token,
- WSSecurityEventConstants.X509Token,
- WSSecurityEventConstants.SignatureValue,
- WSSecurityEventConstants.EncryptedPart,
- WSSecurityEventConstants.Operation,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.AlgorithmSuite,
- WSSecurityEventConstants.SignedElement,
- };
- final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
- XMLStreamReader xmlStreamReader = wsSecIn.processInMessage(
- xmlInputFactory.createXMLStreamReader(new ByteArrayInputStream(baos.toByteArray())), null, securityEventListener);
-
- Document document = StAX2DOM.readDoc(documentBuilderFactory.newDocumentBuilder(), xmlStreamReader);
-
- //header element must still be there
- NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
- Assert.assertEquals(nodeList.getLength(), 1);
- Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
-
- securityEventListener.compare();
+ //retest 100 times to make sure we don't have a threading issue
+ for (int i = 0; i < 100; i++) {
+ Document securedDocument;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ {
+ WSSSecurityProperties securityProperties = new WSSSecurityProperties();
+ List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
+ actions.add(WSSConstants.SIGNATURE);
+ actions.add(WSSConstants.ENCRYPT);
+ securityProperties.setActions(actions);
+ securityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+ securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+ securityProperties.setSignatureUser("transmitter");
+ securityProperties.setEncryptionUser("receiver");
+ securityProperties.addSignaturePart(new SecurePart(new QName("http://www.w3.org/1999/XMLSchema", "complexType"), SecurePart.Modifier.Element));
+ securityProperties.setSignatureCanonicalizationAlgorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments");
+ securityProperties.setCallbackHandler(new CallbackHandlerImpl());
+
+ OutboundWSSec wsSecOut = WSSec.getOutboundWSSec(securityProperties);
+ XMLStreamWriter xmlStreamWriter = wsSecOut.processOutMessage(baos, "UTF-8", new ArrayList<SecurityEvent>());
+ XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml"));
+ XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
+ xmlStreamWriter.close();
+
+ securedDocument = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
+ NodeList nodeList = securedDocument.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
+ Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
+ }
+
+ {
+ String action = WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT;
+ Properties properties = new Properties();
+ doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action, properties, false);
+ }
+
+ //done signature; now test sig-verification:
+ {
+ WSSSecurityProperties securityProperties = new WSSSecurityProperties();
+ securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+ securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+ securityProperties.setCallbackHandler(new CallbackHandlerImpl());
+ securityProperties.addIgnoreBSPRule(BSPRule.R5404);
+ securityProperties.addIgnoreBSPRule(BSPRule.R5423);
+ securityProperties.addIgnoreBSPRule(BSPRule.R5412);
+ InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
+
+ WSSecurityEventConstants.Event[] expectedSecurityEvents = new WSSecurityEventConstants.Event[]{
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.X509Token,
+ WSSecurityEventConstants.X509Token,
+ WSSecurityEventConstants.SignatureValue,
+ WSSecurityEventConstants.EncryptedPart,
+ WSSecurityEventConstants.Operation,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.AlgorithmSuite,
+ WSSecurityEventConstants.SignedElement,
+ };
+ final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
+ XMLStreamReader xmlStreamReader = wsSecIn.processInMessage(
+ xmlInputFactory.createXMLStreamReader(new ByteArrayInputStream(baos.toByteArray())), null, securityEventListener);
+
+ Document document = StAX2DOM.readDoc(documentBuilderFactory.newDocumentBuilder(), xmlStreamReader);
+
+ //header element must still be there
+ NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
+ Assert.assertEquals(nodeList.getLength(), 1);
+ Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
+
+ securityEventListener.compare();
+ }
}
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilitySOAPActionInbound() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -971,7 +974,7 @@ public class InteroperabilityTest extend
securityEventListener.compare();
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityInvalidSOAPActionInbound() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -1013,7 +1016,7 @@ public class InteroperabilityTest extend
securityEventListener.compare();
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilitySOAPRoleInbound() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.2.xml");
@@ -1069,7 +1072,7 @@ public class InteroperabilityTest extend
securityEventListener.compare();
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityTwoSecurityHeadersSOAPRoleInbound() throws Exception {
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.2.xml");
@@ -1110,7 +1113,7 @@ public class InteroperabilityTest extend
));
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilitySOAPActionOutbound() throws Exception {
WSSSecurityProperties securityProperties = new WSSSecurityProperties();
@@ -1135,7 +1138,7 @@ public class InteroperabilityTest extend
doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action, properties, false);
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityInvalidSOAPActionOutbound() throws Exception {
WSSSecurityProperties securityProperties = new WSSSecurityProperties();
@@ -1165,7 +1168,7 @@ public class InteroperabilityTest extend
}
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilitySOAPRoleOutbound() throws Exception {
WSSSecurityProperties securityProperties = new WSSSecurityProperties();
@@ -1191,7 +1194,7 @@ public class InteroperabilityTest extend
doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action, properties, false);
}
- @Test(invocationCount = 1)
+ @Test
public void testInteroperabilityTwoSecurityHeadersSOAPRoleOutbound() throws Exception {
WSSSecurityProperties securityProperties = new WSSSecurityProperties();
@@ -1219,7 +1222,7 @@ public class InteroperabilityTest extend
doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action, properties, false);
}
- @Test(invocationCount = 1)
+ @Test
public void testInvalidXML() throws Exception {
int i = 0;
@@ -1280,7 +1283,7 @@ public class InteroperabilityTest extend
StringWriter stringWriter = new StringWriter();
PrintWriter pw = new PrintWriter(stringWriter);
ex.printStackTrace(pw);
- Assert.assertFalse((t instanceof NullPointerException), stringWriter.toString());
+ Assert.assertFalse(stringWriter.toString(), (t instanceof NullPointerException));
t = t.getCause();
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/OutputChainTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/OutputChainTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/OutputChainTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/OutputChainTest.java Wed Dec 11 17:26:51 2013
@@ -25,8 +25,8 @@ import org.apache.wss4j.stax.ext.Outboun
import org.apache.wss4j.stax.ext.WSSConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordEncryptorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordEncryptorTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordEncryptorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordEncryptorTest.java Wed Dec 11 17:26:51 2013
@@ -40,8 +40,8 @@ import org.apache.wss4j.stax.ext.WSSCons
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordTypeTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordTypeTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordTypeTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PasswordTypeTest.java Wed Dec 11 17:26:51 2013
@@ -36,8 +36,8 @@ import org.apache.wss4j.stax.ext.Inbound
import org.apache.wss4j.stax.ext.WSSConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java Wed Dec 11 17:26:51 2013
@@ -39,7 +39,6 @@ import org.apache.wss4j.stax.securityEve
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
-
import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.stax.WSSec;
import org.apache.wss4j.stax.ext.InboundWSSec;
@@ -47,8 +46,8 @@ import org.apache.wss4j.stax.ext.WSSCons
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.test.saml.SAML1CallbackHandler;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
/**
* A test for various Principals...
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java Wed Dec 11 17:26:51 2013
@@ -40,8 +40,8 @@ import org.apache.wss4j.stax.ext.WSSSecu
import org.apache.wss4j.stax.test.saml.SAML2CallbackHandler;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java Wed Dec 11 17:26:51 2013
@@ -42,10 +42,11 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SignatureValueSecurityEvent;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -54,27 +55,37 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import java.util.Properties;
+@RunWith(value = org.junit.runners.Parameterized.class)
public class SecurityContextTokenTest extends AbstractTestBase {
+ final int version;
+
+ public SecurityContextTokenTest(int version) {
+ this.version = version;
+ }
+
+ @Parameters(name = "{0}")
+ public static Collection<Object[]> data() {
+
+ return Arrays.asList(new Object[][] {{ConversationConstants.VERSION_05_02},
+ {ConversationConstants.VERSION_05_12}
+ });
+ }
+
@BeforeClass
- public void setUp() throws Exception {
+ public static void setUp() throws Exception {
WSSConfig.init();
}
- @DataProvider(name = "versionProvider")
- public Object[][] versionProvider() {
- return new Object[][]{
- {ConversationConstants.VERSION_05_02},
- {ConversationConstants.VERSION_05_12}
- };
- }
-
@Test
public void testSCTDKTEncryptOutbound() throws Exception {
byte[] secret = new byte[128 / 8];
@@ -120,8 +131,8 @@ public class SecurityContextTokenTest ex
}
}
- @Test(dataProvider = "versionProvider")
- public void testSCTDKTEncryptInbound(int version) throws Exception {
+ @Test
+ public void testSCTDKTEncryptInbound() throws Exception {
byte[] tempSecret = WSSecurityUtil.generateNonce(16);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -250,8 +261,8 @@ public class SecurityContextTokenTest ex
}
}
- @Test(dataProvider = "versionProvider")
- public void testSCTKDKTSignInbound(int version) throws Exception {
+ @Test
+ public void testSCTKDKTSignInbound() throws Exception {
byte[] tempSecret = WSSecurityUtil.generateNonce(16);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -344,8 +355,8 @@ public class SecurityContextTokenTest ex
}
}
- @Test(dataProvider = "versionProvider")
- public void testSCTKDKTSignAbsoluteInbound(int version) throws Exception {
+ @Test
+ public void testSCTKDKTSignAbsoluteInbound() throws Exception {
byte[] tempSecret = WSSecurityUtil.generateNonce(16);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -391,8 +402,8 @@ public class SecurityContextTokenTest ex
}
}
- @Test(dataProvider = "versionProvider")
- public void testSCTKDKTSignEncrypt(int version) throws Exception {
+ @Test()
+ public void testSCTKDKTSignEncrypt() throws Exception {
byte[] tempSecret = WSSecurityUtil.generateNonce(16);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -505,8 +516,8 @@ public class SecurityContextTokenTest ex
}
}
- @Test(dataProvider = "versionProvider")
- public void testSCTKDKTEncryptSign(int version) throws Exception {
+ @Test
+ public void testSCTKDKTEncryptSign() throws Exception {
byte[] tempSecret = WSSecurityUtil.generateNonce(16);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -619,8 +630,8 @@ public class SecurityContextTokenTest ex
}
}
- @Test(dataProvider = "versionProvider")
- public void testSCTSign(int version) throws Exception {
+ @Test
+ public void testSCTSign() throws Exception {
byte[] tempSecret = WSSecurityUtil.generateNonce(16);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCRLTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCRLTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCRLTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCRLTest.java Wed Dec 11 17:26:51 2013
@@ -38,8 +38,8 @@ import org.apache.wss4j.stax.ext.Inbound
import org.apache.wss4j.stax.ext.WSSConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCertConstaintsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCertConstaintsTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCertConstaintsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureCertConstaintsTest.java Wed Dec 11 17:26:51 2013
@@ -40,8 +40,8 @@ import org.apache.wss4j.stax.ext.Inbound
import org.apache.wss4j.stax.ext.WSSConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureConfirmationTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureConfirmationTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureConfirmationTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureConfirmationTest.java Wed Dec 11 17:26:51 2013
@@ -28,8 +28,8 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.xml.security.stax.ext.SecurePart;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEventListener;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureEncryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureEncryptionTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureEncryptionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureEncryptionTest.java Wed Dec 11 17:26:51 2013
@@ -57,8 +57,8 @@ import org.apache.xml.security.stax.impl
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityToken.OutboundSecurityToken;
import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java Wed Dec 11 17:26:51 2013
@@ -68,8 +68,8 @@ import org.apache.xml.security.exception
import org.apache.xml.security.stax.ext.SecurePart;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SignatureValueSecurityEvent;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/TimestampTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/TimestampTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/TimestampTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/TimestampTest.java Wed Dec 11 17:26:51 2013
@@ -28,8 +28,8 @@ import org.apache.wss4j.stax.WSSec;
import org.apache.wss4j.stax.ext.*;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java Wed Dec 11 17:26:51 2013
@@ -52,8 +52,8 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEventListener;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/VulnerabliltyVectorsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/VulnerabliltyVectorsTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/VulnerabliltyVectorsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/VulnerabliltyVectorsTest.java Wed Dec 11 17:26:51 2013
@@ -30,8 +30,8 @@ import org.apache.wss4j.stax.ext.WSSSecu
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.apache.xml.security.stax.config.Init;
import org.apache.xml.security.stax.config.TransformerAlgorithmMapper;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java Wed Dec 11 17:26:51 2013
@@ -46,9 +46,9 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
+import org.junit.Assert;
+import org.junit.Test;
import org.opensaml.common.SAMLVersion;
-import org.testng.Assert;
-import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -57,6 +57,7 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenNegativeTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenNegativeTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenNegativeTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenNegativeTest.java Wed Dec 11 17:26:51 2013
@@ -28,8 +28,8 @@ import org.apache.wss4j.stax.ext.WSSCons
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.test.AbstractTestBase;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -38,6 +38,7 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java Wed Dec 11 17:26:51 2013
@@ -46,9 +46,9 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
+import org.junit.Assert;
+import org.junit.Test;
import org.opensaml.common.SAMLVersion;
-import org.testng.Assert;
-import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenSVTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenSVTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenSVTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenSVTest.java Wed Dec 11 17:26:51 2013
@@ -33,9 +33,9 @@ import org.apache.wss4j.stax.test.Callba
import org.apache.wss4j.stax.test.utils.StAX2DOM;
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
+import org.junit.Assert;
+import org.junit.Test;
import org.opensaml.common.SAMLVersion;
-import org.testng.Assert;
-import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java Wed Dec 11 17:26:51 2013
@@ -32,6 +32,8 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.joda.time.DateTime;
+import org.junit.Assert;
+import org.junit.Test;
import org.opensaml.Configuration;
import org.opensaml.common.SAMLObjectBuilder;
import org.opensaml.common.SAMLVersion;
@@ -40,8 +42,6 @@ import org.opensaml.saml2.core.Condition
import org.opensaml.xml.XMLObjectBuilder;
import org.opensaml.xml.XMLObjectBuilderFactory;
import org.opensaml.xml.schema.XSAny;
-import org.testng.Assert;
-import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlConditionsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlConditionsTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlConditionsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlConditionsTest.java Wed Dec 11 17:26:51 2013
@@ -32,9 +32,9 @@ import org.apache.wss4j.stax.test.utils.
import org.apache.wss4j.stax.test.utils.XmlReaderToWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.joda.time.DateTime;
+import org.junit.Assert;
+import org.junit.Test;
import org.opensaml.Configuration;
-import org.testng.Assert;
-import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlTokenDerivedTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlTokenDerivedTest.java?rev=1550195&r1=1550194&r2=1550195&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlTokenDerivedTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlTokenDerivedTest.java Wed Dec 11 17:26:51 2013
@@ -42,8 +42,8 @@ import org.apache.wss4j.stax.test.Abstra
import org.apache.wss4j.stax.test.CallbackHandlerImpl;
import org.apache.wss4j.stax.test.utils.SOAPUtil;
import org.apache.wss4j.stax.test.utils.StAX2DOM;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;