Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 26686 invoked from network); 11 Jul 2006 19:35:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jul 2006 19:35:08 -0000 Received: (qmail 16415 invoked by uid 500); 11 Jul 2006 19:34:59 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 16310 invoked by uid 500); 11 Jul 2006 19:34:59 -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 16121 invoked by uid 500); 11 Jul 2006 19:34:58 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 16103 invoked by uid 99); 11 Jul 2006 19:34:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 12:34:58 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 12:34:53 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 820671A9827; Tue, 11 Jul 2006 12:34:06 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r420955 [6/8] - in /webservices/axis2/trunk/java/modules/jaxws: ./ src/javax/jws/ src/javax/xml/ws/handler/ src/org/apache/axis2/jaxws/ src/org/apache/axis2/jaxws/binding/ src/org/apache/axis2/jaxws/client/ src/org/apache/axis2/jaxws/core/ ... Date: Tue, 11 Jul 2006 19:33:22 -0000 To: axis2-cvs@ws.apache.org From: scheu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060711193406.820671A9827@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/WSDLTests.wsdl URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/WSDLTests.wsdl?rev=420955&view=auto ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/WSDLTests.wsdl (added) +++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/WSDLTests.wsdl Tue Jul 11 12:33:12 2006 @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: webservices/axis2/trunk/java/modules/jaxws/test/client/EchoString.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/client/EchoString.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/client/EchoString.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/client/EchoString.java Tue Jul 11 12:33:12 2006 @@ -1,73 +1,73 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2006.06.04 at 11:10:38 PM CDT -// - - -package client; - -import javax.xml.bind.annotation.AccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for echoString element declaration. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <element name="echoString">
- *   <complexType>
- *     <complexContent>
- *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *         <sequence>
- *           <element name="input" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         </sequence>
- *       </restriction>
- *     </complexContent>
- *   </complexType>
- * </element>
- * 
- * - * - */ -@XmlAccessorType(AccessType.FIELD) -@XmlType(name = "", propOrder = { - "input" -}) -@XmlRootElement(name = "echoString") -public class EchoString { - - @XmlElement(namespace = "http://test") - protected String input; - - /** - * Gets the value of the input property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getInput() { - return input; - } - - /** - * Sets the value of the input property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setInput(String value) { - this.input = value; - } - -} +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2006.06.04 at 11:10:38 PM CDT +// + + +package client; + +import javax.xml.bind.annotation.AccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for echoString element declaration. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <element name="echoString">
+ *   <complexType>
+ *     <complexContent>
+ *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *         <sequence>
+ *           <element name="input" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         </sequence>
+ *       </restriction>
+ *     </complexContent>
+ *   </complexType>
+ * </element>
+ * 
+ * + * + */ +@XmlAccessorType(AccessType.FIELD) +@XmlType(name = "", propOrder = { + "input" +}) +@XmlRootElement(name = "echoString") +public class EchoString { + + @XmlElement(namespace = "http://test") + protected String input; + + /** + * Gets the value of the input property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getInput() { + return input; + } + + /** + * Sets the value of the input property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInput(String value) { + this.input = value; + } + +} Modified: webservices/axis2/trunk/java/modules/jaxws/test/client/EchoStringResponse.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/client/EchoStringResponse.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/client/EchoStringResponse.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/client/EchoStringResponse.java Tue Jul 11 12:33:12 2006 @@ -1,73 +1,73 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2006.06.04 at 11:10:38 PM CDT -// - - -package client; - -import javax.xml.bind.annotation.AccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for echoStringResponse element declaration. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <element name="echoStringResponse">
- *   <complexType>
- *     <complexContent>
- *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *         <sequence>
- *           <element name="echoStringReturn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         </sequence>
- *       </restriction>
- *     </complexContent>
- *   </complexType>
- * </element>
- * 
- * - * - */ -@XmlAccessorType(AccessType.FIELD) -@XmlType(name = "", propOrder = { - "echoStringReturn" -}) -@XmlRootElement(name = "echoStringResponse") -public class EchoStringResponse { - - @XmlElement(namespace = "http://test") - protected String echoStringReturn; - - /** - * Gets the value of the echoStringReturn property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEchoStringReturn() { - return echoStringReturn; - } - - /** - * Sets the value of the echoStringReturn property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEchoStringReturn(String value) { - this.echoStringReturn = value; - } - -} +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2006.06.04 at 11:10:38 PM CDT +// + + +package client; + +import javax.xml.bind.annotation.AccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for echoStringResponse element declaration. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <element name="echoStringResponse">
+ *   <complexType>
+ *     <complexContent>
+ *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *         <sequence>
+ *           <element name="echoStringReturn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         </sequence>
+ *       </restriction>
+ *     </complexContent>
+ *   </complexType>
+ * </element>
+ * 
+ * + * + */ +@XmlAccessorType(AccessType.FIELD) +@XmlType(name = "", propOrder = { + "echoStringReturn" +}) +@XmlRootElement(name = "echoStringResponse") +public class EchoStringResponse { + + @XmlElement(namespace = "http://test") + protected String echoStringReturn; + + /** + * Gets the value of the echoStringReturn property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEchoStringReturn() { + return echoStringReturn; + } + + /** + * Sets the value of the echoStringReturn property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEchoStringReturn(String value) { + this.echoStringReturn = value; + } + +} Modified: webservices/axis2/trunk/java/modules/jaxws/test/client/ObjectFactory.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/client/ObjectFactory.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/client/ObjectFactory.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/client/ObjectFactory.java Tue Jul 11 12:33:12 2006 @@ -1,57 +1,57 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2006.06.04 at 11:10:38 PM CDT -// - - -package client; - -import javax.xml.bind.annotation.XmlRegistry; - -import client.EchoStringResponse; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the test package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: test - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link EchoStringResponse } - * - */ - public EchoStringResponse createEchoStringResponse() { - return new EchoStringResponse(); - } - - /** - * Create an instance of {@link EchoString } - * - */ - public EchoString createEchoString() { - return new EchoString(); - } - -} +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2006.06.04 at 11:10:38 PM CDT +// + + +package client; + +import javax.xml.bind.annotation.XmlRegistry; + +import client.EchoStringResponse; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the test package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: test + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link EchoStringResponse } + * + */ + public EchoStringResponse createEchoStringResponse() { + return new EchoStringResponse(); + } + + /** + * Create an instance of {@link EchoString } + * + */ + public EchoString createEchoString() { + return new EchoString(); + } + +} Modified: webservices/axis2/trunk/java/modules/jaxws/test/client/package-info.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/client/package-info.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/client/package-info.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/client/package-info.java Tue Jul 11 12:33:12 2006 @@ -1,9 +1,9 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2006.06.04 at 11:10:38 PM CDT -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://test") -package client; +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b26-ea3 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2006.06.04 at 11:10:38 PM CDT +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://test") +package client; Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/META-INF/services.xml URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/META-INF/services.xml?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/META-INF/services.xml (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/META-INF/services.xml Tue Jul 11 12:33:12 2006 @@ -1,12 +1,12 @@ - - - - - - server.EchoServiceSkeleton - - - - - - + + + + + + server.EchoServiceSkeleton + + + + + + Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/CallbackHandler.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/CallbackHandler.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/CallbackHandler.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/CallbackHandler.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws; import java.io.StringWriter; Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DOMSourceDispatch.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DOMSourceDispatch.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DOMSourceDispatch.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DOMSourceDispatch.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws; import java.io.ByteArrayInputStream; @@ -38,7 +54,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -75,7 +91,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.MESSAGE); ByteArrayInputStream stream = new ByteArrayInputStream(soapMessage.getBytes()); @@ -107,7 +123,7 @@ System.out.println("---------------------------------------"); CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.MESSAGE); ByteArrayInputStream stream = new ByteArrayInputStream(soapMessage @@ -141,7 +157,7 @@ System.out.println("---------------------------------------"); URL wsdlUrl = new URL(endpointUrl + "?wsdl"); Service svc = Service.create(wsdlUrl,serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.PAYLOAD); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -174,7 +190,7 @@ System.out.println("---------------------------------------"); CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -206,7 +222,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestConstants.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestConstants.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestConstants.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestConstants.java Tue Jul 11 12:33:12 2006 @@ -1,10 +1,26 @@ -package org.apache.axis2.jaxws; - -import javax.xml.namespace.QName; - -public class DispatchTestConstants { - - public static String URL = "http://localhost:8080/axis2/services/EchoService"; - public static QName QNAME_SERVICE = new QName("http://ws.apache.org/axis2", "EchoService"); - public static QName QNAME_PORT = new QName("http://ws.apache.org/axis2", "EchoServiceSOAP11port0"); -} +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.axis2.jaxws; + +import javax.xml.namespace.QName; + +public class DispatchTestConstants { + + public static String URL = "http://localhost:8080/axis2/services/EchoService"; + public static QName QNAME_SERVICE = new QName("http://ws.apache.org/axis2", "EchoService"); + public static QName QNAME_PORT = new QName("http://ws.apache.org/axis2", "EchoServiceSOAP11port0"); +} Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestSuite.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestSuite.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestSuite.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/DispatchTestSuite.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws; import junit.framework.TestSuite; Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBCallbackHandler.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBCallbackHandler.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBCallbackHandler.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBCallbackHandler.java Tue Jul 11 12:33:12 2006 @@ -1,18 +1,34 @@ -package org.apache.axis2.jaxws; - -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.Response; - -import client.EchoStringResponse; - -public class JAXBCallbackHandler implements AsyncHandler { - - public void handleResponse(Response response) { - try { - EchoStringResponse esr = (EchoStringResponse) response.get(); - System.out.println(">> Async response received: " + esr.getEchoStringReturn()); - } catch (Exception e) { - e.printStackTrace(); - } - } -} +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.axis2.jaxws; + +import javax.xml.ws.AsyncHandler; +import javax.xml.ws.Response; + +import client.EchoStringResponse; + +public class JAXBCallbackHandler implements AsyncHandler { + + public void handleResponse(Response response) { + try { + EchoStringResponse esr = (EchoStringResponse) response.get(); + System.out.println(">> Async response received: " + esr.getEchoStringReturn()); + } catch (Exception e) { + e.printStackTrace(); + } + } +} Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBDispatch.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBDispatch.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBDispatch.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/JAXBDispatch.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws; import java.util.concurrent.Future; Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SAXSourceDispatch.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SAXSourceDispatch.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SAXSourceDispatch.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SAXSourceDispatch.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws; import java.io.ByteArrayInputStream; @@ -31,7 +47,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -62,7 +78,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.MESSAGE); ByteArrayInputStream stream = new ByteArrayInputStream(soapMessage.getBytes()); @@ -94,7 +110,7 @@ System.out.println("---------------------------------------"); CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.MESSAGE); ByteArrayInputStream stream = new ByteArrayInputStream(soapMessage @@ -126,7 +142,7 @@ System.out.println("---------------------------------------"); URL wsdlUrl = new URL(endpointUrl + "?wsdl"); Service svc = Service.create(wsdlUrl,serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.PAYLOAD); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -161,7 +177,7 @@ System.out.println("---------------------------------------"); CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -189,7 +205,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SourceDispatch.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SourceDispatch.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SourceDispatch.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SourceDispatch.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws; import java.io.ByteArrayInputStream; @@ -31,7 +47,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -66,7 +82,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.MESSAGE); @@ -97,7 +113,7 @@ System.out.println("---------------------------------------"); CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.MESSAGE); ByteArrayInputStream stream = new ByteArrayInputStream(soapMessage @@ -128,7 +144,7 @@ System.out.println("---------------------------------------"); URL wsdlUrl = new URL(endpointUrl + "?wsdl"); Service svc = Service.create(wsdlUrl,serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, Mode.PAYLOAD); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -163,7 +179,7 @@ System.out.println("---------------------------------------"); CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString @@ -193,7 +209,7 @@ try { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc.createDispatch(portQname, Source.class, null); ByteArrayInputStream stream = new ByteArrayInputStream(xmlString Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StringDispatch.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StringDispatch.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StringDispatch.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StringDispatch.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws; import java.util.Map; @@ -31,7 +47,7 @@ public void testSync() { System.out.println("---------------------------------------"); Service svc = Service.create(serviceQname); - svc.addPort(portQname,null,null); + svc.addPort(portQname,null,endpointUrl); try{ Dispatch dispatch = svc .createDispatch(portQname, String.class, null); @@ -136,7 +152,7 @@ try{ CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc .createDispatch(portQname, String.class, null); Map requestContext = dispatch.getRequestContext(); @@ -167,7 +183,7 @@ try{ CallbackHandler callbackHandler = new CallbackHandler(); Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc .createDispatch(portQname, String.class, Mode.MESSAGE); Map requestContext = dispatch.getRequestContext(); @@ -197,7 +213,7 @@ System.out.println("---------------------------------------"); try{ Service svc = Service.create(serviceQname); - svc.addPort(portQname, null, null); + svc.addPort(portQname, null, endpointUrl); Dispatch dispatch = svc .createDispatch(portQname, String.class, null); Map requestContext = dispatch.getRequestContext(); Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ServiceDescriptionTests.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ServiceDescriptionTests.java?rev=420955&view=auto ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ServiceDescriptionTests.java (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ServiceDescriptionTests.java Tue Jul 11 12:33:12 2006 @@ -0,0 +1,91 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.axis2.jaxws.description; + +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.WebServiceException; + +import junit.framework.TestCase; + +/** + * This test validates the error checking and internal functioning of the + * ServiceDescription class. These tests are the construction of a + * a ServiceDescription. Direct tests of the functionality of a ServiceDescription + * and other Description classes is done in WSDLDescriptionTests. + */ +public class ServiceDescriptionTests extends TestCase { + private static final String namespaceURI= "http://ws.apache.org/axis2/tests"; + private static final String localPart = "EchoService"; + private static final QName serviceQName = new QName(namespaceURI, localPart); + + public void testNullWSDL() { + + ServiceDescription serviceDescription = new ServiceDescription(null, serviceQName, javax.xml.ws.Service.class); + assertNotNull("Service description not created with null WSDL", serviceDescription); + } + + public void testNullServiceName() { + + try { + ServiceDescription serviceDescription = new ServiceDescription(null, null, javax.xml.ws.Service.class); + fail("Exception for null Service Name not thrown."); + } + catch (WebServiceException e) { + // Expected path + assertEquals("Did not receive correct exception", "Invalid Service QName; cannot be null", e.getMessage()); + } + } + + public void testInvalidServiceClass() { + try { + ServiceDescription serviceDescription = new ServiceDescription(null, serviceQName, Object.class); + fail("Exception for invalid Service class not thrown."); + } + catch (WebServiceException e) { + // Expected path + assertEquals("Did not receive correct exception", "Invalid Service Class; must be assignable to javax.xml.ws.Service", e.getMessage()); + } + } + + public void testNullServiceClass() { + try { + ServiceDescription serviceDescription = new ServiceDescription(null, serviceQName, null); + fail("Exception for invalid Service class not thrown."); + } + catch (WebServiceException e) { + // Expected path + assertEquals("Did not receive correct exception", "Invalid Service Class; cannot be null", e.getMessage()); + } + + } + + public void testValidServiceSubclass() { + ServiceDescription serviceDescription = new ServiceDescription(null, serviceQName, ServiceSubclass.class); + assertNotNull("Service description not created with valid Service subclass", serviceDescription); + } +} + +class ServiceSubclass extends javax.xml.ws.Service { + + protected ServiceSubclass(URL wsdlDocumentLocation, QName serviceName) { + super(wsdlDocumentLocation, serviceName); + } +} Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLDescriptionTests.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLDescriptionTests.java?rev=420955&view=auto ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLDescriptionTests.java (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLDescriptionTests.java Tue Jul 11 12:33:12 2006 @@ -0,0 +1,116 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.axis2.jaxws.description; + +import java.lang.reflect.Field; +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.Service; + +import org.apache.axis2.jaxws.spi.ServiceDelegate; + +import junit.framework.TestCase; + +/** + * Directly test the Description classes built with a WSDL file. + */ +public class WSDLDescriptionTests extends TestCase { + + private static boolean setupDone = false; + private static Service service; + private static ServiceDelegate serviceDelegate; + private static ServiceDescription serviceDescription; + + + + protected void setUp() { + if (!setupDone) { + setupDone = true; + String namespaceURI= "http://ws.apache.org/axis2/tests"; + String localPart = "EchoService"; + service = Service.create(getWSDLURL(), new QName(namespaceURI, localPart)); + serviceDelegate = getServiceDelegate(service); + serviceDescription = serviceDelegate.getServiceDescription(); + } + } + + /* + * ======================================================================== + * ServiceDescription Tests + * ======================================================================== + */ + public void testValidServiceGetEndpoint() { + QName validPortQname = new QName("http://ws.apache.org/axis2/tests", "EchoPort"); + EndpointDescription endpointDescription = serviceDescription.getEndpointDescription(validPortQname); + assertNotNull("EndpointDescription should be found", endpointDescription); + } + + public void testInvalidLocalpartServiceGetEndpoint() { + QName validPortQname = new QName("http://ws.apache.org/axis2/tests", "InvalidEchoPort"); + EndpointDescription endpointDescription = serviceDescription.getEndpointDescription(validPortQname); + assertNull("EndpointDescription should not be found", endpointDescription); + } + + public void testInvalidNamespaceServiceGetEndpoint() { + QName validPortQname = new QName("http://ws.apache.org/axis2/tests/INVALID", "EchoPort"); + EndpointDescription endpointDescription = serviceDescription.getEndpointDescription(validPortQname); + assertNull("EndpointDescription should not be found", endpointDescription); + } + + /* + * ======================================================================== + * Test utility methods + * ======================================================================== + */ + + private URL getWSDLURL() { + URL wsdlURL = null; + // Get the URL to the WSDL file. Note that 'basedir' is setup by Maven + String basedir = System.getProperty("basedir"); + String urlString = "file://localhost/" + basedir + "/test-resources/wsdl/WSDLTests.wsdl"; + try { + wsdlURL = new URL(urlString); + } catch (Exception e) { + fail("Caught exception creating WSDL URL :" + urlString + "; exception: " + e.toString()); + } + return wsdlURL; + } + + private ServiceDelegate getServiceDelegate(Service service) { + // Need to get to the private Service._delegate field in order to get to the ServiceDescription to test + ServiceDelegate returnServiceDelegate = null; + try { + Field serviceDelgateField = service.getClass().getDeclaredField("_delegate"); + serviceDelgateField.setAccessible(true); + returnServiceDelegate = (ServiceDelegate) serviceDelgateField.get(service); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchFieldException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return returnServiceDelegate; + } + +} Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLTests.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLTests.java?rev=420955&view=auto ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLTests.java (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/WSDLTests.java Tue Jul 11 12:33:12 2006 @@ -0,0 +1,130 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.axis2.jaxws.description; + +import java.lang.reflect.Field; +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebServiceException; + +import org.apache.axis2.description.AxisService; +import org.apache.axis2.jaxws.spi.ServiceDelegate; + +import junit.framework.TestCase; + +/** + * Tests building a ServiceDescription using WSDL and the JAXWS Service API. + * Note that a ServiceDescription is built when a javax.xml.ws.Service is created. Since that is the actual API + * that should be used, this test will create Service objects and then use introspection + * to check the underlying ServiceDelegate which contains the ServiceDescription. + */ +public class WSDLTests extends TestCase { + + public void testValidWSDLService() { + Service service = null; + ServiceDelegate serviceDelegate = null; + + String namespaceURI= "http://ws.apache.org/axis2/tests"; + String localPart = "EchoService"; + service = Service.create(getWSDLURL(), new QName(namespaceURI, localPart)); + assertNotNull("Service not created", service); + + serviceDelegate = getServiceDelegate(service); + assertNotNull("ServiceDelegate not created", serviceDelegate); + + ServiceDescription serviceDescription = serviceDelegate.getServiceDescription(); + assertNotNull("ServiceDescription not created", serviceDescription); + + AxisService axisService = serviceDescription.getAxisService(); + assertNotNull("AxisService not created", axisService); + } + + public void testInvalidServiceLocalName() { + Service service = null; + + String namespaceURI= "http://ws.apache.org/axis2/tests"; + String localPart = "BADEchoService"; + try { + service = Service.create(getWSDLURL(), new QName(namespaceURI, localPart)); + fail("Exception should have been thrown for invalid Service name"); + } + catch (WebServiceException e) { + // This is the expected flow; it is really more a test of ServiceDelegate that ServiceDescription + } + } + + public void testNullWSDLLocation() { + Service service = null; + + String namespaceURI= "http://ws.apache.org/axis2/tests"; + String localPart = "EchoService"; + service = Service.create(new QName(namespaceURI, localPart)); + assertNotNull("Service not created", service); + + } + + public void testNullServiceName() { + Service service = null; + + try { + service = Service.create(null); + fail("Exception should have been thrown for null Service name"); + } + catch (WebServiceException e) { + // This is the expected flow; it is really more a test of ServiceDelegate that ServiceDescription + // but we are verifying expected behavior. + } + + } + + private URL getWSDLURL() { + URL wsdlURL = null; + // Get the URL to the WSDL file. Note that 'basedir' is setup by Maven + String basedir = System.getProperty("basedir"); + String urlString = "file://localhost/" + basedir + "/test-resources/wsdl/WSDLTests.wsdl"; + try { + wsdlURL = new URL(urlString); + } catch (Exception e) { + fail("Caught exception creating WSDL URL :" + urlString + "; exception: " + e.toString()); + } + return wsdlURL; + } + + private ServiceDelegate getServiceDelegate(Service service) { + // Need to get to the private Service._delegate field in order to get to the ServiceDescription to test + ServiceDelegate returnServiceDelegate = null; + try { + Field serviceDelgateField = service.getClass().getDeclaredField("_delegate"); + serviceDelgateField.setAccessible(true); + returnServiceDelegate = (ServiceDelegate) serviceDelgateField.get(service); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchFieldException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return returnServiceDelegate; + } +} Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Tue Jul 11 12:33:12 2006 @@ -1,12 +1,37 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws.framework; -import org.apache.axis2.jaxws.DispatchTestSuite; - import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.apache.axis2.jaxws.DispatchTestSuite; +import org.apache.axis2.jaxws.description.ServiceDescriptionTests; +import org.apache.axis2.jaxws.description.WSDLDescriptionTests; +import org.apache.axis2.jaxws.description.WSDLTests; +import org.apache.axis2.jaxws.handler.HandlerChainProcessorTests; +import org.apache.axis2.jaxws.message.BlockTests; +import org.apache.axis2.jaxws.message.MessageTests; +import org.apache.axis2.jaxws.message.SAAJConverterTests; +import org.apache.axis2.jaxws.message.XMLStreamReaderSplitterTests; +import org.apache.axis2.jaxws.provider.*; + public class JAXWSTest extends TestCase { /** * suite @@ -18,8 +43,20 @@ // Add each of the test suites suite = DispatchTestSuite.addTestSuites(suite); - // Add individual test classes - // TODO: suite.addTestSuite(SimpleProvider.class); + + suite.addTestSuite(BlockTests.class); + suite.addTestSuite(MessageTests.class); + suite.addTestSuite(SAAJConverterTests.class); + suite.addTestSuite(XMLStreamReaderSplitterTests.class); + + suite.addTestSuite(WSDLTests.class); + suite.addTestSuite(ServiceDescriptionTests.class); + suite.addTestSuite(WSDLDescriptionTests.class); + + suite.addTestSuite(HandlerChainProcessorTests.class); + + suite.addTestSuite(StringProviderTests.class); + suite.addTestSuite(SourceProviderTests.class); // Start (and stop) the server only once for all the tests TestSetup testSetup = new TestSetup(suite) { Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StartServer.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StartServer.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StartServer.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StartServer.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws.framework; import org.apache.axis2.jaxws.util.SimpleServer; Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StopServer.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StopServer.java?rev=420955&r1=420954&r2=420955&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StopServer.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/StopServer.java Tue Jul 11 12:33:12 2006 @@ -1,3 +1,19 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.axis2.jaxws.framework; import org.apache.axis2.jaxws.util.SimpleServer; --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org