incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r548389 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/processors/idl/ test/resources/idl/
Date Mon, 18 Jun 2007 16:15:12 GMT
Author: bravi
Date: Mon Jun 18 09:15:05 2007
New Revision: 548389

URL: http://svn.apache.org/viewvc?view=rev&rev=548389
Log:
[YOKO-334] - Fixing some issues with fully qualified interface inheritance in the IDLToWSDL
tool.

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_Inheritance.wsdl
    incubator/yoko/trunk/tools/src/test/resources/idl/inheritance.idl

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java?view=diff&rev=548389&r1=548388&r2=548389
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
Mon Jun 18 09:15:05 2007
@@ -223,19 +223,8 @@
         
         Scope inheritanceScope = null;
         AST interfaceNameNode = interfaceInheritanceSpecNode.getFirstChild();
-
-        // We need to build the scope that may be included with the inheritance node tree
-        while (interfaceNameNode.getFirstChild() != null) {
-            if (inheritanceScope == null) {
-                inheritanceScope = new Scope();
-            }
-            inheritanceScope = new Scope(inheritanceScope, interfaceNameNode.toString());
-            interfaceNameNode = interfaceNameNode.getFirstChild();
-        }
-
         BindingType corbaBinding = findCorbaBinding(binding);
-        while (interfaceNameNode != null) {
-            
+        while (interfaceNameNode != null) {            
             // TODO
             // add interface inheritance information to XmlSchema and CorbaTypeMap here 

             
@@ -244,22 +233,20 @@
             if (ScopedNameVisitor.isFullyScopedName(interfaceNameNode)) {
                 Scope interfaceScope = ScopedNameVisitor.getFullyScopedName(new Scope(),
interfaceNameNode);
                 intf = findPortType(interfaceScope.toString());
-            } else {
-                Scope currentScope = getScope();
-                while (intf == null
-                       && currentScope != currentScope.getParent()) {
-                    Scope interfaceScope = null;
-                    if (inheritanceScope == null) {
-                        interfaceScope = new Scope(currentScope, interfaceNameNode.toString());
-                    } else {
-                        // Prefix any scope we discovered earlier to the current interfaceNameNode
-                        interfaceScope = new Scope(currentScope, inheritanceScope,
-                                                   interfaceNameNode.toString());
-                    }
-                    intf = findPortType(interfaceScope.toString());
-                    currentScope = currentScope.getParent();
+            }
+            Scope currentScope = getScope();
+            while (intf == null
+                   && currentScope != currentScope.getParent()) {
+                Scope interfaceScope;
+                if (ScopedNameVisitor.isFullyScopedName(interfaceNameNode)) {
+                    interfaceScope = ScopedNameVisitor.getFullyScopedName(currentScope, interfaceNameNode);
+                } else {
+                    interfaceScope = new Scope(currentScope, interfaceNameNode.toString());
                 }
+                intf = findPortType(interfaceScope.toString());
+                currentScope = currentScope.getParent();
             }
+            
             if (intf == null) {
                 throw new RuntimeException("[InterfaceVisitor] Unknown Interface: "
                                            + interfaceNameNode.toString());

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java?view=diff&rev=548389&r1=548388&r2=548389
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
Mon Jun 18 09:15:05 2007
@@ -344,11 +344,10 @@
         return result;
     }       
     
-    protected static boolean isFullyScopedName(AST node) {        
-        if (node.getType() == IDLTokenTypes.IDENT) {    
+    protected static boolean isFullyScopedName(AST node) {
+        if (node.getType() == IDLTokenTypes.IDENT) {
             if (node.getFirstChild() != null) {
                 if ((node.getFirstChild().getType() == IDLTokenTypes.SCOPEOP)
-    
                     || (node.getFirstChild().getType() == IDLTokenTypes.IDENT)) {
                     return true;
                 }

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Inheritance.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_Inheritance.wsdl?view=diff&rev=548389&r1=548388&r2=548389
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_Inheritance.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_Inheritance.wsdl Mon Jun 18
09:15:05 2007
@@ -182,6 +182,8 @@
     </wsdl:output>
     </wsdl:operation>
   </wsdl:portType>
+  <wsdl:portType name="X.Interface3">
+  </wsdl:portType>
   <wsdl:portType name="A.B.C.E.Interface2">
     <wsdl:operation name="testInterface2">
       <wsdl:input name="testInterface2Request" message="tns:testInterface2">
@@ -190,6 +192,8 @@
     </wsdl:output>
     </wsdl:operation>
   </wsdl:portType>
+  <wsdl:portType name="A.B.C.E.Interface4">
+  </wsdl:portType>
   <wsdl:portType name="A.B.C.D.Interface1">
     <wsdl:operation name="testInterface1">
       <wsdl:input name="testInterface1Request" message="tns:testInterface1">
@@ -212,6 +216,9 @@
     </wsdl:output>
     </wsdl:operation>
   </wsdl:portType>
+  <wsdl:binding name="A.B.C.E.Interface4CORBABinding" type="tns:A.B.C.E.Interface4">
+    <corba:binding repositoryID="IDL:A/B/C/E/Interface4:1.0" bases="IDL:A/B/C/E/Interface2:1.0"
/>
+  </wsdl:binding>
   <wsdl:binding name="org.apache.IpTestCORBABinding" type="tns:org.apache.IpTest">
     <corba:binding repositoryID="IDL:org/apache/IpTest:1.0" />
     <wsdl:operation name="test">
@@ -275,6 +282,14 @@
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
+  <wsdl:binding name="X.Interface3CORBABinding" type="tns:X.Interface3">
+    <corba:binding repositoryID="IDL:X/Interface3:1.0" bases="IDL:A/B/C/D/Interface1:1.0"
/>
+  </wsdl:binding>
+  <wsdl:service name="A.B.C.E.Interface4CORBAService">
+    <wsdl:port name="A.B.C.E.Interface4CORBAPort" binding="tns:A.B.C.E.Interface4CORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
   <wsdl:service name="org.apache.yoko.IpServiceCORBAService">
     <wsdl:port name="org.apache.yoko.IpServiceCORBAPort" binding="tns:org.apache.yoko.IpServiceCORBABinding">
       <corba:address location="IOR:" />
@@ -287,6 +302,11 @@
   </wsdl:service>
   <wsdl:service name="org.apache.IpTestCORBAService">
     <wsdl:port name="org.apache.IpTestCORBAPort" binding="tns:org.apache.IpTestCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+  <wsdl:service name="X.Interface3CORBAService">
+    <wsdl:port name="X.Interface3CORBAPort" binding="tns:X.Interface3CORBABinding">
       <corba:address location="IOR:" />
     </wsdl:port>
   </wsdl:service>

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/inheritance.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/inheritance.idl?view=diff&rev=548389&r1=548388&r2=548389
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/inheritance.idl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/inheritance.idl Mon Jun 18 09:15:05
2007
@@ -56,9 +56,16 @@
                 interface Interface2 : D::Interface1 {
                     void testInterface2();
                 };
+				interface Interface4 : E::Interface2 {
+				};
             };
         };
     };
+};
+
+module X {
+    interface Interface3 : A::B::C::D::Interface1 {
+	};
 };
 
 



Mime
View raw message