cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r655611 - in /cxf/branches/2.0.x-fixes: ./ tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/model/ tools/validator/src/test/java/org/apache/cxf/tool...
Date Mon, 12 May 2008 19:23:45 GMT
Author: dkulp
Date: Mon May 12 12:23:45 2008
New Revision: 655611

URL: http://svn.apache.org/viewvc?rev=655611&view=rev
Log:
Merged revisions 655562 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r655562 | dkulp | 2008-05-12 13:02:14 -0400 (Mon, 12 May 2008) | 2 lines
  
  Fix and issue with not being able to validate a valid wsdl that uses defaults for portType
operation message names
........

Added:
    cxf/branches/2.0.x-fixes/tools/validator/src/test/resources/validator_wsdl/defaultOpMessageNames.wsdl
      - copied unchanged from r655562, cxf/trunk/tools/validator/src/test/resources/validator_wsdl/defaultOpMessageNames.wsdl
Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
    cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/model/XNode.java
    cxf/branches/2.0.x-fixes/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java?rev=655611&r1=655610&r2=655611&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
(original)
+++ cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
Mon May 12 12:23:45 2008
@@ -329,6 +329,10 @@
         XInput oNode = new XInput();
         oNode.setName(name);
         oNode.setParentNode(opVNode);
+        
+        if (name != null && name.equals(opVNode.getAttributeValue() + "Request"))
{
+            oNode.setDefaultAttributeValue(true);
+        }
         return oNode;
     }
 
@@ -336,6 +340,9 @@
         XOutput oNode = new XOutput();
         oNode.setName(name);
         oNode.setParentNode(opVNode);
+        if (name != null && name.equals(opVNode.getAttributeValue() + "Response"))
{
+            oNode.setDefaultAttributeValue(true);
+        }
         return oNode;
     }
 

Modified: cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/model/XNode.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/model/XNode.java?rev=655611&r1=655610&r2=655611&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/model/XNode.java
(original)
+++ cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/model/XNode.java
Mon May 12 12:23:45 2008
@@ -32,6 +32,7 @@
     private QName name;
     private String attributeName;
     private String attributeValue;
+    private boolean isDefaultAttributeValue;
     private XNode parentNode;
 
     private XNode failurePoint;
@@ -77,7 +78,14 @@
     public void setAttributeValue(final String newAttributeValue) {
         this.attributeValue = newAttributeValue;
     }
-
+    
+    public void setDefaultAttributeValue(boolean b) {
+        this.isDefaultAttributeValue = b;
+    }
+    public boolean isDefaultAttributeValue() {
+        return this.isDefaultAttributeValue;
+    }
+    
     public XNode getParentNode() {
         return parentNode;
     }
@@ -118,11 +126,18 @@
         sb.append(":");
         sb.append(name.getLocalPart());
         if (!StringUtils.isEmpty(attributeName) && !StringUtils.isEmpty(attributeValue))
{
-            sb.append("[@");
+            sb.append("[");
+            if (isDefaultAttributeValue) {
+                sb.append("not(@");
+                sb.append(attributeName);
+                sb.append(") or ");
+            }
+            sb.append("@");
             sb.append(attributeName);
             sb.append("='");
             sb.append(attributeValue);
-            sb.append("']");
+            sb.append("'");
+            sb.append("]");
         }
         return sb.toString();
     }

Modified: cxf/branches/2.0.x-fixes/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java?rev=655611&r1=655610&r2=655611&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
(original)
+++ cxf/branches/2.0.x-fixes/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
Mon May 12 12:23:45 2008
@@ -31,6 +31,14 @@
     public void setUp() {
         super.setUp();
     }
+    
+    @Test
+    public void testValidateDefaultOpMessageNames() throws Exception {
+        String[] args = new String[] {"-verbose",
+                                      getLocation("/validator_wsdl/defaultOpMessageNames.wsdl")};
+        WSDLValidator.main(args);
+        assertTrue(this.getStdOut().contains("Valid WSDL"));
+    }
 
     @Test
     public void testValidateUniqueBody() {



Mime
View raw message