ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1660434 [2/2] - in /webservices/wss4j/trunk: ws-security-dom/src/main/java/org/apache/wss4j/dom/action/ ws-security-dom/src/main/java/org/apache/wss4j/dom/message/ ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/ ws-security-dom/sr...
Date Tue, 17 Feb 2015 16:19:11 GMT
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=1660434&r1=1660433&r2=1660434&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
Tue Feb 17 16:19:10 2015
@@ -50,7 +50,6 @@ import org.w3c.dom.Node;
 import java.io.InputStream;
 import java.security.KeyStore;
 import java.util.List;
-import java.util.ArrayList;
 
 import javax.security.auth.callback.CallbackHandler;
 
@@ -441,13 +440,12 @@ public class SamlReferenceTest extends o
         builder.setCustomEKTokenId(samlAssertion.getId());
         builder.prepare(doc, userCrypto);
         
-        List<WSEncryptionPart> parts = new ArrayList<>();
         WSEncryptionPart encP = 
             new WSEncryptionPart(
                 "add", "http://ws.apache.org/counter/counter_port_type", "Element"
             );
-        parts.add(encP);
-        Element refElement = builder.encryptForRef(null, parts);
+        builder.getParts().add(encP);
+        Element refElement = builder.encrypt();
         builder.addInternalRefElement(refElement);
         builder.appendToHeader(secHeader);
 
@@ -518,13 +516,12 @@ public class SamlReferenceTest extends o
         builder.setCustomEKTokenId(samlAssertion.getId());
         builder.prepare(doc, userCrypto);
         
-        List<WSEncryptionPart> parts = new ArrayList<>();
         WSEncryptionPart encP = 
             new WSEncryptionPart(
                 "add", "http://ws.apache.org/counter/counter_port_type", "Element"
             );
-        parts.add(encP);
-        Element refElement = builder.encryptForRef(null, parts);
+        builder.getParts().add(encP);
+        Element refElement = builder.encrypt();
         builder.addInternalRefElement(refElement);
         builder.appendToHeader(secHeader);
 
@@ -846,13 +843,12 @@ public class SamlReferenceTest extends o
         builder.setCustomEKTokenId(samlAssertion.getId());
         builder.prepare(doc, userCrypto);
         
-        List<WSEncryptionPart> parts = new ArrayList<>();
         WSEncryptionPart encP = 
             new WSEncryptionPart(
                 "add", "http://ws.apache.org/counter/counter_port_type", "Element"
             );
-        parts.add(encP);
-        Element refElement = builder.encryptForRef(null, parts);
+        builder.getParts().add(encP);
+        Element refElement = builder.encrypt();
         builder.addInternalRefElement(refElement);
         builder.appendToHeader(secHeader);
 
@@ -923,13 +919,12 @@ public class SamlReferenceTest extends o
         builder.setCustomEKTokenId(samlAssertion.getId());
         builder.prepare(doc, userCrypto);
         
-        List<WSEncryptionPart> parts = new ArrayList<>();
         WSEncryptionPart encP = 
             new WSEncryptionPart(
                 "add", "http://ws.apache.org/counter/counter_port_type", "Element"
             );
-        parts.add(encP);
-        Element refElement = builder.encryptForRef(null, parts);
+        builder.getParts().add(encP);
+        Element refElement = builder.encrypt();
         builder.addInternalRefElement(refElement);
         builder.appendToHeader(secHeader);
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java?rev=1660434&r1=1660433&r2=1660434&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenCustomSignatureTest.java
Tue Feb 17 16:19:10 2015
@@ -179,16 +179,13 @@ public class SamlTokenCustomSignatureTes
         sign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
 
-        List<WSEncryptionPart> parts = new ArrayList<>();
         WSEncryptionPart encP =
             new WSEncryptionPart(
                 "Assertion",
                 "urn:oasis:names:tc:SAML:1.0:assertion",
                 "Element");
         encP.setRequired(false);
-        parts.add(encP);
-        
-        sign.setParts(parts);
+        sign.getParts().add(encP);
         
         Document signedDoc = sign.build(doc, crypto, secHeader);
         

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=1660434&r1=1660433&r2=1660434&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
Tue Feb 17 16:19:10 2015
@@ -45,7 +45,6 @@ import org.apache.wss4j.dom.util.WSSecur
 import org.w3c.dom.Document;
 
 import java.security.cert.X509Certificate;
-import java.util.ArrayList;
 import java.util.List;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -180,7 +179,6 @@ public class SamlTokenDerivedTest extend
             crypto.getPrivateKey("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         sigBuilder.setExternalKey(key.getEncoded(), secToken.getElement());
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-        List<WSEncryptionPart> parts = new ArrayList<>(2);
         String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement());
         WSEncryptionPart encP = 
             new WSEncryptionPart(
@@ -188,12 +186,11 @@ public class SamlTokenDerivedTest extend
                 soapNamespace, 
                 "Content"
             );
-        parts.add(encP);
+        sigBuilder.getParts().add(encP);
         encP = new WSEncryptionPart("STRTransform", "", "Element");
         encP.setId(secRefSaml.getID());
         encP.setElement(secRefSaml.getElement());
-        parts.add(encP);
-        sigBuilder.setParts(parts);
+        sigBuilder.getParts().add(encP);
         
         return sigBuilder;
     }

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=1660434&r1=1660433&r2=1660434&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
Tue Feb 17 16:19:10 2015
@@ -568,10 +568,8 @@ public class AttachmentTest extends Abst
         WSSecHeader secHeader = new WSSecHeader();
         secHeader.insertSecurityHeader(doc);
 
-        List<WSEncryptionPart> parts = new ArrayList<WSEncryptionPart>();
-        parts.add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/",
"Content"));
-        parts.add(new WSEncryptionPart("cid:Attachments", "Content"));
-        encrypt.setParts(parts);
+        encrypt.getParts().add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/",
"Content"));
+        encrypt.getParts().add(new WSEncryptionPart("cid:Attachments", "Content"));
 
         String attachmentId = UUID.randomUUID().toString();
         final Attachment attachment = new Attachment();
@@ -586,7 +584,7 @@ public class AttachmentTest extends Abst
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
         encrypt.prepare(doc, CryptoFactory.getInstance("transmitter-crypto.properties"));
-        Element refs = encrypt.encryptForRef(null, parts);
+        Element refs = encrypt.encrypt();
         encrypt.addAttachmentEncryptedDataElements(secHeader);
         encrypt.addExternalRefElement(refs, secHeader);
         encrypt.prependToHeader(secHeader);

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=1660434&r1=1660433&r2=1660434&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
Tue Feb 17 16:19:10 2015
@@ -393,7 +393,7 @@ public class DerivedKeyTokenTest extends
             properties.put(WSHandlerConstants.ENC_SYM_ALGO, 
                            "http://www.w3.org/2001/04/xmlenc#aes128-cbc");
             Document securedDocument = doOutboundSecurityWithWSS4J(sourceDocument, action,
properties);
-
+            
             //some test that we can really sure we get what we want from WSS4J
             NodeList nodeList = securedDocument.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(),
WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
             Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_soap11_Body.getLocalPart());

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=1660434&r1=1660433&r2=1660434&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
Tue Feb 17 16:19:10 2015
@@ -55,8 +55,6 @@ import javax.xml.transform.stream.Stream
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.List;
 
 public class SamlTokenDerivedTest extends AbstractTestBase {
 
@@ -187,7 +185,7 @@ public class SamlTokenDerivedTest extend
                 crypto.getPrivateKey("transmitter", "default");
         sigBuilder.setExternalKey(key.getEncoded(), secToken.getElement());
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-        List<WSEncryptionPart> parts = new ArrayList<WSEncryptionPart>(2);
+        
         String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement());
         WSEncryptionPart encP =
                 new WSEncryptionPart(
@@ -195,12 +193,12 @@ public class SamlTokenDerivedTest extend
                         soapNamespace,
                         "Content"
                 );
-        parts.add(encP);
+        sigBuilder.getParts().add(encP);
+
         encP = new WSEncryptionPart("STRTransform", "", "Element");
         encP.setId(secRefSaml.getID());
         encP.setElement(secRefSaml.getElement());
-        parts.add(encP);
-        sigBuilder.setParts(parts);
+        sigBuilder.getParts().add(encP);
 
         return sigBuilder;
     }



Mime
View raw message