Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 59839 invoked from network); 26 Oct 2006 09:40:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 09:40:23 -0000 Received: (qmail 67807 invoked by uid 500); 26 Oct 2006 07:53:55 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 67744 invoked by uid 500); 26 Oct 2006 07:53:55 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 67734 invoked by uid 99); 26 Oct 2006 07:53:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 00:53:55 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 00:53:43 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EB6D91A9846; Thu, 26 Oct 2006 00:53:21 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r467902 - in /incubator/cxf/trunk: systests/src/test/java/org/apache/cxf/systest/jaxws/ testutils/src/main/java/org/apache/cxf/anonymous_complex_type/ testutils/src/main/resources/wsdl/ Date: Thu, 26 Oct 2006 07:53:21 -0000 To: cxf-commits@incubator.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061026075321.EB6D91A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ffang Date: Thu Oct 26 00:53:20 2006 New Revision: 467902 URL: http://svn.apache.org/viewvc?view=rev&rev=467902 Log: [CXF-176] add test for anonymous ref in wsdl schema defination Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?view=diff&rev=467902&r1=467901&r2=467902 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java Thu Oct 26 00:53:20 2006 @@ -30,6 +30,8 @@ import org.apache.cxf.anonymous_complex_type.AnonymousComplexType; import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeImpl; import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeService; +import org.apache.cxf.anonymous_complex_type.SplitName; +import org.apache.cxf.anonymous_complex_type.SplitNameResponse; import org.apache.cxf.anonymous_complex_type.SplitNameResponse.Names; import org.apache.cxf.systest.common.ClientServerSetupBase; import org.apache.cxf.systest.common.ClientServerTestBase; @@ -86,4 +88,21 @@ } } + public void testRefAnonymousComplexType() throws Exception { + + AnonymousComplexTypeService actService = new AnonymousComplexTypeService(); + assertNotNull(actService); + AnonymousComplexType act = actService.getPort(portName, AnonymousComplexType.class); + + try { + SplitName name = new SplitName(); + name.setName("Tom Li"); + SplitNameResponse reply = act.refSplitName(name); + assertNotNull("no response received from service", reply); + assertEquals("Tom", reply.getNames().getFirst()); + assertEquals("Li", reply.getNames().getSecond()); + } catch (UndeclaredThrowableException ex) { + throw (Exception) ex.getCause(); + } + } } Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java?view=diff&rev=467902&r1=467901&r2=467902 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java Thu Oct 26 00:53:20 2006 @@ -93,7 +93,7 @@ - public void stestInHeader() throws Exception { + public void testInHeader() throws Exception { URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl"); assertNotNull(wsdl); @@ -112,7 +112,7 @@ } } - public void stestOutHeader() throws Exception { + public void testOutHeader() throws Exception { URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl"); assertNotNull(wsdl); @@ -138,7 +138,7 @@ } } - public void stestInOutHeader() throws Exception { + public void testInOutHeader() throws Exception { URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl"); assertNotNull(wsdl); Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java?view=diff&rev=467902&r1=467901&r2=467902 ============================================================================== --- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java (original) +++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/anonymous_complex_type/AnonymousComplexTypeImpl.java Thu Oct 26 00:53:20 2006 @@ -21,7 +21,8 @@ import javax.jws.WebService; -import org.apache.cxf.anonymous_complex_type.SplitNameResponse.Names; + + @WebService(serviceName = "anonymous_complex_type_service", portName = "anonymous_complex_typeSOAP", @@ -30,10 +31,9 @@ public class AnonymousComplexTypeImpl implements AnonymousComplexType { - public Names splitName(String name) { - // TODO Auto-generated method stub + public SplitNameResponse.Names splitName(String name) { if (name != null) { - Names names = new Names(); + SplitNameResponse.Names names = new SplitNameResponse.Names(); int pos = name.indexOf(" "); if (pos > 0) { names.setFirst(name.substring(0, pos)); @@ -45,4 +45,28 @@ } return null; } + + public SplitNameResponse refSplitName(SplitName splitName) { + if (splitName.getName() != null) { + String name = splitName.getName(); + SplitNameResponse.Names names = new SplitNameResponse.Names(); + int pos = name.indexOf(" "); + SplitNameResponse response = null; + if (pos > 0) { + names.setFirst(name.substring(0, pos)); + names.setSecond(name.substring(pos + 1)); + } else { + names.setFirst(name); + + + + } + response = new SplitNameResponse(); + response.setNames(names); + return response; + } + return null; + } } + + Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl?view=diff&rev=467902&r1=467901&r2=467902 ============================================================================== --- incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl (original) +++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/anonymous_complex_type.wsdl Thu Oct 26 00:53:20 2006 @@ -44,7 +44,25 @@ + + + + + + + + + + + + + + + + + + @@ -52,15 +70,34 @@ + + + + + + + + + + + + + + + + + + +