[jboss-cvs] JBossAS SVN: r107044 - branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 23 03:27:22 EDT 2010
Author: jim.ma
Date: 2010-07-23 03:27:21 -0400 (Fri, 23 Jul 2010)
New Revision: 107044
Added:
branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java
Modified:
branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
Log:
[JBPAPP-4563]:Update handlerchain example
Modified: branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2010-07-23 06:27:24 UTC (rev 107043)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2010-07-23 07:27:21 UTC (rev 107044)
@@ -21,13 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.handlerchain;
-import javax.jws.HandlerChain;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService(name="Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
- at HandlerChain(file = "jaxws-handlers-client.xml") // relative path from the class file
public interface EndpointWithHandlerChain
{
public String echo(String input);
Added: branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java (rev 0)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java 2010-07-23 07:27:21 UTC (rev 107044)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.handlerchain;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+ at HandlerChain(file = "jaxws-handlers-client.xml")
+public class EndpointWithHandlerChainService extends Service
+{
+ public EndpointWithHandlerChainService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
Modified: branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2010-07-23 06:27:24 UTC (rev 107043)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/handlerchain/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2010-07-23 07:27:21 UTC (rev 107044)
@@ -38,6 +38,7 @@
/**
* Test the JSR-181 annotation: javax.jws.HandlerChain
*
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
* @author Thomas.Diesler at jboss.org
* @since 15-Oct-2005
*/
@@ -50,6 +51,7 @@
return new JBossWSTestSetup(HandlerChainTestCase.class, "jaxws-samples-handlerchain.war");
}
+ @SuppressWarnings("unchecked")
public void testDynamicHandlerChain() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
@@ -57,7 +59,7 @@
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
-
+
BindingProvider bindingProvider = (BindingProvider)port;
List<Handler> handlerChain = new ArrayList<Handler>();
handlerChain.add(new LogHandler());
@@ -65,48 +67,29 @@
handlerChain.add(new RoutingHandler());
handlerChain.add(new ClientMimeHandler());
bindingProvider.getBinding().setHandlerChain(handlerChain);
-
+
String resStr = port.echo("Kermit");
assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
-
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1671] Metro client handler cannot set mime header");
- return;
- }
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1507] CXF client handler cannot set mime header");
- return;
- }
-
- assertEquals("server-cookie=true", ClientMimeHandler.inboundCookie);
+ assertCookies();
}
- public void testHandlerChainOnServiceEndpointInterface() throws Exception
+ public void testHandlerChainOnService() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-handlerchain/TestService?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = new EndpointWithHandlerChainService(wsdlURL, serviceName);
EndpointWithHandlerChain port = (EndpointWithHandlerChain)service.getPort(EndpointWithHandlerChain.class);
-
+
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
+ assertCookies();
+ }
+
+ private void assertCookies() throws Exception
+ {
if (isIntegrationMetro())
{
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- else
- {
- String resStr = port.echo("Kermit");
- assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
- }
-
- if (isIntegrationMetro())
- {
System.out.println("FIXME: [JBWS-1671] Metro client handler cannot set mime header");
return;
}
More information about the jboss-cvs-commits
mailing list