Author: rsearls
Date: 2014-11-11 23:51:57 -0500 (Tue, 11 Nov 2014)
New Revision: 19100
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/EndpointTwoImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813AnnotationTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/webTwo.xml
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813TestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/jaxws-endpoint-config.xml
Log:
[JBWS-3813] added test for property setting by EndpointConfig annotation and correct valid
return text.
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/EndpointTwoImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/EndpointTwoImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/EndpointTwoImpl.java 2014-11-12
04:51:57 UTC (rev 19100)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.jbws3813;
+
+import org.jboss.ws.api.annotation.EndpointConfig;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "EndpointTwo", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/jbws3813", serviceName = "ServiceTwo")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@EndpointConfig(configName="MyEndpointTwoImpl",
configFile="jaxws-endpoint-config.xml")
+public class EndpointTwoImpl implements EndpointOne
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ throw new RuntimeException("my error");
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813AnnotationTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813AnnotationTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813AnnotationTestCase.java 2014-11-12
04:51:57 UTC (rev 19100)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.test.ws.jaxws.cxf.jbws3813;
+
+import junit.framework.Test;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.io.File;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+public class JBWS3813AnnotationTestCase extends JBossWSTest
+{
+ public static JBossWSTestHelper.BaseDeployment<?>[] createDeployments() {
+ List<JBossWSTestHelper.BaseDeployment<?>> list = new
LinkedList<JBossWSTestHelper.BaseDeployment<?>>();
+ list.add(new
JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3813-two.war") { {
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3813.EndpointOne.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3813.EndpointTwoImpl.class)
+ .add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() +
+ "/jaxws/cxf/jbws3813/WEB-INF/jaxws-endpoint-config.xml")),
+ "jaxws-endpoint-config.xml")
+ .add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() +
+ "/jaxws/cxf/jbws3813/WEB-INF/webTwo.xml")),
+ "WEB-INF/web.xml");
+ }
+ });
+ return list.toArray(new JBossWSTestHelper.BaseDeployment<?>[list.size()]);
+ }
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS3813AnnotationTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
+ }
+
+ public void testExceptionFlags() throws Exception {
+ String endPtAddress = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3813-two/ServiceTwo";
+ QName serviceName = new QName("http://org.jboss.ws.jaxws.cxf/jbws3813",
"ServiceTwo");
+ URL wsdlURL = new URL(endPtAddress + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ EndpointOne proxy = service.getPort(EndpointOne.class);
+ boolean isFailed = false;
+ try
+ {
+ proxy.echo("foo");
+ } catch (javax.xml.ws.soap.SOAPFaultException ex) {
+ String text =
ex.getFault().getDetail().getFirstChild().getFirstChild().getTextContent();
+ isFailed = text.startsWith("java.lang.RuntimeException : my error");
+ assertTrue("stack data not found", isFailed);
+ } finally {
+ assertTrue("test did not fail as required", isFailed);
+ }
+ }
+}
+
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813TestCase.java 2014-11-12
03:59:20 UTC (rev 19099)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3813/JBWS3813TestCase.java 2014-11-12
04:51:57 UTC (rev 19100)
@@ -65,7 +65,7 @@
proxy.echo("foo");
} catch (javax.xml.ws.soap.SOAPFaultException ex) {
String text =
ex.getFault().getDetail().getFirstChild().getFirstChild().getTextContent();
- isFailed =
text.startsWith("org.jboss.test.ws.jaxws.cxf.jbws3813.EndpointOneImpl!echo!EndpointOneImpl.java!35");
+ isFailed = text.startsWith("java.lang.RuntimeException : my error");
assertTrue("stack data not found", isFailed);
} finally {
assertTrue("test did not fail as required", isFailed);
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/jaxws-endpoint-config.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/jaxws-endpoint-config.xml 2014-11-12
03:59:20 UTC (rev 19099)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/jaxws-endpoint-config.xml 2014-11-12
04:51:57 UTC (rev 19100)
@@ -15,4 +15,16 @@
</property>
</endpoint-config>
+ <endpoint-config>
+ <config-name>MyEndpointTwoImpl</config-name>
+ <property>
+ <property-name>faultStackTraceEnabled</property-name>
+ <property-value>true</property-value>
+ </property>
+ <property>
+ <property-name>exceptionMessageCauseEnabled</property-name>
+ <property-value>true</property-value>
+ </property>
+ </endpoint-config>
+
</jaxws-config>
\ No newline at end of file
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/webTwo.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/webTwo.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3813/WEB-INF/webTwo.xml 2014-11-12
04:51:57 UTC (rev 19100)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>EpServletTwo</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.cxf.jbws3813.EndpointTwoImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>EpServletTwo</servlet-name>
+ <url-pattern>/ServiceTwo</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file