Author: jim.ma
Date: 2010-12-03 01:08:16 -0500 (Fri, 03 Dec 2010)
New Revision: 13389
Added:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/TestLoggingInInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/cxf.xml
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpoint.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpointImpl.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorJSETestCase.java
Log:
[JBWS-3174]:Fixed CXF stack doesn't pick up cxf.xml in the classpath to create spring
bus
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2010-12-03
06:08:14 UTC (rev 13388)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2010-12-03
06:08:16 UTC (rev 13389)
@@ -66,16 +66,13 @@
{
if (SpringUtils.isSpringAvailable())
{
- URL cxfURL = getCXFConfigFromClassLoader(dep);
+ URL cxfURL = getCXFConfigFromDeployment(dep);
if (cxfURL == null)
{
- cxfURL = getCXFConfigFromDeployment(dep);
- if (cxfURL == null)
- {
- cxfURL = generateCXFConfigFromDeployment(dep);
- }
- putCXFConfigToDeployment(dep, cxfURL);
+ cxfURL = generateCXFConfigFromDeployment(dep);
}
+ putCXFConfigToDeployment(dep, cxfURL);
+
}
else
{
@@ -93,24 +90,8 @@
dd.destroyFileURL();
}
}
-
+
/**
- * Looks for <b>cxf.xml</b> in classloader
- * @param dep deployment which initial classloader will be used
- * @return <b>cxf.xml URL</b> or <b>null</b> if not found
- */
- private URL getCXFConfigFromClassLoader(Deployment dep)
- {
- ClassLoader initCL = dep.getInitialClassLoader();
- URL cxfURL = initCL.getResource("cxf.xml");
- if (cxfURL != null)
- {
- log.info("CXF configuration found: " + cxfURL);
- }
- return cxfURL;
- }
-
- /**
* Looks for <b>jbossws-cxf.xml</b> in:
* <ul>
* <li><b>META-INF</b> resource directory for EJB3
deployment</li>
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml 2010-12-03
06:08:14 UTC (rev 13388)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml 2010-12-03
06:08:16 UTC (rev 13389)
@@ -64,7 +64,11 @@
<war warfile="${tests.output.dir}/test-libs/jaxws-cxf-descriptor.war"
webxml="${tests.output.dir}/test-resources/jaxws/cxf/descriptor/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/descriptor/TestLoggingInInterceptor.class"/>
</classes>
+ <classes
dir="${tests.output.dir}/test-resources/jaxws/cxf/descriptor/">
+ <include name="cxf.xml"/>
+ </classes>
<webinf
dir="${tests.output.dir}/test-resources/jaxws/cxf/descriptor/WEB-INF">
<include name="jbossws-cxf.xml"/>
</webinf>
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpoint.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpoint.java 2010-12-03
06:08:14 UTC (rev 13388)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpoint.java 2010-12-03
06:08:16 UTC (rev 13389)
@@ -29,4 +29,5 @@
public interface DescriptorEndpoint
{
String echo(String input);
+ String getInBoundLog();
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpointImpl.java 2010-12-03
06:08:14 UTC (rev 13388)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorEndpointImpl.java 2010-12-03
06:08:16 UTC (rev 13389)
@@ -46,4 +46,10 @@
return input;
}
+
+ @WebMethod
+ public String getInBoundLog()
+ {
+ return new String(TestLoggingInInterceptor.stringWriter.getBuffer());
+ }
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorJSETestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorJSETestCase.java 2010-12-03
06:08:14 UTC (rev 13388)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorJSETestCase.java 2010-12-03
06:08:16 UTC (rev 13389)
@@ -57,5 +57,9 @@
Object retObj = port.echo("Hello");
assertEquals("Hello", retObj);
+
+ //JBWS-3174: test the cxf.xml is loaded
+ String serverInBoundLog = port.getInBoundLog();
+ assertTrue(serverInBoundLog.length() > 0);
}
}
Added:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/TestLoggingInInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/TestLoggingInInterceptor.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/descriptor/TestLoggingInInterceptor.java 2010-12-03
06:08:16 UTC (rev 13389)
@@ -0,0 +1,37 @@
+/*
+ * 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.test.ws.jaxws.cxf.descriptor;
+
+import java.io.PrintWriter;
+
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+
+public class TestLoggingInInterceptor extends LoggingInInterceptor {
+
+ public static java.io.StringWriter stringWriter = new java.io.StringWriter();
+
+ public TestLoggingInInterceptor() {
+ super();
+ this.setPrintWriter(new PrintWriter(stringWriter));
+ }
+
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/cxf.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/cxf.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/cxf.xml 2010-12-03
06:08:16 UTC (rev 13389)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans
xmlns="http://www.springframework.org/schema/beans"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
+
xmlns:cxf="http://cxf.apache.org/core"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
+http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
+ <bean id="logInbound"
+ class="org.jboss.test.ws.jaxws.cxf.descriptor.TestLoggingInInterceptor"
/>
+ <cxf:bus>
+ <cxf:inInterceptors>
+ <ref bean="logInbound" />
+ </cxf:inInterceptors>
+ </cxf:bus>
+</beans>