Author: asoldano
Date: 2014-04-08 05:24:06 -0400 (Tue, 08 Apr 2014)
New Revision: 18567
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/CDIBeanClient.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3679/WEB-INF/beans.xml
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/ServletClient.java
Log:
Enriching [JBWS-3679] testcase to also verify @WebServiceRef injection in a CDI bean
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2014-04-07
14:55:13 UTC (rev 18566)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2014-04-08
09:24:06 UTC (rev 18567)
@@ -459,7 +459,11 @@
<war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jbws3679.war"
webxml="${tests.output.dir}/test-resources/jaxws/cxf/jbws3679/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include name="org/jboss/test/ws/jaxws/cxf/jbws3679/*.class"/>
+ <exclude
name="org/jboss/test/ws/jaxws/cxf/jbws3679/*TestCase.class"/>
</classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/cxf/jbws3679/WEB-INF">
+ <include name="beans.xml"/>
+ </webinf>
</war>
<!-- jaxws-cxf-jbws3713 -->
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/CDIBeanClient.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/CDIBeanClient.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/CDIBeanClient.java 2014-04-08
09:24:06 UTC (rev 18567)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2014, 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.jbws3679;
+
+import java.io.IOException;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Named;
+import javax.xml.ws.WebServiceRef;
+
+@Named
+public class CDIBeanClient
+{
+ @WebServiceRef(value = EndpointOneService.class)
+ public EndpointOne endpointOne;
+
+ @PostConstruct
+ public void start() {
+ if (endpointOne == null) {
+ throw new RuntimeException("WebServiceRef not injected in CDI
bean!");
+ }
+ }
+
+ public String performCall() {
+ return endpointOne.echo("cdiInput");
+ }
+}
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/CDIBeanClient.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java 2014-04-07
14:55:13 UTC (rev 18566)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java 2014-04-08
09:24:06 UTC (rev 18567)
@@ -33,10 +33,15 @@
return new JBossWSTestSetup(JBWS3679TestCase.class,
"jaxws-cxf-jbws3679.war");
}
- public void testSchemaImport() throws Exception
+ public void testServletClient() throws Exception
{
URL url = new URL(endpointAddress);
assertEquals("Echoded with:input",
IOUtils.readAndCloseStream(url.openStream()));
}
+ public void testCDIClient() throws Exception
+ {
+ URL url = new URL(endpointAddress + "?client=CDI");
+ assertEquals("Echoded with:cdiInput",
IOUtils.readAndCloseStream(url.openStream()));
+ }
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/ServletClient.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/ServletClient.java 2014-04-07
14:55:13 UTC (rev 18566)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/ServletClient.java 2014-04-08
09:24:06 UTC (rev 18567)
@@ -18,6 +18,7 @@
import java.io.IOException;
+import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -28,11 +29,19 @@
{
private static final long serialVersionUID = 1L;
@WebServiceRef(value = EndpointOneService.class)
- public EndpointOne endpointOne;
+ private EndpointOne endpointOne;
+
+ @Inject
+ private CDIBeanClient cdiClient;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
{
- res.getWriter().write(endpointOne.echo("input"));
+ String clientParam = req.getParameter("client");
+ if ("CDI".equals(clientParam)) {
+ res.getWriter().write(cdiClient.performCall());
+ } else {
+ res.getWriter().write(endpointOne.echo("input"));
+ }
}
}
\ No newline at end of file
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3679/WEB-INF/beans.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3679/WEB-INF/beans.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3679/WEB-INF/beans.xml 2014-04-08
09:24:06 UTC (rev 18567)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans
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/javaee/beans_1_0.xsd">
+</beans>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3679/WEB-INF/beans.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native