Author: darran.lofthouse(a)jboss.com
Date: 2007-03-13 16:43:54 -0400 (Tue, 13 Mar 2007)
New Revision: 2612
Added:
branches/dlofthouse/JBWS-1464/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1464/
branches/dlofthouse/JBWS-1464/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1464/JBWS1464TestCase.java
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/PhotoAlbum.wsdl
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/wstools-config.xml
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/wrapped/
Log:
Initial test case.
Added:
branches/dlofthouse/JBWS-1464/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1464/JBWS1464TestCase.java
===================================================================
---
branches/dlofthouse/JBWS-1464/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1464/JBWS1464TestCase.java
(rev 0)
+++
branches/dlofthouse/JBWS-1464/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1464/JBWS1464TestCase.java 2007-03-13
20:43:54 UTC (rev 2612)
@@ -0,0 +1,110 @@
+/*
+ * 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.jbws1464;
+
+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 6 Mar 2007
+ */
+public class JBWS1464TestCase extends JBossWSTest
+{
+
+ /**
+ * Test generation with parameter-style set to 'bare'.
+ *
+ * @throws Exception
+ */
+ public void testGenerateBare() throws Exception
+ {
+ generateScenario("bare");
+ }
+
+ protected void generateScenario(final String scenario) throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1464/" + scenario;
+ String toolsDir = "tools/jbws1464/" + scenario;
+ String[] args = new String[] { "-dest", toolsDir, "-config",
resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ if (true)
+ return;
+
+ 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/jbws1464/" + currentFile);
+ }
+ catch (Exception e)
+ {
+ throw new Exception("Validation of '" + currentFile +
"' failed.", e);
+ }
+ }
+
+ File packageDir = new File(toolsDir + "/org/jboss/test/ws/jbws1464");
+ 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-1464/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1464/JBWS1464TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/PhotoAlbum.wsdl
===================================================================
---
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/PhotoAlbum.wsdl
(rev 0)
+++
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/PhotoAlbum.wsdl 2007-03-13
20:43:54 UTC (rev 2612)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhotoAlbum'
+
targetNamespace='http://test.jboss.org/ws/jbws1464'
+
xmlns='http://schemas.xmlsoap.org/wsdl/'
+
xmlns:ns1='http://test.jboss.org/ws/jbws1464/types'
+
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+
xmlns:tns='http://test.jboss.org/ws/jbws1464'
+
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema
targetNamespace='http://test.jboss.org/ws/jbws1464/types'
+
xmlns='http://www.w3.org/2001/XMLSchema'
+
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
+
xmlns:tns='http://test.jboss.org/ws/jbws1464/types'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xmlns:xmime='http://www.w3.org/2005/05/xmlmime'>
+
+ <import
schemaLocation="http://www.w3.org/2005/05/xmlmime"
namespace="http://www.w3.org/2005/05/xmlmime"/>
+
+ <complexType name='Photo'>
+ <sequence>
+ <element name='caption' nillable='true'
type='string'/>
+ <element name='image' xmime:contentType='text/xml'
type='xmime:base64Binary'/>
+ </sequence>
+ </complexType>
+ <element name='publishPhoto' type='tns:Photo'/>
+ <element name='publishPhotoResponse' type='int'/>
+ </schema>
+ </types>
+ <message name='AlbumEndpoint_publishPhoto'>
+ <part element='ns1:publishPhoto' name='publishPhoto'/>
+ </message>
+ <message name='AlbumEndpoint_publishPhotoResponse'>
+ <part element='ns1:publishPhotoResponse'
name='publishPhotoResponse'/>
+ </message>
+ <portType name='AlbumEndpoint'>
+ <operation name='publishPhoto' parameterOrder='publishPhoto'>
+ <input message='tns:AlbumEndpoint_publishPhoto'/>
+ <output message='tns:AlbumEndpoint_publishPhotoResponse'/>
+ </operation>
+ </portType>
+ <binding name='AlbumEndpointBinding' type='tns:AlbumEndpoint'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='publishPhoto'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhotoAlbum'>
+ <port binding='tns:AlbumEndpointBinding'
name='AlbumEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/PhotoAlbum.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/wstools-config.xml
===================================================================
---
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/wstools-config.xml
(rev 0)
+++
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/wstools-config.xml 2007-03-13
20:43:54 UTC (rev 2612)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1464/bare/PhotoAlbum.wsdl"
parameter-style="bare">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on:
branches/dlofthouse/JBWS-1464/jbossws-tests/src/resources/tools/jbws1464/bare/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF