Author: jason.greene(a)jboss.com
Date: 2006-11-03 00:35:10 -0500 (Fri, 03 Nov 2006)
New Revision: 1352
Added:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.java
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/UserException.java
branches/JEE5_TCK/src/test/resources/jaxws/exception/
branches/JEE5_TCK/src/test/resources/jaxws/exception/WEB-INF/
branches/JEE5_TCK/src/test/resources/jaxws/exception/WEB-INF/web.xml
Modified:
branches/JEE5_TCK/src/test/ant/build-jars-jaxws.xml
Log:
Add exception test case
Modified: branches/JEE5_TCK/src/test/ant/build-jars-jaxws.xml
===================================================================
--- branches/JEE5_TCK/src/test/ant/build-jars-jaxws.xml 2006-11-03 03:23:16 UTC (rev
1351)
+++ branches/JEE5_TCK/src/test/ant/build-jars-jaxws.xml 2006-11-03 05:35:10 UTC (rev
1352)
@@ -482,6 +482,15 @@
</classes>
</war>
+ <!-- jaxws-exception -->
+ <war warfile="${build.test.dir}/libs/jaxws-exception.war"
webxml="${build.test.dir}/resources/jaxws/exception/WEB-INF/web.xml">
+ <classes dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/exception/UserException.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-wsaddressing-action -->
<war warfile="${build.test.dir}/libs/jaxws-wsaddressing-action-rpc.war"
webxml="${build.test.dir}/resources/jaxws/wsaddressing/action/WEB-INF/web.xml">
<classes dir="${build.test.dir}/classes">
Added:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.java
===================================================================
---
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.java 2006-11-03
03:23:16 UTC (rev 1351)
+++
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.java 2006-11-03
05:35:10 UTC (rev 1352)
@@ -0,0 +1,30 @@
+/*
+ * 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.exception;
+import javax.jws.WebService;
+
+@WebService
+public interface ExceptionEndpoint
+{
+ public void throwRuntimeException();
+ public void throwApplicationException() throws UserException;
+}
\ No newline at end of file
Property changes on:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
===================================================================
---
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-11-03
03:23:16 UTC (rev 1351)
+++
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-11-03
05:35:10 UTC (rev 1352)
@@ -0,0 +1,38 @@
+/*
+ * 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.exception;
+
+import javax.jws.WebService;
+
+(a)WebService(endpointInterface="org.jboss.test.ws.jaxws.exception.ExceptionEndpoint")
+public class ExceptionEndpointImpl implements ExceptionEndpoint
+{
+ public void throwRuntimeException()
+ {
+ throw new RuntimeException("oh no, a runtime exception occured.");
+ }
+
+ public void throwApplicationException() throws UserException
+ {
+ throw new UserException("validation", 123, "Some validation
error");
+ }
+}
Property changes on:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java
===================================================================
---
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java 2006-11-03
03:23:16 UTC (rev 1351)
+++
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java 2006-11-03
05:35:10 UTC (rev 1352)
@@ -0,0 +1,107 @@
+/*
+ * 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.exception;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * Test JAX-WS exception handling
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class ExceptionTestCase extends JBossWSTest
+{
+ private String targetNS = "http://exception.jaxws.ws.test.jboss.org/jaws";
+ private ExceptionEndpoint proxy;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(ExceptionTestCase.class,
"jaxws-exception.war");
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ QName serviceName = new QName(targetNS, "ExceptionEndpointService");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-exception/ExceptionEndpointService?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = (ExceptionEndpoint) service.getPort(ExceptionEndpoint.class);
+ }
+
+
+ public void testRuntimeException() throws Exception
+ {
+ if (true)
+ {
+ System.out.println("FIXME: JBWS-1321");
+ return;
+ }
+
+ try
+ {
+ proxy.throwRuntimeException();
+ }
+ catch (SOAPFaultException e)
+ {
+ assertEquals("oh no, a runtime exception occured.", e.getMessage());
+ return;
+ }
+
+ assertTrue("Expected SOAPFaultException", false);
+ }
+
+ public void testApplicationException() throws Exception
+ {
+ if (true)
+ {
+ System.out.println("FIXME: JBWS-1297");
+ return;
+ }
+
+ try
+ {
+ proxy.throwApplicationException();
+ }
+ catch (UserException e)
+ {
+ assertEquals("Some validation error", e.getMessage());
+ assertEquals("validation", e.getErrorCategory());
+ assertEquals(123, e.getErrorCode());
+ return;
+ }
+
+ assertTrue("Expected UserException", false);
+ }
+}
\ No newline at end of file
Property changes on:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/UserException.java
===================================================================
---
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/UserException.java 2006-11-03
03:23:16 UTC (rev 1351)
+++
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/UserException.java 2006-11-03
05:35:10 UTC (rev 1352)
@@ -0,0 +1,52 @@
+/*
+ * 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.exception;
+
+/**
+ * A mach application exception
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class UserException extends Exception
+{
+ private int errorCode;
+ private String errorCategory;
+
+ public UserException(String errorCategory, int errorCode, String message)
+ {
+ super(message);
+
+ this.errorCategory = errorCategory;
+ this.errorCode = errorCode;
+ }
+
+ public String getErrorCategory()
+ {
+ return errorCategory;
+ }
+
+ public int getErrorCode()
+ {
+ return errorCode;
+ }
+}
Property changes on:
branches/JEE5_TCK/src/test/java/org/jboss/test/ws/jaxws/exception/UserException.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/JEE5_TCK/src/test/resources/jaxws/exception/WEB-INF/web.xml
===================================================================
--- branches/JEE5_TCK/src/test/resources/jaxws/exception/WEB-INF/web.xml 2006-11-03
03:23:16 UTC (rev 1351)
+++ branches/JEE5_TCK/src/test/resources/jaxws/exception/WEB-INF/web.xml 2006-11-03
05:35:10 UTC (rev 1352)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>ExceptionEndpointService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.exception.ExceptionEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ExceptionEndpointService</servlet-name>
+ <url-pattern>/ExceptionEndpointService</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: branches/JEE5_TCK/src/test/resources/jaxws/exception/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF