incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mvesc...@apache.org
Subject svn commit: r517634 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java test/java/org/apache/yoko/tools/IDLToWSDLTest.java
Date Tue, 13 Mar 2007 10:30:33 GMT
Author: mvescovi
Date: Tue Mar 13 03:30:22 2007
New Revision: 517634

URL: http://svn.apache.org/viewvc?view=rev&rev=517634
Log:
[YOKO-304] Added idltowsdl tool option -x <schema-namespace> to specify the schema namespace
to use in the wsdl

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/IDLToWSDLTest.java

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java?view=diff&rev=517634&r1=517633&r2=517634
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java
Tue Mar 13 03:30:22 2007
@@ -36,4 +36,5 @@
     public static final String CFG_SEQUENCE_OCTET_TYPE_BASE64BINARY = "base64Binary";
     public static final String CFG_SEQUENCE_OCTET_TYPE_HEXBINARY = "hexBinary";
     public static final String CFG_SCHEMA_NAMESPACE = "schemans";
+    public static final String CFG_SCHEMA_NAMESPACE_PREFIX = "xsd1";
 }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java?view=diff&rev=517634&r1=517633&r2=517634
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
Tue Mar 13 03:30:22 2007
@@ -101,6 +101,11 @@
             if (env.optionSet(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE)) {
                 visitor.setSequenceOctetType((String) env.get(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE));
             }
+            if (env.optionSet(ToolCorbaConstants.CFG_SCHEMA_NAMESPACE)) {
+                visitor.getDefinition()
+                    .addNamespace(ToolCorbaConstants.CFG_SCHEMA_NAMESPACE_PREFIX,
+                                  (String) env.get(ToolCorbaConstants.CFG_SCHEMA_NAMESPACE));
+            }
             visitor.visit(idlTree);
             if (outputWriter == null) {
                 FileWriterUtil fw = new FileWriterUtil(outputDir);

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/IDLToWSDLTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/IDLToWSDLTest.java?view=diff&rev=517634&r1=517633&r2=517634
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/IDLToWSDLTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/IDLToWSDLTest.java Tue
Mar 13 03:30:22 2007
@@ -195,4 +195,18 @@
         
         wsdlGenTester.compare(expectedStream, actualStream);
     }
+    
+    // test "-x <schema-namespace>" 
+    public void testSchemaNamespace() throws Exception {
+        File input = new File(getClass().getResource("/idl/HelloWorld.idl").getFile());
+        File actual = new File(output, "HelloWorld.wsdl");
+        File expected = new File(getClass().getResource("/idl/expected_HelloWorld_schema_namespace.wsdl").getFile());
+        
+        String[] args = new String[] {"-x", "http://yoko.org/foobar/schema",
+                                      "-o", output.toString(),
+                                      input.toString()
+                                      };
+        IDLToWSDL.main(args);
+        testGeneratedWsdl(expected, actual);
+    }
 }



Mime
View raw message