Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 2742 invoked from network); 6 Mar 2007 08:26:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Mar 2007 08:26:27 -0000 Received: (qmail 48628 invoked by uid 500); 6 Mar 2007 08:26:36 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 48511 invoked by uid 500); 6 Mar 2007 08:26:35 -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 48502 invoked by uid 99); 6 Mar 2007 08:26:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2007 00:26:35 -0800 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; Tue, 06 Mar 2007 00:26:25 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 866611A9838; Tue, 6 Mar 2007 00:26:05 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r515020 - in /incubator/cxf/trunk: systests/src/test/java/org/apache/cxf/systest/handlers/ testutils/src/main/java/org/apache/cxf/testutil/handler/ Date: Tue, 06 Mar 2007 08:26:05 -0000 To: cxf-commits@incubator.apache.org From: andreasmyth@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070306082605.866611A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: andreasmyth Date: Tue Mar 6 00:26:04 2007 New Revision: 515020 URL: http://svn.apache.org/viewvc?view=rev&rev=515020 Log: Restored system test testing use of a trivial SOAP handler (in handlers package along with other JAXWS handler tests). Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerAnnotatedGreeterImpl.java (with props) incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerTest.java (with props) incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml (with props) incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/TrivialSOAPHandler.java (with props) Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerAnnotatedGreeterImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerAnnotatedGreeterImpl.java?view=auto&rev=515020 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerAnnotatedGreeterImpl.java (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerAnnotatedGreeterImpl.java Tue Mar 6 00:26:04 2007 @@ -0,0 +1,37 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.cxf.systest.handlers; + +import javax.jws.HandlerChain; +import javax.jws.WebService; + +import org.apache.cxf.greeter_control.AbstractGreeterImpl; + +/** + * + */ + +@WebService(serviceName = "GreeterService", + portName = "GreeterPort", + endpointInterface = "org.apache.cxf.greeter_control.Greeter", + targetNamespace = "http://cxf.apache.org/greeter_control") +@HandlerChain(file = "trivial_soap_handler.xml") +public class TrivialSOAPHandlerAnnotatedGreeterImpl extends AbstractGreeterImpl { +} Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerAnnotatedGreeterImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerAnnotatedGreeterImpl.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerTest.java?view=auto&rev=515020 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerTest.java (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerTest.java Tue Mar 6 00:26:04 2007 @@ -0,0 +1,90 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.cxf.systest.handlers; + +import java.lang.reflect.UndeclaredThrowableException; + +import javax.xml.ws.Endpoint; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.apache.cxf.greeter_control.Greeter; +import org.apache.cxf.greeter_control.GreeterService; +import org.apache.cxf.systest.common.ClientServerSetupBase; +import org.apache.cxf.systest.common.TestServerBase; + +/** + * Tests the use of a SOAPHandler which does not use the underlying SOAP message but simply + * returns true instead. + */ +public class TrivialSOAPHandlerTest extends TestCase { + + public static class Server extends TestServerBase { + + protected void run() { + Object implementor = new TrivialSOAPHandlerAnnotatedGreeterImpl(); + String address = "http://localhost:9020/SoapContext/GreeterPort"; + Endpoint.publish(address, implementor); + } + + + public static void main(String[] args) { + try { + Server s = new Server(); + s.start(); + } catch (Exception ex) { + ex.printStackTrace(); + System.exit(-1); + } finally { + System.out.println("done!"); + } + } + } + + public static Test suite() throws Exception { + TestSuite suite = new TestSuite(TrivialSOAPHandlerTest.class); + return new ClientServerSetupBase(suite) { + public void startServers() throws Exception { + assertTrue("server did not launch correctly", + launchServer(Server.class)); + } + }; + } + + public void testInvocation() throws Exception { + + GreeterService service = new GreeterService(); + assertNotNull(service); + + try { + Greeter greeter = service.getGreeterPort(); + + String greeting = greeter.greetMe("Bonjour"); + assertNotNull("no response received from service", greeting); + assertEquals("BONJOUR", greeting); + + } catch (UndeclaredThrowableException ex) { + throw (Exception)ex.getCause(); + } + } + +} Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TrivialSOAPHandlerTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml?view=auto&rev=515020 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml Tue Mar 6 00:26:04 2007 @@ -0,0 +1,9 @@ + + + + + TrivialSOAPHandler + org.apache.cxf.testutil.handler.TrivialSOAPHandler + + + Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/trivial_soap_handler.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/TrivialSOAPHandler.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/TrivialSOAPHandler.java?view=auto&rev=515020 ============================================================================== --- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/TrivialSOAPHandler.java (added) +++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/TrivialSOAPHandler.java Tue Mar 6 00:26:04 2007 @@ -0,0 +1,68 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.cxf.testutil.handler; + +import java.util.Set; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.annotation.Resource; +import javax.xml.namespace.QName; +import javax.xml.ws.handler.MessageContext; +import javax.xml.ws.handler.soap.SOAPHandler; +import javax.xml.ws.handler.soap.SOAPMessageContext; + + +public class TrivialSOAPHandler implements SOAPHandler { + + @Resource(name = "greeting") + private String greeting; + + public TrivialSOAPHandler() { + System.out.println(this + " Construct"); + } + + @PostConstruct + public void init() { + System.out.println(this + " PostConstruct"); + } + + @PreDestroy + public void destroy() { + System.out.println(this + " PreDestroy"); + } + + public boolean handleMessage(SOAPMessageContext smc) { + System.out.println(this + " handleMessage(): " + greeting); + return true; + } + + public boolean handleFault(SOAPMessageContext smc) { + System.out.println(this + " handleFault()"); + return true; + } + + public void close(MessageContext messageContext) { + System.out.println(this + " close()"); + } + + public Set getHeaders() { + return null; + } + +} Propchange: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/TrivialSOAPHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/handler/TrivialSOAPHandler.java ------------------------------------------------------------------------------ svn:keywords = Rev Date