Author: thomas.diesler(a)jboss.com
Date: 2007-05-31 10:57:14 -0400 (Thu, 31 May 2007)
New Revision: 3340
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationException.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationExceptionResponse.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeException.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeExceptionResponse.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultException.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultExceptionResponse.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/UserExceptionBean.java
Removed:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/TestDeployerTomcat.java
Modified:
trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java
trunk/testsuite/ant-import/build-jars-jaxws.xml
trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTest.java
trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestHelper.java
trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestSetup.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEndpoint.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/UserException.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
Log:
Add FIXME: [JBWS-1670] SunRI client does not throw UserException
Modified: trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
===================================================================
--- trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-31 14:30:59
UTC (rev 3339)
+++ trunk/integration/sunri/src/test/resources/excludes-jboss50.txt 2007-05-31 14:57:14
UTC (rev 3340)
@@ -5,7 +5,6 @@
# [JBWS-1699] - Fix WebServiceContext.getMessageContext()
org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
-org/jboss/test/ws/jaxws/samples/exception/**
org/jboss/test/ws/jaxws/samples/handlerchain/**
org/jboss/test/ws/jaxws/samples/httpbinding/**
org/jboss/test/ws/jaxws/samples/jaxr/**
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -305,7 +305,7 @@
}
if (faultBeanName == null)
- faultBeanName =
JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) +
"." + exception.getSimpleName() + "Bean";
+ faultBeanName =
JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) +
".jaxws." + exception.getSimpleName() + "Bean";
QName xmlName = new QName(namespace, name);
@@ -364,7 +364,7 @@
if (requestWrapperType == null)
{
String packageName = JavaUtils.getPackageName(method.getDeclaringClass());
- requestWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName());
+ requestWrapperType = packageName + ".jaxws." +
JavaUtils.capitalize(method.getName());
}
// JAX-WS p.37 pg.1, the annotation only affects the element name, not the type
name
@@ -397,7 +397,7 @@
if (responseWrapperType == null)
{
String packageName = JavaUtils.getPackageName(method.getDeclaringClass());
- responseWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName()) + "Response";
+ responseWrapperType = packageName + ".jaxws." +
JavaUtils.capitalize(method.getName()) + "Response";
}
ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType,
responseWrapperType);
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/SourceWrapperGenerator.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -143,7 +143,7 @@
JMethod method = clazz.method(JMod.PUBLIC, type, getterPrefix(type) +
JavaUtils.capitalize(variable));
method.body()._return(JExpr._this().ref(variable));
- method = clazz.method(JMod.PUBLIC, type, "set" +
JavaUtils.capitalize(variable));
+ method = clazz.method(JMod.PUBLIC, void.class, "set" +
JavaUtils.capitalize(variable));
method.body().assign(JExpr._this().ref(variable), method.param(type, variable));
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-05-31
14:30:59 UTC (rev 3339)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -43,10 +43,10 @@
{
// provide logging
private static Logger log = Logger.getLogger(JBossWSTestHelper.class);
-
+
private static MBeanServerConnection server;
private static String integrationTarget;
-
+
/** Deploy the given archive
*/
public void deploy(String archive) throws Exception
@@ -97,7 +97,7 @@
String target = getIntegrationTarget();
return "jboss40".equals(target);
}
-
+
/**
* Get the JBoss server host from system property "jboss.bind.address"
* This defaults to "localhost"
@@ -108,7 +108,7 @@
return hostName;
}
- public static MBeanServerConnection getServer()
+ public static MBeanServerConnection getServer()
{
if (server == null)
{
@@ -127,20 +127,7 @@
private TestDeployer getDeployer()
{
- if (isTargetJBoss())
- {
- return new TestDeployerJBoss(getServer());
- }
- else if (isTargetTomcat())
- {
- String username = System.getProperty("tomcat.manager.username");
- String password = System.getProperty("tomcat.manager.password");
- return new TestDeployerTomcat(username, password);
- }
- else
- {
- throw new IllegalStateException("Unsupported integration target: " +
getIntegrationTarget());
- }
+ return new TestDeployerJBoss(getServer());
}
private static String getIntegrationTarget()
@@ -148,7 +135,7 @@
if (integrationTarget == null)
{
integrationTarget = System.getProperty("jbossws.integration.target");
-
+
// Read the JBoss SpecificationVersion
try
{
@@ -160,9 +147,8 @@
jbossVersion = "jboss42";
else if (jbossVersion.startsWith("4.0"))
jbossVersion = "jboss40";
- else
- throw new RuntimeException("Unsupported jboss version: " +
jbossVersion);
-
+ else throw new RuntimeException("Unsupported jboss version: " +
jbossVersion);
+
if (jbossVersion.equals(integrationTarget) == false)
{
log.warn("Integration target mismatch, using: " +
jbossVersion);
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/TestDeployerTomcat.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/TestDeployerTomcat.java 2007-05-31
14:30:59 UTC (rev 3339)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/TestDeployerTomcat.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -1,129 +0,0 @@
-/*
- * 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;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.lang.reflect.Method;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.ProtocolException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.util.Base64;
-
-/**
- * A deployer that deploys to Tomcat
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-May-2006
- */
-public class TestDeployerTomcat implements TestDeployer
-{
- private String username, password;
-
- // Map<String,String> of URL to context path
- private static Map pathMap = new HashMap();
-
- public TestDeployerTomcat(String username, String password)
- {
- this.username = username;
- this.password = password;
- }
-
- public void deploy(URL url) throws Exception
- {
- File destDir = new File(new File(url.getFile()).getParent() +
"/wspublish");
- destDir.mkdirs();
-
- // Use reflection to invoke wspublish.process() from the tomcat integration layer
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class wspublishClass =
loader.loadClass("org.jboss.ws.integration.tomcat.wspublish");
- Method process = wspublishClass.getMethod("process", new
Class[]{URL.class, File.class, String.class});
- URL warURL = (URL)process.invoke(wspublishClass.newInstance(), new Object[]{url,
destDir, null});
-
- String path = warURL.toExternalForm();
- path = path.substring(path.lastIndexOf("/"));
- if (path.endsWith(".war"))
- path = path.substring(0, path.length() - 4);
-
- URL managerURL = new URL(getManagerPath() + "/deploy?path=" + path +
"&war=" + warURL.toExternalForm());
- HttpURLConnection con = getURLConnection(managerURL);
-
- con.connect();
-
- BufferedReader br = new BufferedReader(new
InputStreamReader(con.getInputStream()));
- String status = br.readLine();
-
- if (status == null)
- throw new IllegalStateException("Cannot obtain deploy status");
-
- if (status.startsWith("OK") == false)
- throw new IllegalStateException("Cannot deploy application: " +
status);
-
- path = status.substring(status.indexOf("/"));
- pathMap.put(url.toExternalForm(), path);
- }
-
- public void undeploy(URL url) throws Exception
- {
- String path = (String) pathMap.get(url.toExternalForm());
- if (path != null)
- {
- URL managerURL = new URL(getManagerPath() + "/undeploy?path=" +
path);
- HttpURLConnection con = getURLConnection(managerURL);
-
- con.connect();
-
- BufferedReader br = new BufferedReader(new
InputStreamReader(con.getInputStream()));
- String status = br.readLine();
-
- if (status == null)
- throw new IllegalStateException("Cannot obtain undeploy status");
-
- if (status.startsWith("OK") == false)
- throw new IllegalStateException("Cannot undeploy application: " +
status);
- }
- }
-
- private String getManagerPath() throws MalformedURLException
- {
- String hostName = System.getProperty("jboss.bind.address",
"localhost");
- return "http://" + hostName + ":8080/manager";
- }
-
- private HttpURLConnection getURLConnection(URL managerURL) throws IOException,
ProtocolException
- {
- HttpURLConnection con = (HttpURLConnection)managerURL.openConnection();
- con.setRequestMethod("GET");
- con.setDoInput(true);
-
- String authorization = username + ":" + password;
- authorization = Base64.encodeBytes(authorization.getBytes());
- con.setRequestProperty("Authorization", "Basic " +
authorization);
- return con;
- }
-}
Modified: trunk/testsuite/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-31 14:30:59 UTC (rev 3339)
+++ trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-31 14:57:14 UTC (rev 3340)
@@ -82,6 +82,7 @@
<!-- jaxws-samples-exception -->
<war warfile="${tests.output.dir}/libs/jaxws-samples-exception.war"
webxml="${tests.output.dir}/resources/jaxws/samples/exception/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/samples/exception/jaxws/**"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/ExceptionEndpoint.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/ExceptionEndpointImpl.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/UserException.class"/>
Modified: trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTest.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTest.java 2007-05-31 14:30:59 UTC
(rev 3339)
+++ trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTest.java 2007-05-31 14:57:14 UTC
(rev 3340)
@@ -30,7 +30,9 @@
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import javax.xml.namespace.QName;
import javax.xml.transform.Source;
+import javax.xml.ws.Service;
import junit.framework.TestCase;
@@ -69,18 +71,6 @@
return JBossWSTestHelper.getServer();
}
- /** True, if -Djbossws.integration.target=jboss?? */
- public boolean isTargetJBoss()
- {
- return JBossWSTestHelper.isTargetJBoss();
- }
-
- /** True, if -Djbossws.integration.target=tomcat */
- public boolean isTargetTomcat()
- {
- return JBossWSTestHelper.isTargetTomcat();
- }
-
public boolean isTargetJBoss50()
{
return JBossWSTestHelper.isTargetJBoss50();
@@ -91,11 +81,22 @@
return JBossWSTestHelper.isTargetJBoss42();
}
- public boolean isTargetJBoss40()
+ public boolean isIntegrationNative()
{
- return JBossWSTestHelper.isTargetJBoss40();
+ return delegate.isIntegrationNative();
+
}
+ public boolean isIntegrationSunRI()
+ {
+ return delegate.isIntegrationSunRI();
+ }
+
+ public boolean isIntegrationXFire()
+ {
+ return delegate.isIntegrationXFire();
+ }
+
/** Deploy the given archive
*/
public void deploy(String archive) throws Exception
@@ -146,11 +147,6 @@
return JBossWSTestHelper.getServerHost();
}
- public Element getElementFromSource(Source retObj) throws Exception
- {
- return DOMUtils.sourceToElement(retObj);
- }
-
public static void assertEquals(Element expElement, Element wasElement, boolean
ignoreWhitespace)
{
normalizeWhitspace(expElement, ignoreWhitespace);
Modified: trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestHelper.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-05-31 14:30:59
UTC (rev 3339)
+++ trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-05-31 14:57:14
UTC (rev 3340)
@@ -30,8 +30,11 @@
import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
/**
@@ -44,10 +47,10 @@
{
// provide logging
private static Logger log = Logger.getLogger(JBossWSTestHelper.class);
-
+
private static MBeanServerConnection server;
private static String integrationTarget;
-
+
/** Deploy the given archive
*/
public void deploy(String archive) throws Exception
@@ -64,20 +67,6 @@
getDeployer().undeploy(url);
}
- /** True, if -Djbossws.integration.target=tomcat */
- public static boolean isTargetTomcat()
- {
- String target = getIntegrationTarget();
- return "tomcat".equals(target);
- }
-
- /** True, if -Djbossws.integration.target=jboss?? */
- public static boolean isTargetJBoss()
- {
- String target = getIntegrationTarget();
- return target != null && target.startsWith("jboss");
- }
-
/** True, if -Djbossws.integration.target=jboss50 */
public static boolean isTargetJBoss50()
{
@@ -92,13 +81,23 @@
return "jboss42".equals(target);
}
- /** True, if -Djbossws.integration.target=jboss40 */
- public static boolean isTargetJBoss40()
+ public boolean isIntegrationNative()
{
- String target = getIntegrationTarget();
- return "jboss40".equals(target);
+ String vendor = Service.class.getPackage().getImplementationVendor();
+ return vendor.startsWith("JBoss");
}
+ public boolean isIntegrationSunRI()
+ {
+ String vendor = Service.class.getPackage().getImplementationVendor();
+ return vendor.startsWith("Sun Microsystems");
+ }
+
+ public boolean isIntegrationXFire()
+ {
+ throw new NotImplementedException();
+ }
+
/**
* Get the JBoss server host from system property "jboss.bind.address"
* This defaults to "localhost"
@@ -109,7 +108,7 @@
return hostName;
}
- public static MBeanServerConnection getServer()
+ public static MBeanServerConnection getServer()
{
if (server == null)
{
@@ -130,20 +129,7 @@
private TestDeployer getDeployer()
{
- if (isTargetJBoss())
- {
- return new TestDeployerJBoss(getServer());
- }
- else if (isTargetTomcat())
- {
- String username = System.getProperty("tomcat.manager.username");
- String password = System.getProperty("tomcat.manager.password");
- return null; //new TestDeployerTomcat(username, password);
- }
- else
- {
- throw new IllegalStateException("Unsupported integration target: " +
getIntegrationTarget());
- }
+ return new TestDeployerJBoss(getServer());
}
private static String getIntegrationTarget()
@@ -151,7 +137,10 @@
if (integrationTarget == null)
{
integrationTarget = System.getProperty("jbossws.integration.target");
-
+
+ if (integrationTarget == null)
+ throw new IllegalStateException("Cannot obtain
jbossws.integration.target");
+
// Read the JBoss SpecificationVersion
try
{
@@ -161,27 +150,18 @@
jbossVersion = "jboss50";
else if (jbossVersion.startsWith("4.2"))
jbossVersion = "jboss42";
- else if (jbossVersion.startsWith("4.0"))
- jbossVersion = "jboss40";
- else
- throw new RuntimeException("Unsupported jboss version: " +
jbossVersion);
-
+ else throw new RuntimeException("Unsupported jboss version: " +
jbossVersion);
+
if (jbossVersion.equals(integrationTarget) == false)
{
- log.warn("Integration target mismatch, using: " +
jbossVersion);
- integrationTarget = jbossVersion;
+ throw new IllegalStateException("Integration target mismatch, using:
" + jbossVersion);
+ //integrationTarget = jbossVersion;
}
}
catch (Throwable th)
{
// ignore, we are not running on jboss-4.2 or greater
}
-
- if (integrationTarget == null)
- {
- log.warn("Cannot obtain jbossws.integration.target, using default:
tomcat");
- integrationTarget = "tomcat";
- }
}
return integrationTarget;
}
Modified: trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestSetup.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestSetup.java 2007-05-31 14:30:59
UTC (rev 3339)
+++ trunk/testsuite/src/java/org/jboss/test/ws/JBossWSTestSetup.java 2007-05-31 14:57:14
UTC (rev 3340)
@@ -82,21 +82,17 @@
for (int i = 0; i < archives.length; i++)
{
String archive = archives[i];
- boolean isJ2EEClient = archive.endsWith("-client.jar");
- if (delegate.isTargetJBoss() || isJ2EEClient == false)
+ try
{
- try
- {
- delegate.deploy(archive);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- delegate.undeploy(archive);
- }
+ delegate.deploy(archive);
}
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ delegate.undeploy(archive);
+ }
- if (isJ2EEClient)
+ if (archive.endsWith("-client.jar"))
{
URL archiveURL = delegate.getArchiveURL(archive);
clientJars.add(archiveURL);
@@ -104,11 +100,11 @@
}
// add the client jars to the classloader
- if( !clientJars.isEmpty() )
+ if (!clientJars.isEmpty())
{
ClassLoader parent = Thread.currentThread().getContextClassLoader();
URL[] urls = new URL[clientJars.size()];
- for(int i=0; i<clientJars.size(); i++)
+ for (int i = 0; i < clientJars.size(); i++)
{
urls[i] = (URL)clientJars.get(i);
}
@@ -122,11 +118,7 @@
for (int i = 0; i < archives.length; i++)
{
String archive = archives[archives.length - i - 1];
- boolean isJ2EEClient = archive.endsWith("-client.jar");
- if (delegate.isTargetJBoss() || isJ2EEClient == false)
- {
- delegate.undeploy(archive);
- }
+ delegate.undeploy(archive);
}
}
}
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEndpoint.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEndpoint.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEndpoint.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -20,12 +20,15 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
package org.jboss.test.ws.jaxws.samples.exception;
+
import javax.jws.WebService;
@WebService
public interface ExceptionEndpoint
{
public void throwRuntimeException();
+
public void throwSoapFaultException();
+
public void throwApplicationException() throws UserException;
}
\ No newline at end of file
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -87,8 +87,8 @@
}
catch (SOAPFaultException e)
{
- assertEquals("oh no, a runtime exception occured.", e.getMessage());
- assertEquals("oh no, a runtime exception occured.",
e.getFault().getFaultString());
+ String faultString = e.getFault().getFaultString();
+ assertTrue(faultString.indexOf("oh no, a runtime exception occured.")
> 0);
}
}
@@ -101,7 +101,6 @@
}
catch (SOAPFaultException e)
{
- assertEquals("this is a fault string!", e.getMessage());
assertEquals("this is a fault string!",
e.getFault().getFaultString());
assertEquals("mr.actor", e.getFault().getFaultActor());
assertEquals("FooCode",
e.getFault().getFaultCodeAsName().getLocalName());
@@ -112,6 +111,12 @@
public void testApplicationException() throws Exception
{
+ if (isIntegrationSunRI())
+ {
+ System.out.println("FIXME: [JBWS-1670] SunRI client does not throw
UserException");
+ return;
+ }
+
try
{
proxy.throwApplicationException();
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/UserException.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/UserException.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/UserException.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -21,12 +21,15 @@
*/
package org.jboss.test.ws.jaxws.samples.exception;
+import javax.xml.ws.WebFault;
+
/**
* A mach application exception
*
* @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @version $Revision$
*/
+(a)WebFault(faultBean="org.jboss.test.ws.jaxws.samples.exception.jaxws.UserExceptionBean")
public class UserException extends Exception
{
private int errorCode;
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationException.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationException.java
(rev 0)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationException.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -0,0 +1,15 @@
+
+package org.jboss.test.ws.jaxws.samples.exception.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace =
"http://exception.samples.jaxws.ws.test.jboss.org/", name =
"throwApplicationException")
+@XmlType(namespace = "http://exception.samples.jaxws.ws.test.jboss.org/", name
= "throwApplicationException")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ThrowApplicationException {
+
+
+}
Property changes on:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationExceptionResponse.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationExceptionResponse.java
(rev 0)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationExceptionResponse.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -0,0 +1,15 @@
+
+package org.jboss.test.ws.jaxws.samples.exception.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace =
"http://exception.samples.jaxws.ws.test.jboss.org/", name =
"throwApplicationExceptionResponse")
+@XmlType(namespace = "http://exception.samples.jaxws.ws.test.jboss.org/", name
= "throwApplicationExceptionResponse")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ThrowApplicationExceptionResponse {
+
+
+}
Property changes on:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowApplicationExceptionResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeException.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeException.java
(rev 0)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeException.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -0,0 +1,15 @@
+
+package org.jboss.test.ws.jaxws.samples.exception.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace =
"http://exception.samples.jaxws.ws.test.jboss.org/", name =
"throwRuntimeException")
+@XmlType(namespace = "http://exception.samples.jaxws.ws.test.jboss.org/", name
= "throwRuntimeException")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ThrowRuntimeException {
+
+
+}
Property changes on:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeExceptionResponse.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeExceptionResponse.java
(rev 0)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeExceptionResponse.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -0,0 +1,15 @@
+
+package org.jboss.test.ws.jaxws.samples.exception.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace =
"http://exception.samples.jaxws.ws.test.jboss.org/", name =
"throwRuntimeExceptionResponse")
+@XmlType(namespace = "http://exception.samples.jaxws.ws.test.jboss.org/", name
= "throwRuntimeExceptionResponse")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ThrowRuntimeExceptionResponse {
+
+
+}
Property changes on:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowRuntimeExceptionResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultException.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultException.java
(rev 0)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultException.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -0,0 +1,15 @@
+
+package org.jboss.test.ws.jaxws.samples.exception.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace =
"http://exception.samples.jaxws.ws.test.jboss.org/", name =
"throwSoapFaultException")
+@XmlType(namespace = "http://exception.samples.jaxws.ws.test.jboss.org/", name
= "throwSoapFaultException")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ThrowSoapFaultException {
+
+
+}
Property changes on:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultExceptionResponse.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultExceptionResponse.java
(rev 0)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultExceptionResponse.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -0,0 +1,15 @@
+
+package org.jboss.test.ws.jaxws.samples.exception.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace =
"http://exception.samples.jaxws.ws.test.jboss.org/", name =
"throwSoapFaultExceptionResponse")
+@XmlType(namespace = "http://exception.samples.jaxws.ws.test.jboss.org/", name
= "throwSoapFaultExceptionResponse")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ThrowSoapFaultExceptionResponse {
+
+
+}
Property changes on:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/ThrowSoapFaultExceptionResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/UserExceptionBean.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/UserExceptionBean.java
(rev 0)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/UserExceptionBean.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -0,0 +1,50 @@
+
+package org.jboss.test.ws.jaxws.samples.exception.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(namespace =
"http://exception.samples.jaxws.ws.test.jboss.org/", name =
"UserException")
+@XmlType(namespace = "http://exception.samples.jaxws.ws.test.jboss.org/", name
= "UserException", propOrder = {
+ "errorCategory",
+ "errorCode",
+ "message"
+})
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class UserExceptionBean {
+
+ @XmlElement(namespace = "", name = "errorCategory")
+ private String errorCategory;
+ @XmlElement(namespace = "", name = "errorCode")
+ private int errorCode;
+ @XmlElement(namespace = "", name = "message")
+ private String message;
+
+ public String getErrorCategory() {
+ return this.errorCategory;
+ }
+
+ public void setErrorCategory(String errorCategory) {
+ this.errorCategory = errorCategory;
+ }
+
+ public int getErrorCode() {
+ return this.errorCode;
+ }
+
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getMessage() {
+ return this.message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
Property changes on:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/jaxws/UserExceptionBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -71,7 +71,7 @@
Dispatch<Source> dispatch = createDispatch("ProviderEndpoint");
Source resPayload = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
- Element docElement = getElementFromSource(resPayload);
+ Element docElement = DOMUtils.sourceToElement(resPayload);
assertEquals(DOMUtils.parse(resString), docElement);
}
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/oneway/OneWayTestCase.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -68,7 +68,7 @@
payload = "<ns1:feedback
xmlns:ns1='http://oneway.samples.jaxws.ws.test.jboss.org/'/>&q...;
Source retObj = (Source)dispatch.invoke(new StreamSource(new
StringReader(payload)));
- Element docElement = getElementFromSource(retObj);
+ Element docElement = DOMUtils.sourceToElement(retObj);
Element retElement = DOMUtils.getFirstChildElement(docElement);
String retPayload = DOMWriter.printNode(retElement, false);
assertEquals("<return>ok</return>", retPayload);
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -80,7 +80,7 @@
Dispatch<Source> dispatch = createDispatch("ProviderEndpoint");
Source resPayload = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
- Element docElement = getElementFromSource(resPayload);
+ Element docElement = DOMUtils.sourceToElement(resPayload);
assertEquals(DOMUtils.parse(resString), docElement);
}
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java 2007-05-31
14:30:59 UTC (rev 3339)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java 2007-05-31
14:57:14 UTC (rev 3340)
@@ -1,24 +1,24 @@
/*
- * 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.
- */
+ * 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.webmethod;
import java.io.ByteArrayInputStream;
@@ -78,15 +78,8 @@
MessageFactory msgFactory = MessageFactory.newInstance();
SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
- String reqEnv =
- "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <ns1:echoString xmlns:ns1='" + targetNS + "'>"
+
- " <arg0>Hello</arg0>" +
- " </ns1:echoString>" +
- " </env:Body>" +
- "</env:Envelope>";
+ String reqEnv = "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + "
<env:Header/>" + " <env:Body>" + " <ns1:echoString
xmlns:ns1='"
+ + targetNS + "'>" + "
<arg0>Hello</arg0>" + " </ns1:echoString>" + "
</env:Body>" + "</env:Envelope>";
SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(reqEnv.getBytes()));
URL epURL = new URL(endpointURL);
@@ -103,15 +96,8 @@
MessageFactory msgFactory = MessageFactory.newInstance();
SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
- String reqEnv =
- "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <ns1:noWebMethod xmlns:ns1='" + targetNS +
"'>" +
- " <String_1>Hello</String_1>" +
- " </ns1:noWebMethod>" +
- " </env:Body>" +
- "</env:Envelope>";
+ String reqEnv = "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + "
<env:Header/>" + " <env:Body>" + " <ns1:noWebMethod
xmlns:ns1='"
+ + targetNS + "'>" + "
<String_1>Hello</String_1>" + " </ns1:noWebMethod>" +
" </env:Body>" + "</env:Envelope>";
SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(reqEnv.getBytes()));
URL epURL = new URL(endpointURL);
@@ -129,22 +115,18 @@
QName serviceName = new QName(targetNS, "TestEndpointService");
QName portName = new QName(targetNS, "TestEndpointPort");
- String reqPayload =
- "<ns1:noWebMethod xmlns:ns1='" + targetNS +
"'>" +
- " <String_1>Hello</String_1>" +
- "</ns1:noWebMethod>";
+ String reqPayload = "<ns1:noWebMethod xmlns:ns1='" + targetNS +
"'>" + " <String_1>Hello</String_1>" +
"</ns1:noWebMethod>";
- String expPayload =
- "<env:Fault
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <faultcode>env:Client</faultcode>" +
- " <faultstring>Endpoint
{http://webmethod.samples.jaxws.ws.test.jboss.org/}TestEndpointPort does not contain
operation meta data for:
{http://webmethod.samples.jaxws.ws.test.jboss.org/}noWebMethod</faultstring>"
+
- "</env:Fault>";
+ String expPayload = "<env:Fault
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
+ + " <faultcode>env:Client</faultcode>"
+ + " <faultstring>Endpoint
{http://webmethod.samples.jaxws.ws.test.jboss.org/}TestEndpointPort does not contain
operation meta data for:
{http://webmethod.samples.jaxws.ws.test.jboss.org/}noWebMethod</faultstring>"
+ + "</env:Fault>";
Service service = Service.create(wsdlURL, serviceName);
Dispatch dispatch = service.createDispatch(portName, StreamSource.class,
Mode.PAYLOAD);
Source retSource = (Source)dispatch.invoke(new StreamSource(new
StringReader(reqPayload)));
- Element retEl = getElementFromSource(retSource);
-
+ Element retEl = DOMUtils.sourceToElement(retSource);
+
assertEquals(DOMUtils.parse(expPayload), retEl);
}
}
\ No newline at end of file