You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by mm...@apache.org on 2007/04/25 10:00:21 UTC

svn commit: r532244 - in /incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools: fortest/cxf523/ java2wsdl/processor/ java2wsdl/processor/expected/

Author: mmao
Date: Wed Apr 25 01:00:20 2007
New Revision: 532244

URL: http://svn.apache.org/viewvc?view=rev&rev=532244
Log:
CXF-523
  Add a test case to show it's not a problem, i can not reproduce the concurrent exception.

Added:
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/DBServiceFault.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Database.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Operation0ResponseType.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/db.wsdl
Modified:
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Added: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/DBServiceFault.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/DBServiceFault.java?view=auto&rev=532244
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/DBServiceFault.java (added)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/DBServiceFault.java Wed Apr 25 01:00:20 2007
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+package org.apache.cxf.tools.fortest.cxf523;
+
+public class DBServiceFault extends Exception {
+}

Added: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Database.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Database.java?view=auto&rev=532244
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Database.java (added)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Database.java Wed Apr 25 01:00:20 2007
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+package org.apache.cxf.tools.fortest.cxf523;
+
+import java.rmi.RemoteException;
+
+
+public interface Database extends java.rmi.Remote {
+
+    Operation0ResponseType[] operation0() throws DBServiceFault, RemoteException;
+
+}

Added: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Operation0ResponseType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Operation0ResponseType.java?view=auto&rev=532244
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Operation0ResponseType.java (added)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/fortest/cxf523/Operation0ResponseType.java Wed Apr 25 01:00:20 2007
@@ -0,0 +1,115 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.tools.fortest.cxf523;
+
+
+import java.util.Calendar;
+import javax.xml.namespace.QName;
+
+public class Operation0ResponseType {
+
+    public static final String TARGET_NAMESPACE = "http://www.iona.com/db_service";
+
+    public static final QName QNAME = new QName("http://www.iona.com/db_service", "operation0ResponseType");
+
+
+    private String name;
+    private String owner;
+    private String species;
+    private String sex;
+    private Calendar birth;
+    private Calendar death;
+
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String val) {
+        this.name = val;
+    }
+
+    public String getOwner() {
+        return owner;
+    }
+
+    public void setOwner(String val) {
+        this.owner = val;
+    }
+
+    public String getSpecies() {
+        return species;
+    }
+
+    public void setSpecies(String val) {
+        this.species = val;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String val) {
+        this.sex = val;
+    }
+
+    public Calendar getBirth() {
+        return birth;
+    }
+
+    public void setBirth(Calendar val) {
+        this.birth = val;
+    }
+
+    public Calendar getDeath() {
+        return death;
+    }
+
+    public void setDeath(Calendar val) {
+        this.death = val;
+    }
+
+    public QName getQName() {
+        return QNAME;
+    }
+
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        if (name != null) {
+            buffer.append("name : " + name + "\n");
+        }
+        if (owner != null) {
+            buffer.append("owner : " + owner + "\n");
+        }
+        if (species != null) {
+            buffer.append("species : " + species + "\n");
+        }
+        if (sex != null) {
+            buffer.append("sex : " + sex + "\n");
+        }
+        if (birth != null) {
+            buffer.append("birth : " + birth + "\n");
+        }
+        if (death != null) {
+            buffer.append("death : " + death + "\n");
+        }
+        return buffer.toString();
+    }
+}

Modified: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?view=diff&rev=532244&r1=532243&r2=532244
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java (original)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java Wed Apr 25 01:00:20 2007
@@ -80,8 +80,6 @@
         String expectedFile = getClass().getResource("expected/calculator.wsdl").getFile();
         assertFileEquals(new File(expectedFile), new File(output, "calculator.wsdl"));
 
-        // Test for CXF-337
-        // FIXME - check for existence and correctness of faults
     }
 
     @Test
@@ -131,6 +129,19 @@
 
         String expectedFile = getClass().getResource("expected/hello_soap12.wsdl").getFile();
         assertFileEquals(new File(expectedFile), new File(output, "hello_soap12.wsdl"));
+    }
+
+    @Test
+    public void testDatBase() throws Exception {
+        ToolContext context = new ToolContext();
+        context.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.cxf523.Database");
+        context.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/db.wsdl");
+        
+        processor.setEnvironment(context);
+        processor.process();
+
+        String expectedFile = getClass().getResource("expected/db.wsdl").getFile();
+        assertFileEquals(new File(expectedFile), new File(output, "db.wsdl"));
     }
 
 }

Added: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/db.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/db.wsdl?view=auto&rev=532244
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/db.wsdl (added)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/db.wsdl Wed Apr 25 01:00:20 2007
@@ -0,0 +1,117 @@
+<?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 name="Database" targetNamespace="http://cxf523.fortest.tools.cxf.apache.org/" xmlns:ns1="http://cxf523.fortest.tools.cxf.apache.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <wsdl:types>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://cxf523.fortest.tools.cxf.apache.org/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://cxf523.fortest.tools.cxf.apache.org/">
+<xs:complexType name="operation0ResponseType">
+<xs:sequence>
+<xs:element minOccurs="0" name="birth" type="xs:dateTime"/>
+<xs:element minOccurs="0" name="death" type="xs:dateTime"/>
+<xs:element minOccurs="0" name="name" type="xs:string"/>
+<xs:element minOccurs="0" name="owner" type="xs:string"/>
+<xs:element minOccurs="0" name="sex" type="xs:string"/>
+<xs:element minOccurs="0" name="species" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+<xs:complexType final="#all" name="operation0ResponseTypeArray">
+<xs:sequence>
+<xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="tns:operation0ResponseType"/>
+</xs:sequence>
+</xs:complexType>
+<xs:element name="operation0">
+<xs:complexType>
+<xs:sequence/>
+</xs:complexType>
+</xs:element>
+<xs:element name="operation0Response">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="tns:operation0ResponseTypeArray"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="RemoteException">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="message" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="DBServiceFault">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="message" nillable="true" type="xs:string"/>
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+</xs:schema>
+  </wsdl:types>
+  <wsdl:message name="operation0">
+    <wsdl:part name="operation0" element="ns1:operation0">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="RemoteException">
+    <wsdl:part name="fault" element="ns1:RemoteException">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="DBServiceFault">
+    <wsdl:part name="fault" element="ns1:DBServiceFault">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="operation0Response">
+    <wsdl:part name="operation0Response" element="ns1:operation0Response">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="DatabasePortType">
+    <wsdl:operation name="operation0">
+      <wsdl:input name="operation0" message="ns1:operation0">
+    </wsdl:input>
+      <wsdl:output name="operation0Response" message="ns1:operation0Response">
+    </wsdl:output>
+      <wsdl:fault name="DBServiceFault" message="ns1:DBServiceFault">
+    </wsdl:fault>
+      <wsdl:fault name="RemoteException" message="ns1:RemoteException">
+    </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="DatabaseSoapBinding" type="ns1:DatabasePortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="operation0">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="operation0">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="operation0Response">
+        <soap:body use="literal"/>
+      </wsdl:output>
+      <wsdl:fault name="DBServiceFault">
+        <soap:fault name="DBServiceFault" use="literal"/>
+      </wsdl:fault>
+      <wsdl:fault name="RemoteException">
+        <soap:fault name="RemoteException" use="literal"/>
+      </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="Database">
+    <wsdl:port name="DatabasePort" binding="ns1:DatabaseSoapBinding">
+      <soap:address location="http://localhost:9090/hello"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>