Author: darran.lofthouse(a)jboss.com
Date: 2007-05-04 11:08:18 -0400 (Fri, 04 May 2007)
New Revision: 2962
Added:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/PhoneBook.wsdl
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/wstools-config.xml
Modified:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java
Log:
Initial Test Case.
Added:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java
===================================================================
---
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java
(rev 0)
+++
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java 2007-05-04
15:08:18 UTC (rev 2962)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.tools.jbws1597;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 27 Apr 2007
+ */
+public class JBWS1597TestCase extends JBossWSTest
+{
+
+ public void testGenerateDocLitIn() throws Exception
+ {
+ generateScenario("doclit_in");
+ }
+
+ protected void generateScenario(final String scenario) throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1597/" + scenario;
+ String toolsDir = "tools/jbws1597/" + scenario;
+ String[] args = new String[] { "-dest", toolsDir, "-config",
resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+ File resourceDirFile = new File(resourceDir);
+ String[] expectedFiles = resourceDirFile.list(new FilenameFilter() {
+ public boolean accept(File dir, String name)
+ {
+ return name.endsWith(".java");
+ }
+ });
+
+ for (int i = 0; i < expectedFiles.length; i++)
+ {
+ String currentFile = expectedFiles[i];
+
+ try
+ {
+ compareSource(resourceDir + "/" + currentFile, toolsDir +
"/org/jboss/test/ws/jbws1597/" + currentFile);
+ }
+ catch (Exception e)
+ {
+ throw new Exception("Validation of '" + currentFile +
"' failed.", e);
+ }
+ }
+
+ File packageDir = new File(toolsDir + "/org/jboss/test/ws/jbws1597");
+ String[] generatedFiles = packageDir.list();
+ for (int i = 0; i < generatedFiles.length; i++)
+ {
+ String currentFile = generatedFiles[i];
+
+ boolean matched = "PhoneBookService.java".equals(currentFile);
+
+ for (int j = 0; j < expectedFiles.length && (matched == false); j++)
+ matched = currentFile.equals(expectedFiles[j]);
+
+ assertTrue("File '" + currentFile + "' was not expected
to be generated", matched);
+ }
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir +
"/jaxrpc-mapping.xml");
+ }
+
+ private static void compareSource(final String expectedName, final String
generatedName) throws Exception
+ {
+ File expected = new File(expectedName);
+ File generated = new File(generatedName);
+
+ JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
+ sc.validate();
+ sc.validateImports();
+ }
+
+}
Property changes on:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1597/JBWS1597TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java
===================================================================
---
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java 2007-05-04
15:06:01 UTC (rev 2961)
+++
branches/dlofthouse/JBWS-1625/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws429/JBWS429TestCase.java 2007-05-04
15:08:18 UTC (rev 2962)
@@ -24,7 +24,7 @@
import java.io.File;
import java.io.FilenameFilter;
-import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
import org.jboss.ws.tools.WSTools;
@@ -37,7 +37,7 @@
* @author darran.lofthouse(a)jboss.com
* @since 11 Apr 2007
*/
-public class JBWS429TestCase extends WSToolsTest
+public class JBWS429TestCase extends JBossWSTest
{
/**
Added:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/PhoneBook.wsdl
===================================================================
---
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/PhoneBook.wsdl
(rev 0)
+++
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/PhoneBook.wsdl 2007-05-04
15:08:18 UTC (rev 2962)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook'
+
targetNamespace='http://test.jboss.org/ws/jbws1597'
+
xmlns='http://schemas.xmlsoap.org/wsdl/'
+
xmlns:ns1='http://test.jboss.org/ws/jbws1597/types'
+
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+
xmlns:tns='http://test.jboss.org/ws/jbws1597'
+
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema
targetNamespace='http://test.jboss.org/ws/jbws1597/types'
+
xmlns='http://www.w3.org/2001/XMLSchema'
+
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
+
xmlns:tns='http://test.jboss.org/ws/jbws1597/types'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <sequence>
+ <element name='firstName' nillable='true'
type='string'/>
+ <element name='surname' nillable='true'
type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='areaCode' nillable='true'
type='string'/>
+ <element name='number' nillable='true'
type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='BillingAccount'>
+ <sequence>
+ <element name='sortCode' nillable='true'
type='string'/>
+ <element name='accountNumber' nillable='true'
type='string'/>
+ </sequence>
+ </complexType>
+
+ <element name='lookup' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ <element name='billingAccount' type='tns:BillingAccount'/>
+ </schema>
+ </types>
+
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ <part element='ns1:billingAccount' name='header'/>
+ </message>
+
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal' parts='parameters'/>
+ <soap:header use='literal' message='tns:PhoneBook_lookup'
part='header' />
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/PhoneBook.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/wstools-config.xml
===================================================================
---
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/wstools-config.xml
(rev 0)
+++
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/wstools-config.xml 2007-05-04
15:08:18 UTC (rev 2962)
@@ -0,0 +1,6 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1597/doclit_in/PhoneBook.wsdl"
+ parameter-style="bare">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on:
branches/dlofthouse/JBWS-1625/jbossws-tests/src/resources/tools/jbws1597/doclit_in/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF