Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 21786 invoked from network); 26 Apr 2007 22:41:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2007 22:41:49 -0000 Received: (qmail 22368 invoked by uid 500); 26 Apr 2007 22:41:53 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 22322 invoked by uid 500); 26 Apr 2007 22:41:53 -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 22297 invoked by uid 99); 26 Apr 2007 22:41:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 15:41:53 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 15:41:45 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 513CD1A9838; Thu, 26 Apr 2007 15:41:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r532895 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ systests/src/test/java/org/apache/cxf/systest/factory_pattern/ Date: Thu, 26 Apr 2007 22:41:25 -0000 To: cxf-commits@incubator.apache.org From: dandiep@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070426224125.513CD1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dandiep Date: Thu Apr 26 15:41:24 2007 New Revision: 532895 URL: http://svn.apache.org/viewvc?view=rev&rev=532895 Log: Fix ServiceImpl so it throws a WebServiceException if the port doesn't exist, and fix the corresponding unit tests which depend on this broken functionality. Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?view=diff&rev=532895&r1=532894&r2=532895 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Thu Apr 26 15:41:24 2007 @@ -228,6 +228,11 @@ if (portName == null) { throw new WebServiceException(BUNDLE.getString("PORT_NAME_NULL_EXC")); } + + if (!ports.contains(portName) && !portInfos.containsKey(portName)) { + throw new WebServiceException(new Message("INVALID_PORT", BUNDLE, portName).toString()); + } + try { return createPort(portName, null, type); } catch (ServiceConstructionException e) { Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?view=diff&rev=532895&r1=532894&r2=532895 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java Thu Apr 26 15:41:24 2007 @@ -158,12 +158,13 @@ EndpointImpl ep = new EndpointImpl(getBus(), serviceImpl, (String) null); ep.publish("local://localhost:9090/hello"); - QName serviceName = new QName("http://service.jaxws.cxf.apache.org", "Hello"); - QName portName = new QName("http://service.jaxws.cxf.apache.org", "HelloPortType"); + QName serviceName = new QName("http://service.jaxws.cxf.apache.org/", "HelloService"); + QName portName = new QName("http://service.jaxws.cxf.apache.org/", "HelloPort"); // need to set the same bus with service , so use the ServiceImpl ServiceImpl service = new ServiceImpl(getBus(), (URL)null, serviceName, null); service.addPort(portName, "http://schemas.xmlsoap.org/soap/", "local://localhost:9090/hello"); + HelloInterface proxy = service.getPort(portName, HelloInterface.class); assertEquals("Get the wrong result", "hello", proxy.sayHi("hello")); //now the client side can't unmarshal the complex type without binding types annoutation Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java?view=diff&rev=532895&r1=532894&r2=532895 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java Thu Apr 26 15:41:24 2007 @@ -41,7 +41,6 @@ import org.apache.cxf.frontend.ClientProxy; import org.apache.hello_world_soap_http.Greeter; import org.apache.hello_world_soap_http.SOAPService; -import org.junit.Ignore; import org.junit.Test; public class ServiceImplTest extends AbstractJaxWsTest { @@ -61,7 +60,7 @@ Client client = ClientProxy.getClient(proxy); assertEquals("bar", client.getEndpoint().get("foo")); } - + @Override protected Bus createBus() throws BusException { SpringBusFactory bf = new SpringBusFactory(); @@ -98,7 +97,6 @@ } @Test - @Ignore public void testGetBadPort() { URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl"); assertNotNull(wsdl1); Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java?view=diff&rev=532895&r1=532894&r2=532895 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java Thu Apr 26 15:41:24 2007 @@ -28,6 +28,7 @@ import javax.xml.ws.Endpoint; import javax.xml.ws.Service; +import org.apache.cxf.binding.soap.SoapBindingFactory; import org.apache.cxf.factory_pattern.IsEvenResponse; import org.apache.cxf.factory_pattern.Number; import org.apache.cxf.factory_pattern.NumberFactory; @@ -39,7 +40,6 @@ import org.apache.cxf.testutil.common.AbstractBusTestServerBase; import org.apache.cxf.ws.addressing.EndpointReferenceType; import org.apache.cxf.wsdl.EndpointReferenceUtils; - import org.junit.BeforeClass; import org.junit.Test; @@ -85,13 +85,13 @@ // use the epr info only // no wsdl so default generated soap/http binding will be used // address url must come from the calling context - // QName serviceName = EndpointReferenceUtils.getServiceName(epr); Service numService = Service.create(serviceName); String portString = EndpointReferenceUtils.getPortName(epr); QName portName = new QName(serviceName.getNamespaceURI(), portString); - Number num = (Number)numService.getPort(portName, Number.class); + numService.addPort(portName, SoapBindingFactory.SOAP_11_BINDING, "http://foo"); + Number num = (Number)numService.getPort(portName, Number.class); setupContextWithEprAddress(epr, num);