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 br...@apache.org on 2006/06/14 18:37:39 UTC

svn commit: r414343 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/common/toolspec/toolspecs/ test/java/org/apache/yoko/tools/processors/ test/resources/idl/ test/resources/idlgen/

Author: bravi
Date: Wed Jun 14 11:37:38 2006
New Revision: 414343

URL: http://svn.apache.org/viewvc?rev=414343&view=rev
Log:
Fixing the test cases in tools module because of the copyright updates. JIRA:http://issues.apache.org/jira/browse/YOKO-62

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/idl2wsdl.xml
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/wsdl2idl.xml
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_HelloWorld.wsdl
    incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_oneway.idl
    incubator/yoko/trunk/tools/src/test/resources/idlgen/oneway.wsdl

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/idl2wsdl.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/idl2wsdl.xml?rev=414343&r1=414342&r2=414343&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/idl2wsdl.xml (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/idl2wsdl.xml Wed Jun 14 11:37:38 2006
@@ -1,4 +1,6 @@
-<!-- 
+<?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
@@ -16,8 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
 -->
-
-<?xml version="1.0" encoding="UTF-8"?>
 
 <!-- The xhtml namespace is for usage documentation -->
 <toolspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/wsdl2idl.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/wsdl2idl.xml?rev=414343&r1=414342&r2=414343&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/wsdl2idl.xml (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/toolspec/toolspecs/wsdl2idl.xml Wed Jun 14 11:37:38 2006
@@ -1,3 +1,5 @@
+<?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
@@ -16,8 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
 -->
-
-<?xml version="1.0" encoding="UTF-8"?>
 
 <!-- The xhtml namespace is for usage documentation -->
 <toolspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java?rev=414343&r1=414342&r2=414343&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java Wed Jun 14 11:37:38 2006
@@ -36,6 +36,9 @@
 
 public class IDLToWSDLGenerationTest extends TestCase {
 
+    public static String START_COMMENT = "<!--";
+    public static String END_COMMENT = "-->";
+
     public IDLToWSDLGenerationTest(String name) {
         super(name);
     }
@@ -52,34 +55,60 @@
     
     public void testHelloWorldWSDLGeneration() throws Exception {      
         URL idl = getClass().getResource("/idl/HelloWorld.idl");
-	ProcessorEnvironment env = new ProcessorEnvironment();
-	Map<String,Object> cfg = new HashMap<String,Object>();
-	cfg.put(ToolCorbaConstants.CFG_IDLFILE, idl.getFile());
-	env.setParameters(cfg);
-	IDLToWSDLProcessor processor = new IDLToWSDLProcessor();
-	processor.setEnvironment(env);
-	java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
-	processor.setOutputStream(out);
-	processor.process();
+        ProcessorEnvironment env = new ProcessorEnvironment();
+        Map<String,Object> cfg = new HashMap<String,Object>();
+        cfg.put(ToolCorbaConstants.CFG_IDLFILE, idl.getFile());
+        env.setParameters(cfg);
+        IDLToWSDLProcessor processor = new IDLToWSDLProcessor();
+        processor.setEnvironment(env);
+        java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
+        processor.setOutputStream(out);
+        processor.process();
 
-	InputStream origstream = getClass().getResourceAsStream("/idl/expected_HelloWorld.wsdl");
+        InputStream origstream = getClass().getResourceAsStream("/idl/expected_HelloWorld.wsdl");
         byte orig[] = inputStreamToBytes(origstream);
-	checkWSDLStrings(orig, out.toByteArray());
+        checkWSDLStrings(orig, out.toByteArray());
     }
 
     private void checkWSDLStrings(byte orig[], byte generated[]) throws Exception {
-	BufferedReader origReader = 
-	    new BufferedReader(new InputStreamReader(new java.io.ByteArrayInputStream(orig)));
-	BufferedReader genReader = 
-	    new BufferedReader(new InputStreamReader(new java.io.ByteArrayInputStream(generated)));
+        BufferedReader origReader = 
+            new BufferedReader(new InputStreamReader(new java.io.ByteArrayInputStream(orig)));
+        BufferedReader genReader = 
+            new BufferedReader(new InputStreamReader(new java.io.ByteArrayInputStream(generated)));
 
         String sorig = origReader.readLine();
         String sgen = genReader.readLine();
 
+        boolean origComment = false;
+        boolean genComment = false;
         while (sorig != null && sgen != null) {
-            assertEquals(sorig, sgen);
-            sorig = origReader.readLine();
-            sgen = genReader.readLine();
+            if (sorig.trim().startsWith(START_COMMENT)) {
+                origComment = true;
+            }
+            if (sgen.trim().startsWith(START_COMMENT)) {
+                genComment = true;
+            }
+            if ((!origComment) && (!genComment)) {
+                assertEquals(sorig, sgen);
+                sgen = genReader.readLine();
+                sorig = origReader.readLine();
+            }
+            if (sorig != null && sgen != null) {
+                if (sorig.trim().endsWith(END_COMMENT)) {
+                    origComment = false;
+                    sorig = origReader.readLine();
+                }
+                if (sgen.trim().endsWith(END_COMMENT)) {
+                    genComment = false;
+                    sgen = genReader.readLine();
+                }
+                if (genComment) {
+                    sgen = genReader.readLine();
+                }
+                if (origComment) {
+                    sorig = origReader.readLine();
+                }
+            }
         }
     }
 

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java?rev=414343&r1=414342&r2=414343&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java Wed Jun 14 11:37:38 2006
@@ -54,6 +54,9 @@
 
 public class WSDLToIDLGenerationTest extends TestCase {
 
+    public static String START_COMMENT = "/*";
+    public static String END_COMMENT = "*/";
+
     public WSDLToIDLGenerationTest(String name) {
         super(name);
     }
@@ -80,10 +83,36 @@
         String sorig = origReader.readLine();
         String sgen = genReader.readLine();
 
+        boolean origComment = false;
+        boolean genComment = false;
         while (sorig != null && sgen != null) {
-            assertEquals(sorig, sgen);
-            sorig = origReader.readLine();
-            sgen = genReader.readLine();
+            if (sorig.trim().startsWith(START_COMMENT)) {
+                origComment = true;
+            }
+            if (sgen.trim().startsWith(START_COMMENT)) {
+                genComment = true;
+            }
+            if ((!origComment) && (!genComment)) {
+                assertEquals(sorig, sgen);
+                sgen = genReader.readLine();
+                sorig = origReader.readLine();
+            }
+            if (sorig != null && sgen != null) {
+                if (sorig.trim().endsWith(END_COMMENT)) {
+                    origComment = false;
+                    sorig = origReader.readLine();
+                }
+                if (sgen.trim().endsWith(END_COMMENT)) {
+                    genComment = false;
+                    sgen = genReader.readLine();
+                }
+                if (genComment) {
+                    sgen = genReader.readLine();
+                }
+                if (origComment) {
+                    sorig = origReader.readLine();
+                }
+            }
         }
     }
 

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_HelloWorld.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_HelloWorld.wsdl?rev=414343&r1=414342&r2=414343&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_HelloWorld.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_HelloWorld.wsdl Wed Jun 14 11:37:38 2006
@@ -1,5 +1,4 @@
 <?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
@@ -18,7 +17,6 @@
  * specific language governing permissions and limitations
  * under the License.
 -->
-
 <wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/HelloWorld" xmlns:tns="http://schemas.apache.org/yoko/idl/HelloWorld" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:ns1="http://schemas.apache.org/yoko/idl/HelloWorld/corba/typemap/" 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 attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/HelloWorld" xmlns="http://schemas.apache.org/yoko/idl/HelloWorld" xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="greetMeResponse" type="xs:string"/><xs:element name="greetMe" type="xs:string"/></xs:schema>
@@ -47,4 +45,4 @@
     <wsdl:port name="HelloWorldCORBAPort" binding="tns:HelloWorldCORBABinding">
 <corba:address location="IOR:" />    </wsdl:port>
   </wsdl:service>
-<corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/HelloWorld/corba/typemap/" /></wsdl:definitions>
+<corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/HelloWorld/corba/typemap/" /></wsdl:definitions>
\ No newline at end of file

Modified: incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_oneway.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_oneway.idl?rev=414343&r1=414342&r2=414343&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_oneway.idl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_oneway.idl Wed Jun 14 11:37:38 2006
@@ -16,7 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
 */
-
 interface BasePortType {
     oneway void
     test_oneway(

Modified: incubator/yoko/trunk/tools/src/test/resources/idlgen/oneway.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idlgen/oneway.wsdl?rev=414343&r1=414342&r2=414343&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idlgen/oneway.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idlgen/oneway.wsdl Wed Jun 14 11:37:38 2006
@@ -1,5 +1,4 @@
 <?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
@@ -18,7 +17,6 @@
  * specific language governing permissions and limitations
  * under the License.
 -->
-
 <definitions name="BaseService"    
     targetNamespace="http://schemas.apache.org/tests" 
     xmlns="http://schemas.xmlsoap.org/wsdl/"