ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gi...@apache.org
Subject svn commit: r1306723 [1/2] - in /webservices/wss4j/branches/swssf: rampart-policy/src/main/java/org/apache/ws/secpolicy/ rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/ rampart-policy/src/main/java/org/apache/ws/secpolicy/model/ streamin...
Date Thu, 29 Mar 2012 06:47:46 GMT
Author: giger
Date: Thu Mar 29 06:47:44 2012
New Revision: 1306723

URL: http://svn.apache.org/viewvc?rev=1306723&view=rev
Log:
enforce stricter checks for required policy elements. Fix for WSS-372

Modified:
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPUtils.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/EncryptedPartsBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/HttpsTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/IssuedTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KerberosTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KeyValueTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/LayoutBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/RequiredPartsBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SamlTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecureConversationTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecurityContextTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SignedPartsBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SpnegoContextTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/X509TokenBuilder.java
    webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractBinding.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingIntegrationTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/DerivedKeyTests.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/HttpsTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/IssuedTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KerberosTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KeyValueTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/ProtectionOrderTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RelTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RequiredPartsTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SamlTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecureConversationTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecurityContextTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SpnegoContextTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SupportingTokensTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SymmetricBindingTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/TokenProtectionTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/TransportBindingTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/UsernameTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/X509TokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/resources/testdata/policy/asymmetricBindingPolicyC31.xml
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/resources/testdata/policy/symmetricBindingPolicyC21a.xml
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/resources/testdata/policy/symmetricBindingPolicyC21b.xml
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/resources/testdata/policy/transportBindingPolicyC11.xml

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPUtils.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPUtils.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPUtils.java Thu Mar 29 06:47:44 2012
@@ -157,7 +157,7 @@ public class SPUtils {
         } else {
             attr = element.getAttributeNodeNS(attName.getNamespaceURI(), attName.getLocalPart());
         }
-        return attr == null ? null : attr.getValue();
+        return attr == null ? null : attr.getValue().trim();
     }
 
     public static QName getElementQName(Element element) {

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java Thu Mar 29 06:47:44 2012
@@ -41,7 +41,10 @@ public class AlgorithmSuiteBuilder imple
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:AlgorithmSuite must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         AlgorithmSuite algorithmSuite = new AlgorithmSuite(
                 spVersion,
                 nestedPolicy

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java Thu Mar 29 06:47:44 2012
@@ -41,7 +41,10 @@ public class AsymmetricBindingBuilder im
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:AsymmetricBinding must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         AsymmetricBinding asymmetricBinding = new AsymmetricBinding(
                 spVersion,
                 nestedPolicy

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/EncryptedPartsBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/EncryptedPartsBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/EncryptedPartsBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/EncryptedPartsBuilder.java Thu Mar 29 06:47:44 2012
@@ -42,7 +42,7 @@ public class EncryptedPartsBuilder exten
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
         boolean body = SPUtils.hasChildElementWithName(element, spVersion.getSPConstants().getBody());
-        final List<Header> headers = getHeaders(element, spVersion);
+        final List<Header> headers = getHeaders(element, true, spVersion);
         final Attachments attachments = getAttachments(element, spVersion);
         body |= !SPUtils.hasChildElements(element);
 

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/HttpsTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/HttpsTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/HttpsTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/HttpsTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -51,7 +51,10 @@ public class HttpsTokenBuilder implement
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:HttpsToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         HttpsToken httpsToken = new HttpsToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/IssuedTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/IssuedTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/IssuedTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/IssuedTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -48,13 +48,20 @@ public class IssuedTokenBuilder implemen
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:IssuedToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
+        final Element requestSecurityTokenTemplate = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getRequestSecurityTokenTemplate());
+        if (requestSecurityTokenTemplate == null) {
+            throw new IllegalArgumentException("sp:IssuedToken must have a sp:RequestSecurityTokenTemplate element");
+        }
         IssuedToken issuedToken = new IssuedToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),
                 issuer,
                 issuerName,
-                SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getRequestSecurityTokenTemplate()),
+                requestSecurityTokenTemplate,
                 claims,
                 nestedPolicy
         );

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KerberosTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KerberosTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KerberosTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KerberosTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -51,7 +51,10 @@ public class KerberosTokenBuilder implem
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:KerberosToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         KerberosToken kerberosToken = new KerberosToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KeyValueTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KeyValueTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KeyValueTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/KeyValueTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -49,7 +49,10 @@ public class KeyValueTokenBuilder implem
             throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
         }
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:KeyValueToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         KeyValueToken keyValueToken = new KeyValueToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/LayoutBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/LayoutBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/LayoutBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/LayoutBuilder.java Thu Mar 29 06:47:44 2012
@@ -41,7 +41,10 @@ public class LayoutBuilder implements As
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:Layout must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         Layout layout = new Layout(
                 spVersion,
                 nestedPolicy

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/RequiredPartsBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/RequiredPartsBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/RequiredPartsBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/RequiredPartsBuilder.java Thu Mar 29 06:47:44 2012
@@ -43,21 +43,25 @@ public class RequiredPartsBuilder implem
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
 
-        final List<Header> headers = getHeaders(element, spVersion);
+        final List<Header> headers = getHeaders(element, false, spVersion);
         RequiredParts requiredParts = new RequiredParts(spVersion, headers);
         requiredParts.setOptional(SPUtils.isOptional(element));
         requiredParts.setIgnorable(SPUtils.isIgnorable(element));
         return requiredParts;
     }
 
-    protected List<Header> getHeaders(Element element, SPConstants.SPVersion spVersion) {
+    protected List<Header> getHeaders(Element element, boolean ignoreNameElement, SPConstants.SPVersion spVersion) {
         List<Header> headers = new ArrayList<Header>();
         Element child = SPUtils.getFirstChildElement(element);
         while (child != null) {
             if (SPConstants.HEADER.equals(child.getLocalName()) && spVersion.getNamespace().equals(child.getNamespaceURI())) {
                 String headerName = child.getAttribute(SPConstants.NAME);
                 if ("".equals(headerName)) {
-                    headerName = null;
+                    if (ignoreNameElement) {
+                        headerName = null;
+                    } else {
+                        throw new IllegalArgumentException("sp:" + element.getLocalName() + "/sp:" + child.getLocalName() + " must have a Name attribute");
+                    }
                 }
                 String headerNamespace = child.getAttribute(SPConstants.NAMESPACE);
                 if (StringUtils.isEmpty(headerNamespace)) {

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SamlTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SamlTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SamlTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SamlTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -51,7 +51,10 @@ public class SamlTokenBuilder implements
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:SamlToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         SamlToken samlToken = new SamlToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecureConversationTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecureConversationTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecureConversationTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecureConversationTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -48,7 +48,10 @@ public class SecureConversationTokenBuil
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:SecureConversationToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         SecureConversationToken secureConversationToken = new SecureConversationToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecurityContextTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecurityContextTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecurityContextTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SecurityContextTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -51,7 +51,10 @@ public class SecurityContextTokenBuilder
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:SecurityContextToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         SecurityContextToken securityContextToken = new SecurityContextToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SignedPartsBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SignedPartsBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SignedPartsBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SignedPartsBuilder.java Thu Mar 29 06:47:44 2012
@@ -42,7 +42,7 @@ public class SignedPartsBuilder extends 
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
         boolean body = SPUtils.hasChildElementWithName(element, spVersion.getSPConstants().getBody());
-        final List<Header> headers = getHeaders(element, spVersion);
+        final List<Header> headers = getHeaders(element, true, spVersion);
         final Attachments attachments = getAttachments(element, spVersion);
         final boolean signAllHeaders = !SPUtils.hasChildElements(element);
         body |= signAllHeaders;

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SpnegoContextTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SpnegoContextTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SpnegoContextTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SpnegoContextTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -48,7 +48,10 @@ public class SpnegoContextTokenBuilder i
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:SpnegoContextToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         SpnegoContextToken spnegoContextToken = new SpnegoContextToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java Thu Mar 29 06:47:44 2012
@@ -41,7 +41,10 @@ public class SymmetricBindingBuilder imp
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:SymmetricBinding must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         SymmetricBinding symmetricBinding = new SymmetricBinding(
                 spVersion,
                 nestedPolicy

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java Thu Mar 29 06:47:44 2012
@@ -41,7 +41,10 @@ public class TransportBindingBuilder imp
 
         final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:TransnportBinding must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         TransportBinding transportBinding = new TransportBinding(
                 spVersion,
                 nestedPolicy

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -51,7 +51,10 @@ public class UsernameTokenBuilder implem
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:UsernameToken must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         UsernameToken usernameToken = new UsernameToken(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/X509TokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/X509TokenBuilder.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/X509TokenBuilder.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/builders/X509TokenBuilder.java Thu Mar 29 06:47:44 2012
@@ -51,7 +51,10 @@ public class X509TokenBuilder implements
         }
         final Element claims = SPUtils.getFirstChildElement(element, spVersion.getSPConstants().getClaims());
         final Element nestedPolicyElement = SPUtils.getFirstPolicyChildElement(element);
-        final Policy nestedPolicy = nestedPolicyElement != null ? factory.getPolicyEngine().getPolicy(nestedPolicyElement) : new Policy();
+        if (nestedPolicyElement == null) {
+            throw new IllegalArgumentException("sp:X509Token must have an inner wsp:Policy element");
+        }
+        final Policy nestedPolicy = factory.getPolicyEngine().getPolicy(nestedPolicyElement);
         X509Token x509Token = new X509Token(
                 spVersion,
                 spVersion.getSPConstants().getInclusionFromAttributeValue(includeTokenValue),

Modified: webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractBinding.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractBinding.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractBinding.java (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractBinding.java Thu Mar 29 06:47:44 2012
@@ -96,6 +96,9 @@ public abstract class AbstractBinding ex
                 }
             }
         }
+        if (binding.getAlgorithmSuite() == null) {
+            throw new IllegalArgumentException("sp:" + getName().getLocalPart() + " must have an inner sp:AlgorithmSuite element");
+        }
     }
 
     public AlgorithmSuite getAlgorithmSuite() {

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingIntegrationTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingIntegrationTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingIntegrationTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingIntegrationTest.java Thu Mar 29 06:47:44 2012
@@ -2050,7 +2050,10 @@ public class AsymmetricBindingIntegratio
                         "                </sp:AsymmetricBinding>\n" +
                         "                <sp:SignedSupportingTokens>\n" +
                         "                   <wsp:Policy>\n" +
-                        "                     <sp:UsernameToken IncludeToken=\" http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient\"/>\n" +
+                        "                     <sp:UsernameToken IncludeToken=\" http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient\">\n" +
+                        "                       <wsp:Policy>\n" +
+                        "                       </wsp:Policy>\n" +
+                        "                     </sp:UsernameToken>\n" +
                         "                   </wsp:Policy>\n" +
                         "                </sp:SignedSupportingTokens>\n" +
                         "                <sp:SignedParts>\n" +
@@ -2183,7 +2186,10 @@ public class AsymmetricBindingIntegratio
                         "                </sp:AsymmetricBinding>\n" +
                         "                <sp:SignedSupportingTokens>\n" +
                         "                   <wsp:Policy>\n" +
-                        "                     <sp:UsernameToken IncludeToken=\" http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient\"/>\n" +
+                        "                     <sp:UsernameToken IncludeToken=\" http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient\">\n" +
+                        "                       <wsp:Policy>\n" +
+                        "                       </wsp:Policy>\n" +
+                        "                     </sp:UsernameToken>\n" +
                         "                   </wsp:Policy>\n" +
                         "                </sp:SignedSupportingTokens>\n" +
                         "                <sp:SignedParts>\n" +

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/AsymmetricBindingTest.java Thu Mar 29 06:47:44 2012
@@ -44,6 +44,11 @@ public class AsymmetricBindingTest exten
         String policyString =
                 "<sp:AsymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:OnlySignEntireHeadersAndBody/>\n" +
@@ -103,6 +108,11 @@ public class AsymmetricBindingTest exten
         String policyString =
                 "<sp:AsymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:ProtectTokens/>\n" +
                         "<sp:OnlySignEntireHeadersAndBody/>\n" +
@@ -142,6 +152,11 @@ public class AsymmetricBindingTest exten
         String policyString =
                 "<sp:AsymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptBeforeSigning/>\n" +
                         "<sp:EncryptSignature/>\n" +
@@ -180,6 +195,11 @@ public class AsymmetricBindingTest exten
         String policyString =
                 "<sp:AsymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:ProtectTokens/>\n" +
@@ -229,6 +249,11 @@ public class AsymmetricBindingTest exten
         String policyString =
                 "<sp:AsymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:ProtectTokens/>\n" +

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/DerivedKeyTests.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/DerivedKeyTests.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/DerivedKeyTests.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/DerivedKeyTests.java Thu Mar 29 06:47:44 2012
@@ -64,6 +64,11 @@ public class DerivedKeyTests extends Abs
                         "       </sp:X509Token>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 
@@ -133,6 +138,11 @@ public class DerivedKeyTests extends Abs
                         "       </sp:X509Token>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 
@@ -202,6 +212,11 @@ public class DerivedKeyTests extends Abs
                         "       </sp:X509Token>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/HttpsTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/HttpsTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/HttpsTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/HttpsTokenTest.java Thu Mar 29 06:47:44 2012
@@ -51,6 +51,11 @@ public class HttpsTokenTest extends Abst
                         "       </sp:HttpsToken>" +
                         "   </wsp:Policy>\n" +
                         "</sp:TransportToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:TransportBinding>";
 
@@ -85,6 +90,11 @@ public class HttpsTokenTest extends Abst
                         "       </sp:HttpsToken>" +
                         "   </wsp:Policy>\n" +
                         "</sp:TransportToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:TransportBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/IssuedTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/IssuedTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/IssuedTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/IssuedTokenTest.java Thu Mar 29 06:47:44 2012
@@ -47,6 +47,7 @@ public class IssuedTokenTest extends Abs
                         "   <wsp:Policy>\n" +
                         "       <sp:IssuedToken>\n" +
                         "           <sp:IssuerName>xs:anyURI</sp:IssuerName>\n" +
+                        "           <sp:RequestSecurityTokenTemplate/>\n" +
                         "           <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "               <sp:RequireExternalReference/>\n" +
                         "           </wsp:Policy>\n" +
@@ -57,12 +58,18 @@ public class IssuedTokenTest extends Abs
                         "   <wsp:Policy>\n" +
                         "       <sp:IssuedToken>\n" +
                         "           <sp:IssuerName>xs:anyURI</sp:IssuerName>\n" +
+                        "           <sp:RequestSecurityTokenTemplate/>\n" +
                         "           <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "               <sp:RequireExternalReference/>\n" +
                         "           </wsp:Policy>\n" +
                         "       </sp:IssuedToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KerberosTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KerberosTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KerberosTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KerberosTokenTest.java Thu Mar 29 06:47:44 2012
@@ -63,6 +63,11 @@ public class KerberosTokenTest extends A
                         "       </sp:KerberosToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SignatureToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:SymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KeyValueTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KeyValueTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KeyValueTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/KeyValueTokenTest.java Thu Mar 29 06:47:44 2012
@@ -65,6 +65,11 @@ public class KeyValueTokenTest extends A
                         "       </sp:KeyValueToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 
@@ -123,6 +128,11 @@ public class KeyValueTokenTest extends A
                         "       </sp:KeyValueToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/ProtectionOrderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/ProtectionOrderTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/ProtectionOrderTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/ProtectionOrderTest.java Thu Mar 29 06:47:44 2012
@@ -42,6 +42,11 @@ public class ProtectionOrderTest extends
         String policyString =
                 "<sp:AsymmetricBinding  xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\">\n" +
                         "   <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>\n";
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
@@ -82,6 +87,11 @@ public class ProtectionOrderTest extends
         String policyString =
                 "<sp:AsymmetricBinding  xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\">\n" +
                         "   <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>\n";
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
@@ -103,6 +113,11 @@ public class ProtectionOrderTest extends
         String policyString =
                 "<sp:AsymmetricBinding  xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\">\n" +
                         "   <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>\n";
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
@@ -131,6 +146,11 @@ public class ProtectionOrderTest extends
         String policyString =
                 "<sp:AsymmetricBinding  xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\">\n" +
                         "   <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "       <sp:EncryptBeforeSigning/>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>\n";
@@ -172,6 +192,11 @@ public class ProtectionOrderTest extends
         String policyString =
                 "<sp:AsymmetricBinding  xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\">\n" +
                         "   <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "       <sp:EncryptBeforeSigning/>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>\n";
@@ -194,6 +219,11 @@ public class ProtectionOrderTest extends
         String policyString =
                 "<sp:AsymmetricBinding  xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\">\n" +
                         "   <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "       <sp:EncryptBeforeSigning/>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>\n";

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RelTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RelTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RelTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RelTokenTest.java Thu Mar 29 06:47:44 2012
@@ -63,6 +63,11 @@ public class RelTokenTest extends Abstra
                         "       </sp:RelToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RequiredPartsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RequiredPartsTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RequiredPartsTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/RequiredPartsTest.java Thu Mar 29 06:47:44 2012
@@ -36,8 +36,6 @@ import java.util.List;
  */
 public class RequiredPartsTest extends AbstractPolicyTestBase {
 
-    //todo in RequiredPartsBuilder Name attribute is manadory!
-
     @Test
     public void testPolicy() throws Exception {
         String policyString =

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SamlTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SamlTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SamlTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SamlTokenTest.java Thu Mar 29 06:47:44 2012
@@ -68,6 +68,11 @@ public class SamlTokenTest extends Abstr
                         "       </sp:SamlToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 
@@ -127,6 +132,11 @@ public class SamlTokenTest extends Abstr
                         "       </sp:SamlToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecureConversationTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecureConversationTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecureConversationTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecureConversationTokenTest.java Thu Mar 29 06:47:44 2012
@@ -66,6 +66,11 @@ public class SecureConversationTokenTest
                         "       </sp:SecureConversationToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SignatureToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:SymmetricBinding>";
 
@@ -129,6 +134,11 @@ public class SecureConversationTokenTest
                         "       </sp:SecureConversationToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SignatureToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:SymmetricBinding>";
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecurityContextTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecurityContextTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecurityContextTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SecurityContextTokenTest.java Thu Mar 29 06:47:44 2012
@@ -67,6 +67,11 @@ public class SecurityContextTokenTest ex
                         "       </sp:SecurityContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SignatureToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:SymmetricBinding>";
 
@@ -131,6 +136,11 @@ public class SecurityContextTokenTest ex
                         "       </sp:SecurityContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SignatureToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:SymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SpnegoContextTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SpnegoContextTokenTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SpnegoContextTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SpnegoContextTokenTest.java Thu Mar 29 06:47:44 2012
@@ -63,6 +63,11 @@ public class SpnegoContextTokenTest exte
                         "       </sp:SpnegoContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:RecipientToken>\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "</wsp:Policy>\n" +
                         "</sp:AsymmetricBinding>";
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SupportingTokensTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SupportingTokensTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SupportingTokensTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SupportingTokensTest.java Thu Mar 29 06:47:44 2012
@@ -431,6 +431,8 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:IssuedToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <sp:RequestSecurityTokenTemplate/>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:IssuedToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -465,6 +467,8 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:IssuedToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <sp:RequestSecurityTokenTemplate/>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:IssuedToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -503,6 +507,8 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:IssuedToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <sp:RequestSecurityTokenTemplate/>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:IssuedToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -537,6 +543,8 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:IssuedToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <sp:RequestSecurityTokenTemplate/>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:IssuedToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -571,6 +579,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:KerberosToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:KerberosToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -605,6 +614,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:KerberosToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:KerberosToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -643,6 +653,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:KerberosToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:KerberosToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -677,6 +688,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:KerberosToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:KerberosToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -711,6 +723,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SpnegoContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SpnegoContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -745,6 +758,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SpnegoContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SpnegoContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -783,6 +797,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SpnegoContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SpnegoContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -817,6 +832,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SpnegoContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SpnegoContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -851,6 +867,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecurityContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecurityContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -885,6 +902,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecurityContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecurityContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -923,6 +941,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecurityContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecurityContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -957,6 +976,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecurityContextToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecurityContextToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -991,6 +1011,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecureConversationToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecureConversationToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -1025,6 +1046,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecureConversationToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecureConversationToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -1063,6 +1085,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecureConversationToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecureConversationToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -1097,6 +1120,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SecureConversationToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SecureConversationToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -1131,6 +1155,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SamlToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SamlToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -1163,6 +1188,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SamlToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SamlToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -1199,6 +1225,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SamlToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SamlToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";
@@ -1231,6 +1258,7 @@ public class SupportingTokensTest extend
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
                         "       <sp:SamlToken>\n" +
                         "           <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
+                        "           <wsp:Policy/>\n" +
                         "       </sp:SamlToken>\n" +
                         "   </wsp:Policy>\n" +
                         "</sp:SupportingTokens>";

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SymmetricBindingTest.java?rev=1306723&r1=1306722&r2=1306723&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SymmetricBindingTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SymmetricBindingTest.java Thu Mar 29 06:47:44 2012
@@ -45,6 +45,11 @@ public class SymmetricBindingTest extend
         String policyString =
                 "<sp:SymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:OnlySignEntireHeadersAndBody/>\n" +
@@ -106,6 +111,11 @@ public class SymmetricBindingTest extend
         String policyString =
                 "<sp:SymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:ProtectTokens/>\n" +
                         "<sp:OnlySignEntireHeadersAndBody/>\n" +
@@ -145,6 +155,11 @@ public class SymmetricBindingTest extend
         String policyString =
                 "<sp:SymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptBeforeSigning/>\n" +
                         "<sp:EncryptSignature/>\n" +
@@ -183,6 +198,11 @@ public class SymmetricBindingTest extend
         String policyString =
                 "<sp:SymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:ProtectTokens/>\n" +
@@ -232,6 +252,11 @@ public class SymmetricBindingTest extend
         String policyString =
                 "<sp:SymmetricBinding xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
                         "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
+                        "   <sp:AlgorithmSuite>\n" +
+                        "       <wsp:Policy>\n" +
+                        "           <sp:Basic256/>\n" +
+                        "       </wsp:Policy>\n" +
+                        "   </sp:AlgorithmSuite>\n" +
                         "<sp:IncludeTimestamp/>\n" +
                         "<sp:EncryptSignature/>\n" +
                         "<sp:OnlySignEntireHeadersAndBody/>\n" +



Mime
View raw message