Author: dkulp
Date: Thu Oct 24 18:41:59 2013
New Revision: 1535493

URL: http://svn.apache.org/r1535493
Log:
Merged revisions 1535489 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1535489 | dkulp | 2013-10-24 14:36:14 -0400 (Thu, 24 Oct 2013) | 16 lines

  Merged revisions 1535486 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1535486 | dkulp | 2013-10-24 14:33:34 -0400 (Thu, 24 Oct 2013) | 8 lines

    [CXF-5340] - Handling quoted literals and exception members

    "local" literal was incorrectly treated as literal.
    exception members' types where not identified correctly - "unsigned
    long" was treated as "unsigned" type with name "long"

    Patch from Grzegorz Grzybek applied

  ........

........

Added:
    cxf/branches/2.6.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl
Modified:
    
cxf/branches/2.6.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
    
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java
    
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g
    
cxf/branches/2.6.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java

Modified: 
cxf/branches/2.6.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java?rev=1535493&r1=1535492&r2=1535493&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
 (original)
+++ 
cxf/branches/2.6.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
 Thu Oct 24 18:41:59 2013
@@ -348,7 +348,6 @@ tryAgain:
                                }
                                if ( _returnToken==null ) continue tryAgain; // 
found SKIP token
                                _ttype = _returnToken.getType();
-                               _ttype = testLiteralsTable(_ttype);
                                _returnToken.setType(_ttype);
                                return _returnToken;
                        }

Modified: 
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java?rev=1535493&r1=1535492&r2=1535493&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java
 (original)
+++ 
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java
 Thu Oct 24 18:41:59 2013
@@ -99,7 +99,7 @@ public class ExceptionVisitor extends Vi
         // exception members
         AST memberTypeNode = identifierNode.getNextSibling();
         while (memberTypeNode != null) {
-            AST memberNode = memberTypeNode.getNextSibling();
+            AST memberNode = TypesUtils.getCorbaTypeNameNode(memberTypeNode);
 
             TypesVisitor visitor = new TypesVisitor(exceptionScope,
                                                     definition,

Modified: 
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g?rev=1535493&r1=1535492&r2=1535493&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g
 (original)
+++ 
cxf/branches/2.6.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g
 Thu Oct 24 18:41:59 2013
@@ -954,6 +954,7 @@ options {
        exportVocab=IDL;
        charVocabulary='\u0000'..'\uFFFE';
        k=4;
+       testLiterals=false;
 }
 
 SEMI

Modified: 
cxf/branches/2.6.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java?rev=1535493&r1=1535492&r2=1535493&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java
 (original)
+++ 
cxf/branches/2.6.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java
 Thu Oct 24 18:41:59 2013
@@ -435,4 +435,39 @@ public class IDLToWSDLTest extends ToolT
         String s = StaxUtils.toString(doc.getDocumentElement());
         assertTrue(s.contains("name=\"myStruct\""));
     }
+
+    public void testCXF5340() throws Exception {
+        File input = new 
File(getClass().getResource("/idl/CXF5340.idl").toURI());
+        String[] args = new String[] {
+            "-o", output.toString(),
+            "-verbose", "-qualified",
+            input.toString()
+        };
+        IDLToWSDL.run(args);
+        File fs = new File(output, "CXF5340.wsdl");
+        assertTrue(fs.getName() + " was not created.", fs.exists());
+
+        String corbaNs = "http://cxf.apache.org/bindings/corba";;
+        Document doc = StaxUtils.read(new FileInputStream(fs));
+
+        // const with value "local"
+        NodeList nl = doc.getDocumentElement().getElementsByTagNameNS(corbaNs, 
"const");
+        assertEquals(1, nl.getLength());
+        Element c = (Element)nl.item(0);
+        assertEquals("repro.NOT_CONN_LOCAL", c.getAttribute("name"));
+        assertEquals("local", c.getAttribute("value"));
+
+        // unsigned long case
+        nl = doc.getDocumentElement().getElementsByTagNameNS(corbaNs, 
"exception");
+        assertEquals(1, nl.getLength());
+        Element exception = (Element)nl.item(0);
+        nl = exception.getElementsByTagNameNS(corbaNs, "member");
+        assertEquals(2, nl.getLength());
+        Element number = (Element)nl.item(0);
+        assertEquals("ulong", number.getAttribute("idltype").split(":")[1]);
+        assertEquals("m_number", number.getAttribute("name"));
+        Element message = (Element)nl.item(1);
+        assertEquals("string", message.getAttribute("idltype").split(":")[1]);
+        assertEquals("m_message", message.getAttribute("name"));
+    }
 }

Added: cxf/branches/2.6.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl?rev=1535493&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl 
(added)
+++ cxf/branches/2.6.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl Thu 
Oct 24 18:41:59 2013
@@ -0,0 +1,26 @@
+module repro {
+
+       const string NOT_CONN_LOCAL = "local";
+
+       // Exceptions of this type may be thrown by the following interfaces
+       exception msgError {
+               unsigned long   m_number;               // error number
+               string                  m_message;              // error text
+       };
+
+       enum Reply {
+                       positive        // i.e. Ok or Yes
+               ,       negative        // i.e. No or Cancel
+               ,       _dont_use_3     // don't use, align to hbMsg.h
+               ,       _dont_use_4     // don't use, align to hbMsg.h
+               ,       _dont_use_5     // don't use, align to hbMsg.h
+               ,       errTimeout      // i.e. there was a timeout in a timed 
request
+               ,       errError        // i.e. there was an error during the 
request
+               ,       cancelled       // i.e. some person or some process 
cancelled the request
+       };
+
+       interface Service {
+               Reply getFirst( in Reply rep, out Reply reply ) raises 
(msgError);
+       };
+
+};


Reply via email to