cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1458927 - in /cxf/branches/wss4j2.0-port: rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/poli...
Date Wed, 20 Mar 2013 16:28:51 GMT
Author: coheigea
Date: Wed Mar 20 16:28:50 2013
New Revision: 1458927

URL: http://svn.apache.org/r1458927
Log:
Removing some non-namespace aware DOM calls


Conflicts:
	rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/EncryptedPartsBuilder.java
	rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/RequiredPartsBuilder.java
	rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java

Modified:
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
    cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
    cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
    cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
    cxf/branches/wss4j2.0-port/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java
    cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
    cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
    cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java
    cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
    cxf/branches/wss4j2.0-port/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
    cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
Wed Mar 20 16:28:50 2013
@@ -439,7 +439,7 @@ public class SecurityToken implements Se
             return DOMUtils.getContent(child);
         } else if (Reference.TOKEN.getLocalPart().equals(child.getLocalName())
             && Reference.TOKEN.getNamespaceURI().equals(child.getNamespaceURI()))
{
-            return child.getAttribute("URI").substring(1);
+            return child.getAttributeNS(null, "URI").substring(1);
         }
         return null;
     }

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
Wed Mar 20 16:28:50 2013
@@ -1493,7 +1493,7 @@ public abstract class AbstractSTSClient 
             || elName.equals(new QName(WSConstants.WSSE_NS, "KeyIdentifier"))) {
             return DOMUtils.getContent(child);
         } else if (elName.equals(Reference.TOKEN)) {
-            return child.getAttribute("URI");
+            return child.getAttributeNS(null, "URI");
         } else if (elName.equals(new QName(STSUtils.SCT_NS_05_02, "Identifier"))
                    || elName.equals(new QName(STSUtils.SCT_NS_05_12, "Identifier"))) {
             return DOMUtils.getContent(child);

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
Wed Mar 20 16:28:50 2013
@@ -1099,7 +1099,7 @@ public abstract class AbstractBindingBui
         String id;
         
         //first try to get the Id attr
-        Attr idAttr = elem.getAttributeNode("Id");
+        Attr idAttr = elem.getAttributeNodeNS(null, "Id");
         if (idAttr == null) {
             //then try the wsu:Id value
             idAttr = elem.getAttributeNodeNS(PolicyConstants.WSU_NAMESPACE_URI, "Id");
@@ -1435,7 +1435,7 @@ public abstract class AbstractBindingBui
                         } else {
                             //not forcing an ID on this.  Use one if there is one 
                             //there already, but don't force one
-                            Attr idAttr = el.getAttributeNode("Id");
+                            Attr idAttr = el.getAttributeNodeNS(null, "Id");
                             if (idAttr == null) {
                                 //then try the wsu:Id value
                                 idAttr = el.getAttributeNodeNS(PolicyConstants.WSU_NAMESPACE_URI,
"Id");

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
Wed Mar 20 16:28:50 2013
@@ -499,7 +499,7 @@ public abstract class AbstractBindingPol
                     for (WSDataRef r : el) {
                         Element protectedElement = r.getProtectedElement();
                         if (protectedElement != null) {
-                            String id = protectedElement.getAttribute("Id");
+                            String id = protectedElement.getAttributeNS(null, "Id");
                             String wsuId = protectedElement.getAttributeNS(WSConstants.WSU_NS,
"Id");
                             if (sigId.equals(id) || sigId.equals(wsuId)) {
                                 return true;

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
Wed Mar 20 16:28:50 2013
@@ -336,7 +336,7 @@ public abstract class AbstractPolicySecu
         Element issuedAssertion = 
             this.readDocument("example-sts-issued-saml-assertion.xml").getDocumentElement();
         
-        String assertionId = issuedAssertion.getAttributeNode("AssertionID").getNodeValue();
+        String assertionId = issuedAssertion.getAttributeNodeNS(null, "AssertionID").getNodeValue();
         
         SecurityToken issuedToken = 
             new SecurityToken(assertionId, issuedAssertion, null);

Modified: cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
Wed Mar 20 16:28:50 2013
@@ -45,8 +45,8 @@ public class IdentityClaimsParser implem
         String claimLocalName = claimType.getLocalName();
         String claimNS = claimType.getNamespaceURI();
         if ("ClaimType".equals(claimLocalName)) {
-            String claimTypeUri = claimType.getAttribute("Uri");
-            String claimTypeOptional = claimType.getAttribute("Optional");
+            String claimTypeUri = claimType.getAttributeNS(null, "Uri");
+            String claimTypeOptional = claimType.getAttributeNS(null, "Optional");
             RequestClaim requestClaim = new RequestClaim();
             try {
                 requestClaim.setClaimType(new URI(claimTypeUri));
@@ -60,8 +60,8 @@ public class IdentityClaimsParser implem
             requestClaim.setOptional(Boolean.parseBoolean(claimTypeOptional));
             return requestClaim;
         } else if ("ClaimValue".equals(claimLocalName)) {
-            String claimTypeUri = claimType.getAttribute("Uri");
-            String claimTypeOptional = claimType.getAttribute("Optional");
+            String claimTypeUri = claimType.getAttributeNS(null, "Uri");
+            String claimTypeOptional = claimType.getAttributeNS(null, "Optional");
             RequestClaim requestClaim = new RequestClaim();
             try {
                 requestClaim.setClaimType(new URI(claimTypeUri));

Modified: cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
Wed Mar 20 16:28:50 2013
@@ -571,7 +571,7 @@ public class RequestParser {
         String dialectAttr = null;
         RequestClaimCollection requestedClaims = new RequestClaimCollection();
         try {
-            dialectAttr = claimsElement.getAttribute("Dialect");
+            dialectAttr = claimsElement.getAttributeNS(null, "Dialect");
             if (dialectAttr != null && !"".equals(dialectAttr)) {
                 requestedClaims.setDialect(new URI(dialectAttr));
             }

Modified: cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
Wed Mar 20 16:28:50 2013
@@ -174,9 +174,9 @@ public class SAMLTokenProvider implement
             String tokenType = tokenRequirements.getTokenType();
             if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) 
                 || WSConstants.SAML2_NS.equals(tokenType)) {
-                response.setTokenId(token.getAttribute("ID"));
+                response.setTokenId(token.getAttributeNS(null, "ID"));
             } else {
-                response.setTokenId(token.getAttribute("AssertionID"));
+                response.setTokenId(token.getAttributeNS(null, "AssertionID"));
             }
             
             DateTime validFrom = null;

Modified: cxf/branches/wss4j2.0-port/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java
Wed Mar 20 16:28:50 2013
@@ -34,12 +34,12 @@ public class CustomClaimParser implement
         String claimLocalName = claim.getLocalName();
         String claimNS = claim.getNamespaceURI();
         if (CLAIMS_DIALECT.equals(claimNS) && "MyElement".equals(claimLocalName))
{
-            String claimTypeUri = claim.getAttribute("Uri");
+            String claimTypeUri = claim.getAttributeNS(null, "Uri");
             CustomRequestClaim response = new CustomRequestClaim();
             response.setClaimType(URI.create(claimTypeUri));
-            String claimValue = claim.getAttribute("value");
+            String claimValue = claim.getAttributeNS(null, "value");
             response.setClaimValue(claimValue);
-            String scope = claim.getAttribute("scope");
+            String scope = claim.getAttributeNS(null, "scope");
             response.setScope(scope);
             return response;
         }

Modified: cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
Wed Mar 20 16:28:50 2013
@@ -1090,7 +1090,7 @@ public class SimpleBatchSTSClient implem
             || elName.equals(new QName(WSConstants.WSSE_NS, "KeyIdentifier"))) {
             return DOMUtils.getContent(child);
         } else if (elName.equals(Reference.TOKEN)) {
-            return child.getAttribute("URI");
+            return child.getAttributeNS(null, "URI");
         } else if (elName.equals(new QName(STSUtils.SCT_NS_05_02, "Identifier"))
                    || elName.equals(new QName(STSUtils.SCT_NS_05_12, "Identifier"))) {
             return DOMUtils.getContent(child);

Modified: cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
Wed Mar 20 16:28:50 2013
@@ -58,12 +58,12 @@ public final class TokenTestUtils {
         //mess with the token a bit to force it to fail to validate
         Element e = tok.getToken();
         Element e2 = DOMUtils.getFirstChildWithName(e, e.getNamespaceURI(), "Conditions");
-        String nb = e2.getAttribute("NotBefore");
-        String noa = e2.getAttribute("NotOnOrAfter");
+        String nb = e2.getAttributeNS(null, "NotBefore");
+        String noa = e2.getAttributeNS(null, "NotOnOrAfter");
         nb = "2010" + nb.substring(4);
         noa = "2010" + noa.substring(4);
-        e2.setAttribute("NotBefore", nb);
-        e2.setAttribute("NotOnOrAfter", noa);
+        e2.setAttributeNS(null, "NotBefore", nb);
+        e2.setAttributeNS(null, "NotOnOrAfter", noa);
         try {
             sts.validateSecurityToken(tok);
             fail("Failure expected on an invalid token");

Modified: cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java
Wed Mar 20 16:28:50 2013
@@ -50,8 +50,8 @@ public class CustomClaimsParser implemen
         String claimLocalName = claimType.getLocalName();
         String claimNS = claimType.getNamespaceURI();
         if ("ClaimType".equals(claimLocalName)) {
-            String claimTypeUri = claimType.getAttribute("Uri");
-            String claimTypeOptional = claimType.getAttribute("Optional");
+            String claimTypeUri = claimType.getAttributeNS(null, "Uri");
+            String claimTypeOptional = claimType.getAttributeNS(null, "Optional");
             RequestClaim requestClaim = new RequestClaim();
             try {
                 requestClaim.setClaimType(new URI(claimTypeUri));
@@ -65,8 +65,8 @@ public class CustomClaimsParser implemen
             requestClaim.setOptional(Boolean.parseBoolean(claimTypeOptional));
             return requestClaim;
         } else if ("ClaimValue".equals(claimLocalName)) {
-            String claimTypeUri = claimType.getAttribute("Uri");
-            String claimTypeOptional = claimType.getAttribute("Optional");
+            String claimTypeUri = claimType.getAttributeNS(null, "Uri");
+            String claimTypeOptional = claimType.getAttributeNS(null, "Optional");
             RequestClaim requestClaim = new RequestClaim();
             try {
                 requestClaim.setClaimType(new URI(claimTypeUri));

Modified: cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
Wed Mar 20 16:28:50 2013
@@ -109,9 +109,9 @@ public class SCTSAMLTokenProvider implem
             String tokenType = tokenRequirements.getTokenType();
             if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) 
                     || WSConstants.SAML2_NS.equals(tokenType)) {
-                response.setTokenId(token.getAttribute("ID"));
+                response.setTokenId(token.getAttributeNS(null, "ID"));
             } else {
-                response.setTokenId(token.getAttribute("AssertionID"));
+                response.setTokenId(token.getAttributeNS(null, "AssertionID"));
             }
             response.setLifetime(conditionsProvider.getLifetime());
             response.setEntropy(entropyBytes);

Modified: cxf/branches/wss4j2.0-port/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
Wed Mar 20 16:28:50 2013
@@ -59,12 +59,12 @@ public final class TokenTestUtils {
         //mess with the token a bit to force it to fail to validate
         Element e = tok.getToken();
         Element e2 = DOMUtils.getFirstChildWithName(e, e.getNamespaceURI(), "Conditions");
-        String nb = e2.getAttribute("NotBefore");
-        String noa = e2.getAttribute("NotOnOrAfter");
+        String nb = e2.getAttributeNS(null, "NotBefore");
+        String noa = e2.getAttributeNS(null, "NotOnOrAfter");
         nb = "2010" + nb.substring(4);
         noa = "2010" + noa.substring(4);
-        e2.setAttribute("NotBefore", nb);
-        e2.setAttribute("NotOnOrAfter", noa);
+        e2.setAttributeNS(null, "NotBefore", nb);
+        e2.setAttributeNS(null, "NotOnOrAfter", noa);
         try {
             sts.validateSecurityToken(tok);
             fail("Failure expected on an invalid token");

Modified: cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java?rev=1458927&r1=1458926&r2=1458927&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
(original)
+++ cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
Wed Mar 20 16:28:50 2013
@@ -496,7 +496,7 @@ public class JavaFirstPolicyServiceTest 
     private Element getOperationElement(String operationName, List<Element> operationMessages)
{
         Element operationElement = null;
         for (Element operation : operationMessages) {
-            if (operationName.equals(operation.getAttribute("name"))) {
+            if (operationName.equals(operation.getAttributeNS(null, "name"))) {
                 operationElement = operation;
                 break;
             }
@@ -512,7 +512,7 @@ public class JavaFirstPolicyServiceTest 
         Element policyReference = DOMUtils.getFirstChildWithName(messageElement, policyNamespace,
                                                                  "PolicyReference");
         if (policyReference != null) {
-            return policyReference.getAttribute("URI");
+            return policyReference.getAttributeNS(null, "URI");
         } else {
             return null;
         }
@@ -522,7 +522,7 @@ public class JavaFirstPolicyServiceTest 
         Element policyReference = DOMUtils.getFirstChildWithName(operationElement, policyNamespace,
                                                                  "PolicyReference");
         if (policyReference != null) {
-            return policyReference.getAttribute("URI");
+            return policyReference.getAttributeNS(null, "URI");
         } else {
             return null;
         }



Mime
View raw message