You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by mv...@apache.org on 2007/03/29 11:21:17 UTC

svn commit: r523671 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java test/resources/idl/ObjectRef.idl test/resources/idl/expected_ObjectRef.wsdl

Author: mvescovi
Date: Thu Mar 29 04:21:16 2007
New Revision: 523671

URL: http://svn.apache.org/viewvc?view=rev&rev=523671
Log:
[YOKO-321] Fixed problem with idltowsdl ObjectReference visitCustomTypeObjectReference incorrectly handling scoping

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
    incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java?view=diff&rev=523671&r1=523670&r2=523671
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java Thu Mar 29 04:21:16 2007
@@ -138,7 +138,7 @@
     }
     
     private void visitCustomTypeObjectReference(AST node) {
-        Scope customScope = new Scope(new Scope(), node);
+        Scope customScope = new Scope(getScope().getParent(), node);
         QName referenceName = new QName(schema.getTargetNamespace(),
                                         customScope.toString() + "Ref");
 

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl?view=diff&rev=523671&r1=523670&r2=523671
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl Thu Mar 29 04:21:16 2007
@@ -30,3 +30,11 @@
     boolean testCustomObjectParam(in TestObject param);
     TestObject testCustomObjectReturn();
 };
+
+module foobar {
+     interface foo {
+     };
+     interface bar {
+         void barOp(in foo fooPar);
+     };
+}; 

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl?view=diff&rev=523671&r1=523670&r2=523671
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl Thu Mar 29 04:21:16 2007
@@ -21,6 +21,7 @@
   <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/ObjectRef/typemap">
     <corba:object xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" repositoryID="IDL:omg.org/CORBA/Object/1.0" name="CORBA.Object" type="ns4:EndpointReferenceType" />
     <corba:object xmlns:ns5="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" xmlns="http://schemas.apache.org/yoko/idl/ObjectRef" binding="TestObjectCORBABinding" repositoryID="IDL:TestObject:1.0" name="ns4:TestObject" type="ns5:EndpointReferenceType" />
+    <corba:object xmlns:ns5="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" xmlns="http://schemas.apache.org/yoko/idl/ObjectRef" binding="foobar.fooCORBABinding" repositoryID="IDL:foobar/foo:1.0" name="ns4:foobar.foo" type="ns5:EndpointReferenceType" />
   </corba:typeMapping>
   <wsdl:types>
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/ObjectRef" xmlns="http://schemas.apache.org/yoko/idl/ObjectRef" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema">
@@ -120,34 +121,62 @@
           </xs:sequence>
         </xs:complexType>
       </xs:element>
+      <xs:element name="barOp">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="fooPar" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="barOpResponse">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="foobar.fooRef" type="wsa:EndpointReferenceType">
+        <xs:annotation>
+          <xs:appinfo>
+          </xs:appinfo>
+        </xs:annotation>
+      </xs:element>
     </xs:schema>
   </wsdl:types>
-  <wsdl:message name="testObjectValueUpdateResponse">
-    <wsdl:part name="outparameter" element="tns:testObjectValueUpdateResponse">
-    </wsdl:part>
-  </wsdl:message>
   <wsdl:message name="testObjectValue">
     <wsdl:part name="inparameter" element="tns:testObjectValue">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="testDefaultObjectReturn">
-    <wsdl:part name="inparameter" element="tns:testDefaultObjectReturn">
+  <wsdl:message name="barOp">
+    <wsdl:part name="inparameter" element="tns:barOp">
     </wsdl:part>
   </wsdl:message>
   <wsdl:message name="testDefaultObjectParamResponse">
     <wsdl:part name="outparameter" element="tns:testDefaultObjectParamResponse">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="testCustomObjectReturn">
+    <wsdl:part name="inparameter" element="tns:testCustomObjectReturn">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testObjectValueResponse">
+    <wsdl:part name="outparameter" element="tns:testObjectValueResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testObjectValueUpdateResponse">
+    <wsdl:part name="outparameter" element="tns:testObjectValueUpdateResponse">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="testDefaultObjectParam">
     <wsdl:part name="inparameter" element="tns:testDefaultObjectParam">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="testCustomObjectParam">
-    <wsdl:part name="inparameter" element="tns:testCustomObjectParam">
+  <wsdl:message name="testDefaultObjectReturn">
+    <wsdl:part name="inparameter" element="tns:testDefaultObjectReturn">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="testCustomObjectReturn">
-    <wsdl:part name="inparameter" element="tns:testCustomObjectReturn">
+  <wsdl:message name="testCustomObjectParam">
+    <wsdl:part name="inparameter" element="tns:testCustomObjectParam">
     </wsdl:part>
   </wsdl:message>
   <wsdl:message name="testCustomObjectParamResponse">
@@ -158,18 +187,26 @@
     <wsdl:part name="inparameter" element="tns:testObjectValueUpdate">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="testObjectValueResponse">
-    <wsdl:part name="outparameter" element="tns:testObjectValueResponse">
-    </wsdl:part>
-  </wsdl:message>
   <wsdl:message name="testDefaultObjectReturnResponse">
     <wsdl:part name="outparameter" element="tns:testDefaultObjectReturnResponse">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="barOpResponse">
+    <wsdl:part name="outparameter" element="tns:barOpResponse">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="testCustomObjectReturnResponse">
     <wsdl:part name="outparameter" element="tns:testCustomObjectReturnResponse">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:portType name="foobar.bar">
+    <wsdl:operation name="barOp">
+      <wsdl:input name="barOpRequest" message="tns:barOp">
+    </wsdl:input>
+      <wsdl:output name="barOpResponse" message="tns:barOpResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
   <wsdl:portType name="TestInterface">
     <wsdl:operation name="testDefaultObjectParam">
       <wsdl:input name="testDefaultObjectParamRequest" message="tns:testDefaultObjectParam">
@@ -196,6 +233,8 @@
     </wsdl:output>
     </wsdl:operation>
   </wsdl:portType>
+  <wsdl:portType name="foobar.foo">
+  </wsdl:portType>
   <wsdl:portType name="TestObject">
     <wsdl:operation name="testObjectValue">
       <wsdl:input name="testObjectValueRequest" message="tns:testObjectValue">
@@ -210,6 +249,9 @@
     </wsdl:output>
     </wsdl:operation>
   </wsdl:portType>
+  <wsdl:binding name="foobar.fooCORBABinding" type="tns:foobar.foo">
+    <corba:binding repositoryID="IDL:foobar/foo:1.0" />
+  </wsdl:binding>
   <wsdl:binding name="TestInterfaceCORBABinding" type="tns:TestInterface">
     <corba:binding repositoryID="IDL:TestInterface:1.0" />
     <wsdl:operation name="testDefaultObjectParam">
@@ -251,6 +293,18 @@
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
+  <wsdl:binding name="foobar.barCORBABinding" type="tns:foobar.bar">
+    <corba:binding repositoryID="IDL:foobar/bar:1.0" />
+    <wsdl:operation name="barOp">
+      <corba:operation name="barOp">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" mode="in" name="fooPar" idltype="foobar.foo" />
+      </corba:operation>
+      <wsdl:input name="barOpRequest">
+      </wsdl:input>
+      <wsdl:output name="barOpResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
   <wsdl:binding name="TestObjectCORBABinding" type="tns:TestObject">
     <corba:binding repositoryID="IDL:TestObject:1.0" />
     <wsdl:operation name="testObjectValue">
@@ -272,6 +326,16 @@
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
+  <wsdl:service name="foobar.fooCORBAService">
+    <wsdl:port name="foobar.fooCORBAPort" binding="tns:foobar.fooCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+  <wsdl:service name="foobar.barCORBAService">
+    <wsdl:port name="foobar.barCORBAPort" binding="tns:foobar.barCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
   <wsdl:service name="TestInterfaceCORBAService">
     <wsdl:port name="TestInterfaceCORBAPort" binding="tns:TestInterfaceCORBABinding">
       <corba:address location="IOR:" />