Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 93765 invoked from network); 24 Dec 2005 03:36:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Dec 2005 03:36:13 -0000 Received: (qmail 19238 invoked by uid 500); 24 Dec 2005 03:36:12 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 19215 invoked by uid 500); 24 Dec 2005 03:36:12 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 19204 invoked by uid 500); 24 Dec 2005 03:36:12 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 19201 invoked by uid 99); 24 Dec 2005 03:36:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2005 19:36:12 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 23 Dec 2005 19:36:11 -0800 Received: (qmail 93696 invoked by uid 65534); 24 Dec 2005 03:35:51 -0000 Message-ID: <20051224033550.93695.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r358916 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl: codegen/emitter/MultiLanguageClientEmitter.java template/java/TestClassTemplate.xsl Date: Sat, 24 Dec 2005 03:35:50 -0000 To: axis2-cvs@ws.apache.org From: dims@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: dims Date: Fri Dec 23 19:35:46 2005 New Revision: 358916 URL: http://svn.apache.org/viewcvs?rev=358916&view=rev Log: Trying to get a clean test case automatically generated using the following command line java org.apache.axis2.wsdl.WSDL2Java -d adb -o work -s -p samples.perf -t -ss -sd -uri \APACHE\axis2\modules\samples\wsdl\perf.wsdl TODO: - Need to find a better spot for the getParamInitializer method. Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=358916&r1=358915&r2=358916&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java Fri Dec 23 19:35:46 2005 @@ -618,6 +618,8 @@ addAttribute(doc, "default", "yes", param); } + addAttribute(doc, "value", getParamInitializer(typeMapping), param); + //add this as a body parameter addAttribute(doc, "location", "body", param); Iterator iter = inputMessage.getExtensibilityAttributes().iterator(); @@ -1334,6 +1336,49 @@ } } + /** Field constructorMap */ + private static HashMap constructorMap = new HashMap(50); + static { + + // Type maps to a valid initialization value for that type + // Type var = new Type(arg) + // Where "Type" is the key and "new Type(arg)" is the string stored + // Used in emitting test cases and server skeletons. + constructorMap.put("int", "0"); + constructorMap.put("float", "0"); + constructorMap.put("boolean", "true"); + constructorMap.put("double", "0"); + constructorMap.put("byte", "(byte)0"); + constructorMap.put("short", "(short)0"); + constructorMap.put("long", "0"); + constructorMap.put("java.lang.Boolean", "new java.lang.Boolean(false)"); + constructorMap.put("java.lang.Byte", "new java.lang.Byte((byte)0)"); + constructorMap.put("java.lang.Double", "new java.lang.Double(0)"); + constructorMap.put("java.lang.Float", "new java.lang.Float(0)"); + constructorMap.put("java.lang.Integer", "new java.lang.Integer(0)"); + constructorMap.put("java.lang.Long", "new java.lang.Long(0)"); + constructorMap.put("java.lang.Short", "new java.lang.Short((short)0)"); + constructorMap.put("java.math.BigDecimal", + "new java.math.BigDecimal(0)"); + constructorMap.put("java.math.BigInteger", + "new java.math.BigInteger(\"0\")"); + constructorMap.put("java.lang.Object", "new java.lang.String()"); + constructorMap.put("byte[]", "new byte[0]"); + constructorMap.put("java.util.Calendar", + "java.util.Calendar.getInstance()"); + constructorMap.put( + "javax.xml.namespace.QName", + "new javax.xml.namespace.QName(\"http://double-double\", \"toil-and-trouble\")"); + } + + String getParamInitializer(String paramType) { + // Look up paramType in the table + String out = (String) constructorMap.get(paramType); + if(out == null) { + out = "null"; + } + return out; + } } Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl?rev=358916&r1=358915&r2=358916&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl Fri Dec 23 19:35:46 2005 @@ -17,23 +17,6 @@ */ package ; - import java.io.InputStream; - import java.net.ServerSocket; - - import javax.xml.namespace.QName; - - import org.apache.axis2.context.ConfigurationContext; - import org.apache.axis2.deployment.DeploymentEngine; - import org.apache.axis2.description.AxisService; - import org.apache.axis2.engine.AxisConfiguration; - import org.apache.axis2.wsdl.codegen.Constants; - import org.apache.axis2.om.OMAbstractFactory; - import org.apache.axis2.om.OMElement; - import org.apache.axis2.om.OMFactory; - import org.apache.axis2.om.impl.llom.OMTextImpl; - import org.apache.axis2.transport.http.SimpleHTTPServer; - - /* * Junit test case */ @@ -52,27 +35,27 @@ . stub = new .();//the default implementation should point to the right endpoint - //create a new databinder - . - databindSupporter = new (); - + + = ; + + //There is no output to be tested! stub.( - ,()databindSupporter.getTestObject(.class) + , ); assertNotNull(stub.( - ,()databindSupporter.getTestObject(.class) + , ));