Author: darran.lofthouse(a)jboss.com
Date: 2007-01-12 18:12:59 -0500 (Fri, 12 Jan 2007)
New Revision: 1952
Added:
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1452/
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1452/JBWS1452TestCase.java
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/TestEndpoint.wsdl
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/wstools-config.xml
Log:
JBWS-1452 - First test case.
Added:
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1452/JBWS1452TestCase.java
===================================================================
---
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1452/JBWS1452TestCase.java 2007-01-12
23:12:01 UTC (rev 1951)
+++
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1452/JBWS1452TestCase.java 2007-01-12
23:12:59 UTC (rev 1952)
@@ -0,0 +1,88 @@
+/*
+ * 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.jbws1452;
+
+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 12 Jan 2007
+ */
+public class JBWS1452TestCase extends JBossWSTest
+{
+
+ public void testScenario_A() throws Exception
+ {
+ generateScenario("A");
+ }
+
+ protected void generateScenario(final String scenario) throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1452/scenario_" + scenario;
+ String toolsDir = "tools/jbws1452/scenario_" + 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/jbws1452/" + currentFile);
+ }
+ catch (Exception e)
+ {
+ throw new Exception("Validation of '" + currentFile +
"' failed.", e);
+ }
+ }
+
+ //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-1452/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1452/JBWS1452TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/TestEndpoint.wsdl
===================================================================
---
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/TestEndpoint.wsdl 2007-01-12
23:12:01 UTC (rev 1951)
+++
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/TestEndpoint.wsdl 2007-01-12
23:12:59 UTC (rev 1952)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestEndpoint'
targetNamespace='http://test.jboss.org/ws/jbws1452'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:ns1='http://test.jboss.org/ws/jbws1452/types'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://test.jboss.org/ws/jbws1452'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema
targetNamespace='http://test.jboss.org/ws/jbws1452/types'
xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:tns='http://test.jboss.org/ws/jbws1452/types'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='testMethod'>
+ <sequence>
+ <element name='request' nillable='true'
type='tns:RequestStringArray'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='RequestStringArray'>
+ <sequence>
+ <element name='TheStrings' type='string'
maxOccurs='unbounded'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='testMethodResponse'>
+ <sequence>
+ <element name='result' nillable='true'
type='tns:ResponseStringArray'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='ResponseStringArray'>
+ <sequence>
+ <element name='TheStrings' type='string'
maxOccurs='unbounded'/>
+ </sequence>
+ </complexType>
+
+ <element name='testMethod' type='tns:testMethod'/>
+ <element name='testMethodResponse'
type='tns:testMethodResponse'/>
+ </schema>
+ </types>
+ <message name='TestEndpoint_testMethod'>
+ <part element='ns1:testMethod' name='testMethod'/>
+ </message>
+ <message name='TestEndpoint_testMethodResponse'>
+ <part element='ns1:testMethodResponse'
name='testMethodResponse'/>
+ </message>
+ <portType name='TestEndpoint'>
+ <operation name='testMethod' parameterOrder='testMethod'>
+ <input message='tns:TestEndpoint_testMethod'/>
+ <output message='tns:TestEndpoint_testMethodResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='testMethod'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestEndpoint'>
+ <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/TestEndpoint.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/wstools-config.xml
===================================================================
---
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/wstools-config.xml 2007-01-12
23:12:01 UTC (rev 1951)
+++
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/wstools-config.xml 2007-01-12
23:12:59 UTC (rev 1952)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java
location="resources/tools/jbws1452/scenario_A/TestEndpoint.wsdl"
parameter-style="wrapped">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on:
branches/dlofthouse/JBWS-1452/jbossws-tests/src/main/resources/tools/jbws1452/scenario_A/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF