Author: david.boeren
Date: 2008-06-26 17:48:53 -0400 (Thu, 26 Jun 2008)
New Revision: 7745
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbpapp921/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/test-excludes-jboss422.txt
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/Models_ServiceIM_ServiceProxyService.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/ValidationEvent_test.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/test.wsdl
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/wstools-config.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/WSDLToJava.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java
Log:
Fix for JBPAPP-921, this time it doesn't break the tests and contains a new test case
for the fix.
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2008-06-26
16:39:48 UTC (rev 7744)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2008-06-26
21:48:53 UTC (rev 7745)
@@ -309,8 +309,8 @@
if (returnType == null)
returnType = "void";
- buf.append(" public " +
ToolsUtils.convertInvalidCharacters(returnType) + " ");
-
buf.append(ToolsUtils.convertInvalidCharacters(ToolsUtils.firstLetterLowerCase(op.getName().getLocalPart())));
+ buf.append(" public " + returnType + " ");
+ buf.append(ToolsUtils.firstLetterLowerCase(op.getName().getLocalPart()));
buf.append("(").append(paramBuffer);
buf.append(") throws ");
@@ -646,7 +646,7 @@
className = holderWriter.getOrCreateHolder(className,
getLocationForJavaGeneration());
}
- buf.append(ToolsUtils.convertInvalidCharacters(className));
+ buf.append(className);
if (xt instanceof XSComplexTypeDefinition)
generateJavaSource((XSComplexTypeDefinition)xt, xsmodel, containingElement);
@@ -655,16 +655,16 @@
private void createSEIFile(WSDLInterface intf, File loc) throws IOException
{
- String seiName = getServiceEndpointInterfaceName(intf);
+ String seiName =
ToolsUtils.convertInvalidCharacters(getServiceEndpointInterfaceName(intf));
StringBuilder buf = new StringBuilder();
utils.writeJbossHeader(buf);
- buf.append("package " + ToolsUtils.convertInvalidCharacters(seiPkgName) +
";" + newline);
- buf.append("public interface " +
ToolsUtils.convertInvalidCharacters(seiName) + " extends java.rmi.Remote" +
newline + "{" + newline);
+ buf.append("package " + seiPkgName + ";" + newline);
+ buf.append("public interface " + seiName + " extends
java.rmi.Remote" + newline + "{" + newline);
appendMethods(intf, buf);
buf.append("}" + newline);
- File sei = utils.createPhysicalFile(loc,
ToolsUtils.convertInvalidCharacters(seiName));
+ File sei = utils.createPhysicalFile(loc, seiName);
FileWriter writer = new FileWriter(sei);
writer.write(buf.toString());
writer.flush();
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java 2008-06-26
16:39:48 UTC (rev 7744)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java 2008-06-26
21:48:53 UTC (rev 7745)
@@ -215,6 +215,7 @@
if (wsdl.getInterface(new QName(wsdl.getTargetNamespace(), serviceName)) != null)
serviceName = new
StringBuilder(serviceName).insert(serviceName.lastIndexOf("Service"),
'_').toString();
+ serviceName = ToolsUtils.convertInvalidCharacters(serviceName);
serviceName = JavaUtils.capitalize(serviceName);
StringBuilder buf = new StringBuilder();
@@ -240,12 +241,12 @@
writer.close();
}
- public static String convertInvalidCharacters(final String component)
+ public static String removeHyphens(final String component)
{
String result = component;
for (int i = 0; i < result.length(); i++)
{
- if (Character.isJavaIdentifierPart(result.charAt(i)) == false)
+ if (result.charAt(i) == '-')
{
result = result.replace(result.charAt(i), '_');
}
@@ -260,7 +261,7 @@
QName bindName = endpt.getBinding();
WSDLBinding wbind = wsdl.getBinding(bindName);
- buf.append(ToolsUtils.convertInvalidCharacters(getReturnType(wbind))).append("
get");
+ buf.append(removeHyphens(getReturnType(wbind))).append(" get");
buf.append(endpt.getName().getLocalPart()).append("()").append("
throws ServiceException;").append(newLine(1));
return buf.toString();
}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java 2008-06-26
21:48:53 UTC (rev 7745)
@@ -0,0 +1,54 @@
+/*
+ * 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.jbpapp921;
+
+import java.io.File;
+
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+import org.jboss.wsf.test.JBossWSTest;
+
+public class JBPAPP921TestCase extends JBossWSTest
+{
+
+ private static final String resourceDir = "resources/tools/jbpapp921";
+ private static final String toolsDir = "tools/jbpapp921";
+
+ public void testGenerate() throws Exception
+ {
+ String[] args = new String[] { "-dest", toolsDir, "-config",
resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+ compareSource("Models_ServiceIM_ServiceProxyService.java");
+ compareSource("ValidationEvent_test.java");
+ }
+
+ private static void compareSource(final String fileName) throws Exception
+ {
+ File expected = new File(resourceDir + "/" + fileName);
+ File generated = new File(toolsDir + "/org/jboss/test/ws/jbpapp921/" +
fileName);
+
+ JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
+ sc.validate();
+ sc.validateImports();
+ }
+}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/test-excludes-jboss422.txt
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/test-excludes-jboss422.txt
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/test-excludes-jboss422.txt 2008-06-26
21:48:53 UTC (rev 7745)
@@ -0,0 +1,3 @@
+# EJB3/Injection excludes
+org/jboss/test/ws/jaxws/samples/webserviceref/**
+org/jboss/test/ws/jaxws/webserviceref/**
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/Models_ServiceIM_ServiceProxyService.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/Models_ServiceIM_ServiceProxyService.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/Models_ServiceIM_ServiceProxyService.java 2008-06-26
21:48:53 UTC (rev 7745)
@@ -0,0 +1,19 @@
+/*
+* JBoss, the OpenSource EJB server
+* Distributable under LGPL license. See terms of license at
gnu.org.
+*/
+
+//Auto Generated by jbossws - Please do not edit!!!
+
+package org.jboss.test.ws.jbpapp921;
+
+
+import javax.xml.rpc.*;
+
+
+public interface Models_ServiceIM_ServiceProxyService extends javax.xml.rpc.Service
+{
+
+ public org.jboss.test.ws.jbpapp921.ValidationEvent_test getvalidationEventPort()
throws ServiceException;
+
+}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/ValidationEvent_test.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/ValidationEvent_test.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/ValidationEvent_test.java 2008-06-26
21:48:53 UTC (rev 7745)
@@ -0,0 +1,15 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Thu Jun 26 14:46:54 EDT 2008
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+package org.jboss.test.ws.jbpapp921;
+public interface ValidationEvent_test extends java.rmi.Remote
+{
+
+ public int validateClaim(java.lang.String lifecycleId, java.lang.String claim) throws
java.rmi.RemoteException;
+}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/test.wsdl
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/test.wsdl
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/test.wsdl 2008-06-26
21:48:53 UTC (rev 7745)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="models_ServiceIM_ServiceProxy"
+ targetNamespace="http://org.jboss.test.ws.jbpapp921"
+ xmlns:tns="http://org.jboss.test.ws.jbpapp921"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ </types>
+ <message name="ValidationEvent_validateClaim">
+ <part name="lifecycleId" type="xsd:string" />
+ <part name="claim" type="xsd:string" />
+ </message>
+ <message name="ValidationEvent_validateClaimResponse">
+ <part name="result" type="xsd:int" />
+ </message>
+ <portType name="validationEvent-test">
+ <operation name="validateClaim"
+ parameterOrder="lifecycleId claim">
+ <input message="tns:ValidationEvent_validateClaim" />
+ <output message="tns:ValidationEvent_validateClaimResponse" />
+ </operation>
+ </portType>
+ <binding name="validationEventBinding"
+ type="tns:validationEvent-test">
+ <soap:binding style="rpc"
+
transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="validateClaim">
+ <soap:operation soapAction="" />
+ <input>
+ <soap:body use="literal"
+ namespace="http://org.jboss.test.ws.jbpapp921" />
+ </input>
+ <output>
+ <soap:body use="literal"
+ namespace="http://org.jboss.test.ws.jbpapp921" />
+ </output>
+ </operation>
+ </binding>
+ <service name="models_ServiceIM_ServiceProxy">
+ <port name="validationEventPort"
+ binding="tns:validationEventBinding">
+ <soap:address
+ location="http://localhost:8080/BusinessProcessModeling-ejb/BusinessProcessModeling.ServiceIM.ServiceProxyBean"
/>
+ </port>
+ </service>
+</definitions>
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/wstools-config.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/wstools-config.xml
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbpapp921/wstools-config.xml 2008-06-26
21:48:53 UTC (rev 7745)
@@ -0,0 +1,4 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbpapp921/test.wsdl">
+ </wsdl-java>
+</configuration>
\ No newline at end of file