Author: thomas.diesler(a)jboss.com
Date: 2008-06-04 08:01:55 -0400 (Wed, 04 Jun 2008)
New Revision: 7331
Removed:
framework/trunk/testsuite/test/resources/jaxws/samples/context/WEB-INF/wsdl/
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
Log:
[JBWS-2013] Implement standard message context properties
Add seperate test. Add FIXMEs for CXF & Metro
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java 2008-06-04
10:44:28 UTC (rev 7330)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/Endpoint.java 2008-06-04
12:01:55 UTC (rev 7331)
@@ -1,6 +1,28 @@
-
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.context;
+// $Id$
+
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
@@ -8,46 +30,24 @@
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
-
-/**
- * This class was generated by the JAXWS SI.
- * JAX-WS RI 2.0-b26-ea3
- * Generated source version: 2.0
- *
- */
@WebService(name = "Endpoint", targetNamespace =
"http://org.jboss.ws/jaxws/context")
@SOAPBinding(style = Style.RPC)
public interface Endpoint {
-
- /**
- *
- * @return
- * returns java.lang.String
- */
@WebMethod
@WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName
= "return")
public String testGetMessageContext();
- /**
- *
- * @return
- * returns java.lang.String
- */
@WebMethod
@WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName
= "return")
+ public String testMessageContextProperties();
+
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName
= "return")
public String testGetUserPrincipal();
- /**
- *
- * @param arg0
- * @return
- * returns boolean
- */
@WebMethod
@WebResult(targetNamespace = "http://org.jboss.ws/jaxws/context", partName
= "return")
- public boolean testIsUserInRole(
- @WebParam(name = "arg0", partName = "arg0")
- String arg0);
+ public boolean testIsUserInRole(@WebParam(name = "arg0", partName =
"arg0") String arg0);
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2008-06-04
10:44:28 UTC (rev 7330)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2008-06-04
12:01:55 UTC (rev 7331)
@@ -62,6 +62,13 @@
public String testGetMessageContext()
{
MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+ return msgContext == null ? "fail" : "pass";
+ }
+
+ @WebMethod
+ public String testMessageContextProperties()
+ {
+ MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
if (msgContext == null)
return "fail";
@@ -78,7 +85,7 @@
throw new WebServiceException("Invalid qname: " + port);
QName operation = (QName)msgContext.get(MessageContext.WSDL_OPERATION);
- if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context",
"testGetMessageContext")))
+ if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context",
"testMessageContextProperties")))
throw new WebServiceException("Invalid qname: " + operation);
try
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2008-06-04
10:44:28 UTC (rev 7330)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2008-06-04
12:01:55 UTC (rev 7331)
@@ -52,25 +52,32 @@
public String testGetMessageContext()
{
MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+ return msgContext == null ? "fail" : "pass";
+ }
+
+ @WebMethod
+ public String testMessageContextProperties()
+ {
+ MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
if (msgContext == null)
return "fail";
-
+
QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
if (!service.equals(new QName("http://org.jboss.ws/jaxws/context",
"EndpointService")))
throw new WebServiceException("Invalid qname: " + service);
-
+
QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
if (!portType.equals(new QName("http://org.jboss.ws/jaxws/context",
"Endpoint")))
throw new WebServiceException("Invalid qname: " + portType);
-
+
QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
if (!port.equals(new QName("http://org.jboss.ws/jaxws/context",
"EndpointPort")))
throw new WebServiceException("Invalid qname: " + port);
-
+
QName operation = (QName)msgContext.get(MessageContext.WSDL_OPERATION);
- if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context",
"testGetMessageContext")))
+ if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context",
"testMessageContextProperties")))
throw new WebServiceException("Invalid qname: " + operation);
-
+
try
{
InputSource wsdlSource =
(InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
@@ -81,7 +88,7 @@
{
throw new WebServiceException("Cannot parse
MessageContext.WSDL_DESCRIPTION", ex);
}
-
+
return "pass";
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2008-06-04
10:44:28 UTC (rev 7330)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2008-06-04
12:01:55 UTC (rev 7331)
@@ -54,7 +54,7 @@
{
if (port == null)
{
- URL wsdlURL =
getResourceURL("jaxws/samples/context/WEB-INF/wsdl/Endpoint.wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-context?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/context",
"EndpointService");
Service service = Service.create(wsdlURL, qname);
port = (Endpoint)service.getPort(Endpoint.class);
@@ -71,6 +71,24 @@
assertEquals("pass", retStr);
}
+ public void testMessageContextProperties() throws Exception
+ {
+ if (isIntegrationMetro())
+ {
+ System.out.println("FIXME: [2204] Implement Metro standard message context
properties");
+ return;
+ }
+
+ if (isIntegrationCXF())
+ {
+ System.out.println("FIXME: [2203] Implement CXF standard message context
properties");
+ return;
+ }
+
+ String retStr = port.testMessageContextProperties();
+ assertEquals("pass", retStr);
+ }
+
public void testGetUserPrincipal() throws Exception
{
String retStr = port.testGetUserPrincipal();
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2008-06-04
10:44:28 UTC (rev 7330)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2008-06-04
12:01:55 UTC (rev 7331)
@@ -54,7 +54,7 @@
{
if (port == null)
{
- URL wsdlURL =
getResourceURL("jaxws/samples/context/WEB-INF/wsdl/Endpoint.wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-context?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/context",
"EndpointService");
Service service = Service.create(wsdlURL, qname);
port = (Endpoint)service.getPort(Endpoint.class);
@@ -71,6 +71,24 @@
assertEquals("pass", retStr);
}
+ public void testMessageContextProperties() throws Exception
+ {
+ if (isIntegrationMetro())
+ {
+ System.out.println("FIXME: [2204] Implement Metro standard message context
properties");
+ return;
+ }
+
+ if (isIntegrationCXF())
+ {
+ System.out.println("FIXME: [2203] Implement CXF standard message context
properties");
+ return;
+ }
+
+ String retStr = port.testMessageContextProperties();
+ assertEquals("pass", retStr);
+ }
+
public void testGetUserPrincipal() throws Exception
{
String retStr = port.testGetUserPrincipal();