cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r575516 - in /incubator/cxf/trunk/tools/validator/src: main/java/org/apache/cxf/tools/validator/internal/ test/java/org/apache/cxf/tools/validator/ test/resources/validator_wsdl/
Date Fri, 14 Sep 2007 02:44:08 GMT
Author: mmao
Date: Thu Sep 13 19:44:07 2007
New Revision: 575516

URL: http://svn.apache.org/viewvc?rev=575516&view=rev
Log:
CXF-996 
  * If there's no binding style, it's DOCUMENT
  * Add tests for WSI-BP R2717


Added:
    incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/bp2717.wsdl
    incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/cxf996.wsdl
Modified:
    incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
    incubator/cxf/trunk/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java

Modified: incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java?rev=575516&r1=575515&r2=575516&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
(original)
+++ incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
Thu Sep 13 19:44:07 2007
@@ -247,10 +247,9 @@
                 BindingOperation bop = wsdlHelper.getBindingOperation(def, operation.getName());
                 Binding binding = wsdlHelper.getBinding(bop, def);
                 String bindingStyle = binding != null ? SOAPBindingUtil.getBindingStyle(binding)
: "";
-
                 String style = "".equals(SOAPBindingUtil.getSOAPOperationStyle(bop))
                     ? bindingStyle : SOAPBindingUtil.getSOAPOperationStyle(bop);
-                if ("DOCUMENT".equalsIgnoreCase(style)) {
+                if ("DOCUMENT".equalsIgnoreCase(style) || "".equals(style)) {
                     boolean passed = checkR2201Input(operation, bop)
                         && checkR2201Output(operation, bop)
                         && checkR2716(bop);

Modified: incubator/cxf/trunk/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java?rev=575516&r1=575515&r2=575516&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
(original)
+++ incubator/cxf/trunk/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
Thu Sep 13 19:44:07 2007
@@ -220,6 +220,26 @@
         }
     }
 
+    @Test
+    public void testBPR2717() throws Exception {
+        try {
+            String[] args = new String[] {"-verbose",
+                                          getLocation("/validator_wsdl/cxf996.wsdl")};
+            WSDLValidator.main(args);
+        } catch (Exception e) {
+            assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2717:  ") == -1);
+            assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2210:  ") != -1);
+        }
+
+        try {
+            String[] args = new String[] {"-verbose",
+                                          getLocation("/validator_wsdl/bp2717.wsdl")};
+            WSDLValidator.main(args);
+        } catch (Exception e) {
+            assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2717:  ") != -1);
+        }
+    }
+
     @Override
     protected String getLocation(String wsdlFile) throws Exception {
         Enumeration<URL> e = WSDLValidationTest.class.getClassLoader().getResources(wsdlFile);

Added: incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/bp2717.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/bp2717.wsdl?rev=575516&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/bp2717.wsdl (added)
+++ incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/bp2717.wsdl Thu
Sep 13 19:44:07 2007
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://apache.org/hello_world_doc_lit_bare" xmlns:x1="http://apache.org/hello_world_doc_lit_bare/types"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://apache.org/hello_world_doc_lit_bare" name="DocLitBare">
+
+    <message name="pingMeRequest">
+        <part name="intRequest" element="xsd:int"/>
+        <part name="intInOutRequest" element="xsd:int" />
+    </message>
+    
+    <message name="pingMeResponse">
+        <part name="outStringResponse" element="xsd:string"/>
+        <part name="outIntResponse" element="xsd:int" />
+        <part name="intInOutRequest" element="xsd:int" />
+
+    </message>
+
+    <portType name="pingMePortType">
+        <operation name="pingMe">
+            <input message="tns:pingMeRequest"/>
+            <output message="tns:pingMeResponse"/>
+        </operation>        
+    </portType>
+    
+    <binding name="pingMeSoapBinding" type="tns:pingMePortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+        <operation name="pingMe">
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>       
+    </binding>
+
+    
+    <wsdl:service name="SOAPService">
+        <wsdl:port name="SoapPort" binding="tns:pingMeSoapBinding">
+            <soap:address location="http://localhost:9107/soapContext"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/cxf996.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/cxf996.wsdl?rev=575516&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/cxf996.wsdl (added)
+++ incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/cxf996.wsdl Thu
Sep 13 19:44:07 2007
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://apache.org/hello_world_doc_lit_bare" xmlns:x1="http://apache.org/hello_world_doc_lit_bare/types"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://apache.org/hello_world_doc_lit_bare" name="DocLitBare">
+    <wsdl:types>
+        <schema targetNamespace="http://apache.org/hello_world_doc_lit_bare/types" xmlns:tns="http://apache.org/hello_world_doc_lit_bare/types"
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+            <element name="intRequest" type="xsd:int"/>
+            <element name="intInOutRequest" type="xsd:int"/>
+            <element name="outStringResponse" type="xsd:string" nillable="true" />
+            <element name="outIntResponse" type="xsd:int" />
+        </schema>
+
+    </wsdl:types>
+    
+    <message name="pingMeRequest">
+        <part name="intRequest" element="x1:intRequest"/>
+        <part name="intInOutRequest" element="x1:intInOutRequest" />
+    </message>
+    
+    <message name="pingMeResponse">
+        <part name="outStringResponse" element="x1:outStringResponse"/>
+        <part name="outIntResponse" element="x1:outIntResponse" />
+        <part name="intInOutRequest" element="x1:intInOutRequest" />
+
+    </message>
+
+    <portType name="pingMePortType">
+        <operation name="pingMe">
+            <input message="tns:pingMeRequest"/>
+            <output message="tns:pingMeResponse"/>
+        </operation>        
+    </portType>
+    
+    <binding name="pingMeSoapBinding" type="tns:pingMePortType">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+        <operation name="pingMe">
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>       
+    </binding>
+
+    
+    <wsdl:service name="SOAPService">
+        <wsdl:port name="SoapPort" binding="tns:pingMeSoapBinding">
+            <soap:address location="http://localhost:9107/soapContext"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>



Mime
View raw message