Author: alessio.soldano(a)jboss.com
Date: 2013-06-21 13:38:07 -0400 (Fri, 21 Jun 2013)
New Revision: 17719
Added:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java
Removed:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/HttpServletResponseExt.java
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/pom.xml
Log:
Merged revisions 17479,17618,17623,17628,17714-17715,17717 via svnmerge from
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk
.......
r17479 | alessio.soldano(a)jboss.com | 2013-04-08 19:03:45 +0200 (Mon, 08 Apr 2013) | 2
lines
[JBWS-3621] Replace HttpServletResponseExt.java with HttpServletResonseWrapper
.......
r17618 | jim.ma | 2013-05-29 13:02:15 +0200 (Wed, 29 May 2013) | 1 line
[JBWS-3645]:Register the WorkQueueManager in JMXServer when cxf management is enabled
.......
r17623 | alessio.soldano(a)jboss.com | 2013-05-29 16:13:56 +0200 (Wed, 29 May 2013) | 2
lines
[JBWS-3645] Adding explanation comment in the code
.......
r17628 | alessio.soldano(a)jboss.com | 2013-05-29 18:24:56 +0200 (Wed, 29 May 2013) | 2
lines
Minor improvement, do not look for QueryHandlerRegistry for non wsdl get calls
.......
r17714 | alessio.soldano(a)jboss.com | 2013-06-21 09:42:31 +0200 (Fri, 21 Jun 2013) | 2
lines
[JBWS-3653] Fixing issue + adding new testcase for code-first scenario and enhancing the
existing tests to explicitly verify automatic address rewrite is the testsuite server host
is 'localhost'
.......
r17715 | alessio.soldano(a)jboss.com | 2013-06-21 09:58:07 +0200 (Fri, 21 Jun 2013) | 2
lines
[JBWS-3653] Always explicitly set the AUTO_REWRITE_ADDRESS_ALL prop to avoid relying on
CXF default (false)
.......
r17717 | alessio.soldano(a)jboss.com | 2013-06-21 12:27:16 +0200 (Fri, 21 Jun 2013) | 2
lines
Split ClientSpringAppTestCase to prevent issues during parallel tests execution
.......
Property changes on: stack/cxf/branches/jbossws-cxf-4.1.x
___________________________________________________________________
Modified: svnmerge-integrated
- /stack/cxf/trunk:1-17199,17260-17277,17279,17345,17400-17414,17433
+
/stack/cxf/trunk:1-17199,17260-17277,17279,17345,17400-17414,17433,17479,17481-17482,17484,17487-17490,17492-17493,17501-17504,17506-17520,17522-17523,17529-17530,17540-17549,17552-17553,17556-17580,17582,17586,17591-17592,17596,17606-17608,17612-17614,17618,17621-17626,17628,17630-17638,17640-17644,17646,17648-17665,17667-17672,17677,17679-17685,17687,17690-17705,17707,17710,17713-17715,17717
Modified: svn:mergeinfo
- /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/branches/ropalka:16301-16305,16966-17008
/stack/cxf/branches/ropalka_JBWS-3550:16747-16757
/stack/cxf/trunk:17260-17277,17279,17345,17400-17414,17433
+ /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/branches/ropalka:16301-16305,16966-17008
/stack/cxf/branches/ropalka_JBWS-3550:16747-16757
/stack/cxf/trunk:17260-17277,17279,17345,17400-17414,17433,17479,17618,17623,17628,17714-17715,17717
Deleted:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/HttpServletResponseExt.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/HttpServletResponseExt.java 2013-06-21
17:36:51 UTC (rev 17718)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/HttpServletResponseExt.java 2013-06-21
17:38:07 UTC (rev 17719)
@@ -1,241 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.wsf.stack.cxf;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.Locale;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * A HttpServletResponse delegate that externalizes fields.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 17-Jul-2009
- */
-public class HttpServletResponseExt implements HttpServletResponse
-{
- private HttpServletResponse delegate;
- private int sc;
-
- public HttpServletResponseExt(HttpServletResponse delegate)
- {
- this.delegate = delegate;
- }
-
- /**
- * Get the status currently set in the HttpServletResponse
- *
- * @return the http status
- */
- public int getStatus()
- {
- return this.sc;
- }
-
- /* HttpServletResponse API */
-
- public void addCookie(Cookie cookie)
- {
- delegate.addCookie(cookie);
- }
-
- public void addDateHeader(String name, long date)
- {
- delegate.addDateHeader(name, date);
- }
-
- public void addHeader(String name, String value)
- {
- delegate.addHeader(name, value);
- }
-
- public void addIntHeader(String name, int value)
- {
- delegate.addIntHeader(name, value);
- }
-
- public boolean containsHeader(String name)
- {
- return delegate.containsHeader(name);
- }
-
- public String encodeRedirectURL(String url)
- {
- return delegate.encodeRedirectURL(url);
- }
-
- @Deprecated
- public String encodeRedirectUrl(String url)
- {
- return delegate.encodeRedirectUrl(url);
- }
-
- public String encodeURL(String url)
- {
- return delegate.encodeURL(url);
- }
-
- @Deprecated
- public String encodeUrl(String url)
- {
- return delegate.encodeUrl(url);
- }
-
- public void sendError(int sc) throws IOException
- {
- delegate.sendError(sc);
- }
-
- public void sendError(int sc, String msg) throws IOException
- {
- delegate.sendError(sc, msg);
- }
-
- public void sendRedirect(String location) throws IOException
- {
- delegate.sendRedirect(location);
- }
-
- public void setDateHeader(String name, long date)
- {
- delegate.setDateHeader(name, date);
- }
-
- public void setHeader(String name, String value)
- {
- delegate.setHeader(name, value);
- }
-
- public void setIntHeader(String name, int value)
- {
- delegate.setIntHeader(name, value);
- }
-
- public void setStatus(int sc)
- {
- delegate.setStatus(sc);
- this.sc = sc;
- }
-
- @Deprecated
- public void setStatus(int sc, String sm)
- {
- delegate.setStatus(sc, sm);
- this.sc = sc;
- }
-
- public void flushBuffer() throws IOException
- {
- delegate.flushBuffer();
- }
-
- public int getBufferSize()
- {
- return delegate.getBufferSize();
- }
-
- public String getCharacterEncoding()
- {
- return delegate.getCharacterEncoding();
- }
-
- public String getContentType()
- {
- return delegate.getContentType();
- }
-
- public Locale getLocale()
- {
- return delegate.getLocale();
- }
-
- public ServletOutputStream getOutputStream() throws IOException
- {
- return delegate.getOutputStream();
- }
-
- public PrintWriter getWriter() throws IOException
- {
- return delegate.getWriter();
- }
-
- public boolean isCommitted()
- {
- return delegate.isCommitted();
- }
-
- public void reset()
- {
- delegate.reset();
- }
-
- public void resetBuffer()
- {
- delegate.resetBuffer();
- }
-
- public void setBufferSize(int size)
- {
- delegate.setBufferSize(size);
- }
-
- public void setCharacterEncoding(String charset)
- {
- delegate.setCharacterEncoding(charset);
- }
-
- public void setContentLength(int len)
- {
- delegate.setContentLength(len);
- }
-
- public void setContentType(String type)
- {
- delegate.setContentType(type);
- }
-
- public void setLocale(Locale loc)
- {
- delegate.setLocale(loc);
- }
-
- public String getHeader(String arg0)
- {
- return delegate.getHeader(arg0);
- }
-
- public Collection<String> getHeaderNames()
- {
- return delegate.getHeaderNames();
- }
-
- public Collection<String> getHeaders(String arg0)
- {
- return delegate.getHeaders(arg0);
- }
-
-}
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2013-06-21
17:36:51 UTC (rev 17718)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2013-06-21
17:38:07 UTC (rev 17719)
@@ -33,6 +33,7 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
import org.apache.cxf.Bus;
import org.apache.cxf.BusException;
@@ -52,6 +53,7 @@
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointMetrics;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
/**
@@ -88,7 +90,7 @@
if (false == requestHandled)
{
Long beginTime = initRequestMetrics(ep);
- HttpServletResponseExt response = new HttpServletResponseExt(res);
+ HttpServletResponseWrapper response = new HttpServletResponseWrapper(res);
try
{
ServletConfig cfg =
(ServletConfig)context.getAttribute(ServletConfig.class.getName());
@@ -193,39 +195,39 @@
* @return true if there was a query handler that successfully handled the request,
false otherwise
* @throws ServletException if some problem occurs
*/
- private boolean handleQuery(HttpServletRequest req, HttpServletResponse res,
AbstractHTTPDestination dest, Bus bus)
+ private final boolean handleQuery(HttpServletRequest req, HttpServletResponse res,
AbstractHTTPDestination dest, Bus bus)
throws ServletException
{
- boolean hasQuery = (null != req.getQueryString()) &&
(req.getQueryString().length() > 0);
- boolean queryHandlerRegistryExists = bus.getExtension(QueryHandlerRegistry.class)
!= null;
-
- if (hasQuery && queryHandlerRegistryExists)
+ final String queryString = req.getQueryString();
+ if ((null != queryString) && (queryString.length() > 0))
{
- String ctxUri = req.getRequestURI();
- String baseUri = req.getRequestURL().toString() + "?" +
req.getQueryString();
- EndpointInfo endpointInfo = dest.getEndpointInfo();
- ServerConfig serverConfig =
AbstractServerConfig.getServerIntegrationServerConfig();
- if (serverConfig.isModifySOAPAddress()) {
- endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS_ALL,
-
ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()));
- }
-
- for (QueryHandler queryHandler :
bus.getExtension(QueryHandlerRegistry.class).getHandlers())
- {
- if (queryHandler.isRecognizedQuery(baseUri, ctxUri, endpointInfo))
+ final QueryHandlerRegistry qhr = bus.getExtension(QueryHandlerRegistry.class);
+ if (qhr != null) {
+ final String ctxUri = req.getRequestURI();
+ final String baseUri = req.getRequestURL().toString() + "?" +
queryString;
+ final EndpointInfo endpointInfo = dest.getEndpointInfo();
+ final boolean autoRewrite = SoapAddressRewriteHelper.isAutoRewriteOn(
+ AbstractServerConfig.getServerIntegrationServerConfig());
+ endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS, autoRewrite);
+ endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS_ALL,
autoRewrite);
+
+ for (QueryHandler queryHandler : qhr.getHandlers())
{
- res.setContentType(queryHandler.getResponseContentType(baseUri, ctxUri));
- try
+ if (queryHandler.isRecognizedQuery(baseUri, ctxUri, endpointInfo))
{
- OutputStream out = res.getOutputStream();
- queryHandler.writeResponse(baseUri, ctxUri, endpointInfo, out);
- out.flush();
- return true;
+ res.setContentType(queryHandler.getResponseContentType(baseUri,
ctxUri));
+ try
+ {
+ OutputStream out = res.getOutputStream();
+ queryHandler.writeResponse(baseUri, ctxUri, endpointInfo, out);
+ out.flush();
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw new ServletException(e);
+ }
}
- catch (Exception e)
- {
- throw new ServletException(e);
- }
}
}
}
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2013-06-21
17:36:51 UTC (rev 17718)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2013-06-21
17:38:07 UTC (rev 17719)
@@ -103,10 +103,9 @@
if (bus.getExtension(PolicyEngine.class) != null)
{
bus.getExtension(PolicyEngine.class).setAlternativeSelector(getAlternativeSelector(props));
- }
-
- setAdditionalWorkQueues(bus, props);
- setCXFManagement(bus, props);
+ }
+ setCXFManagement(bus, props); //*first* enabled cxf management if required, *then*
add anything else which could be manageable (e.g. work queues)
+ setAdditionalWorkQueues(bus, props);
}
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2013-06-21
17:36:51 UTC (rev 17718)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2013-06-21
17:38:07 UTC (rev 17719)
@@ -275,6 +275,7 @@
if (wsdlLocation == null) {
wsdlLocation = ddep.getAnnotationWsdlLocation();
}
+ final ServerConfig sc = AbstractServerConfig.getServerIntegrationServerConfig();
if (wsdlLocation != null) {
URL wsdlUrl = dep.getResourceResolver().resolveFailSafe(wsdlLocation);
if (wsdlUrl != null) {
@@ -282,7 +283,6 @@
//do not try rewriting addresses for not-http binding
String wsdlAddress = parser.filterSoapAddress(ddep.getServiceName(),
ddep.getPortName(), SOAPAddressWSDLParser.SOAP_HTTP_NS);
- final ServerConfig sc =
AbstractServerConfig.getServerIntegrationServerConfig();
String rewrittenWsdlAddress =
SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(wsdlAddress, ddep.getAddress(),
sc);
//If "auto rewrite", leave "publishedEndpointUrl" unset
so that CXF do not force host/port values for
//wsdl imports and auto-rewrite them too; otherwise set the new address into
"publishedEndpointUrl",
@@ -293,6 +293,11 @@
} else {
METADATA_LOGGER.abortSoapAddressRewrite(wsdlLocation, null);
}
+ } else {
+ //same comment as above regarding auto rewrite...
+ if (!SoapAddressRewriteHelper.isAutoRewriteOn(sc)) {
+ ddep.setPublishedEndpointUrl(ddep.getAddress()); //force computed address for
code first endpoints
+ }
}
}
Modified:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java 2013-06-21
17:36:51 UTC (rev 17718)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java 2013-06-21
17:38:07 UTC (rev 17719)
@@ -49,11 +49,6 @@
assertEquals("1", runTestInContainer("testSpringAvailability",
Helper.class.getName()));
}
- public void testJBossWSCXFBus() throws Exception
- {
- assertEquals("1", runTestInContainer("testJBossWSCXFBus",
Helper.class.getName()));
- }
-
public void testJBossWSCXFSpringBus() throws Exception
{
assertEquals("1", runTestInContainer("testJBossWSCXFSpringBus",
Helper.class.getName()));
Copied:
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java
(from rev 17717,
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java)
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java
(rev 0)
+++
stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java 2013-06-21
17:38:07 UTC (rev 17719)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.spring;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * This test is an addition to the
org.jboss.test.ws.jaxws.cxf.spring.ClientSpringAppTestCase that runs
+ * in forked mode as it requires setting sys props during test and hence can't be
executed concurrently.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 21-Jun-2013
+ */
+public final class ClientSpringAppTestCaseForked extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(ClientSpringAppTestCaseForked.class,
"jaxws-cxf-spring-client.war, jaxws-cxf-spring.war");
+ }
+
+ public void testJBossWSCXFBus() throws Exception
+ {
+ assertEquals("1", runTestInContainer("testJBossWSCXFBus",
Helper.class.getName()));
+ }
+
+ private String runTestInContainer(String test, String helper) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-spring-client?path=/jaxws-cxf-spring/EndpointService&method="
+ + test + "&helper=" + helper);
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ return br.readLine();
+ }
+}
Modified: stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/pom.xml 2013-06-21 17:36:51 UTC
(rev 17718)
+++ stack/cxf/branches/jbossws-cxf-4.1.x/modules/testsuite/pom.xml 2013-06-21 17:38:07 UTC
(rev 17719)
@@ -380,6 +380,7 @@
<skip>false</skip>
<includes>
<include>**/jaxws/cxf/httpproxy/*TestCaseForked.java</include>
+ <include>**/jaxws/cxf/spring/*TestCaseForked.java</include>
<include>**/jaxws/samples/schemavalidation/*TestCaseForked.java</include>
<include>**/jbws2150/**/*TestCaseForked.java</include>
<include>**/jms*/**/*TestCaseForked.java</include>