JBossWS SVN: r18982 - in stack/cxf/trunk: modules/client and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-13 10:19:17 -0400 (Mon, 13 Oct 2014)
New Revision: 18982
Modified:
stack/cxf/trunk/modules/client/pom.xml
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/pom.xml
Log:
[JBWS-3818] Upgrade to Apache CXF 3.0.2
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2014-10-10 14:50:24 UTC (rev 18981)
+++ stack/cxf/trunk/modules/client/pom.xml 2014-10-13 14:19:17 UTC (rev 18982)
@@ -123,6 +123,10 @@
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
+ <artifactId>cxf-xjc-bug986</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-dv</artifactId>
</dependency>
<dependency>
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2014-10-10 14:50:24 UTC (rev 18981)
+++ stack/cxf/trunk/modules/server/pom.xml 2014-10-13 14:19:17 UTC (rev 18982)
@@ -123,6 +123,10 @@
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
+ <artifactId>cxf-xjc-bug986</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-dv</artifactId>
</dependency>
<dependency>
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2014-10-10 14:50:24 UTC (rev 18981)
+++ stack/cxf/trunk/pom.xml 2014-10-13 14:19:17 UTC (rev 18982)
@@ -71,9 +71,9 @@
<wildfly810.version>8.1.0.Final</wildfly810.version>
<wildfly900.version>9.0.0.Alpha2-SNAPSHOT</wildfly900.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>3.0.2-SNAPSHOT</cxf.version>
+ <cxf.version>3.0.2</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
- <cxf.xjcplugins.version>2.7.0</cxf.xjcplugins.version>
+ <cxf.xjcplugins.version>3.0.2</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
<jboss-logging.version>3.1.2.GA</jboss-logging.version>
<jboss-logging-processor.version>1.0.3.Final</jboss-logging-processor.version>
@@ -101,8 +101,8 @@
<jms.api.version>1.0.1.Final</jms.api.version>
<velocity.version>1.7</velocity.version>
<xerces.version>2.9.1</xerces.version>
- <xmlsec.version>2.0.1</xmlsec.version>
- <wss4j.version>2.0.2-SNAPSHOT</wss4j.version>
+ <xmlsec.version>2.0.2</xmlsec.version>
+ <wss4j.version>2.0.2</wss4j.version>
<wstx.version>4.2.0</wstx.version>
<spring.version>3.2.8.RELEASE</spring.version>
<shrinkwrap.version>1.1.3</shrinkwrap.version>
@@ -788,6 +788,41 @@
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
+ <artifactId>cxf-xjc-bug986</artifactId>
+ <version>${cxf.xjcplugins.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-dv</artifactId>
<version>${cxf.xjcplugins.version}</version>
<exclusions>
10 years, 2 months
JBossWS SVN: r18981 - in stack/cxf/trunk/modules: client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-10 10:50:24 -0400 (Fri, 10 Oct 2014)
New Revision: 18981
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorUtils.java
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorZ.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpoint.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpointImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusCounterInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Counter.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/DeclaredInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Endpoint.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointCounterInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/InterceptorsTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jaxws-endpoint-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jboss-webservices.xml
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
Log:
[JBWS-3840] Adding support for Apache CXF interceptor properties in jboss-webservices.xml and adding additional tests (also for JBWS-3837)
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-10 09:48:12 UTC (rev 18980)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -21,24 +21,17 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.StringTokenizer;
import javax.xml.ws.Dispatch;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.interceptor.Interceptor;
-import org.apache.cxf.interceptor.InterceptorProvider;
import org.apache.cxf.jaxws.DispatchImpl;
import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.ws.common.configuration.ConfigHelper;
-import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.security.JASPIAuthenticationProvider;
@@ -92,7 +85,7 @@
public void setConfigProperties(Client client, Map<String, String> properties) {
client.getEndpoint().putAll(properties);
- addInterceptors(client, properties);
+ InterceptorUtils.addInterceptors(client, properties);
}
private void savePropList(Client client, Map<String, String> props) {
@@ -106,67 +99,13 @@
if (previousProps != null) {
for (String p : previousProps) {
if (Constants.CXF_IN_INTERCEPTORS_PROP.equals(p)) {
- removeInterceptors(client.getInInterceptors(), (String)ep.get(p));
+ InterceptorUtils.removeInterceptors(client.getInInterceptors(), (String)ep.get(p));
} else if (Constants.CXF_OUT_INTERCEPTORS_PROP.equals(p)) {
- removeInterceptors(client.getOutInterceptors(), (String)ep.get(p));
+ InterceptorUtils.removeInterceptors(client.getOutInterceptors(), (String)ep.get(p));
}
ep.remove(p);
}
ep.remove(JBOSSWS_CXF_CLIENT_CONF_PROPS);
}
}
-
- public void addInterceptors(InterceptorProvider interceptorProvider, Map<String, String> properties) {
- final String inInterceptors = properties.get(Constants.CXF_IN_INTERCEPTORS_PROP);
- if (inInterceptors != null) {
- interceptorProvider.getInInterceptors().addAll(createInterceptors(inInterceptors));
- }
- final String outInterceptors = properties.get(Constants.CXF_OUT_INTERCEPTORS_PROP);
- if (outInterceptors != null) {
- interceptorProvider.getOutInterceptors().addAll(createInterceptors(outInterceptors));
- }
- }
-
- private void removeInterceptors(List<Interceptor<?>> interceptorsList, String interceptors) {
- Set<String> set = new HashSet<String>();
- StringTokenizer st = new StringTokenizer(interceptors, ", ", false);
- while (st.hasMoreTokens()) {
- set.add(st.nextToken());
- }
- List<Interceptor<?>> toBeRemoved = new ArrayList<Interceptor<?>>();
- for (Interceptor<?> itc : interceptorsList) {
- if (set.contains(itc.getClass().getName())) {
- toBeRemoved.add(itc);
- }
- }
- interceptorsList.removeAll(toBeRemoved);
- }
-
- private static List<Interceptor<?>> createInterceptors(String propValue) {
- List<Interceptor<?>> list = new ArrayList<Interceptor<?>>();
- StringTokenizer st = new StringTokenizer(propValue, ", ", false );
- while (st.hasMoreTokens()) {
- String itc = st.nextToken();
- Interceptor<?> interceptor = (Interceptor<?>)newInstance(itc);
- if (interceptor != null) {
- list.add(interceptor);
- }
- }
- return list;
- }
-
- private static Object newInstance(String className)
- {
- try
- {
- ClassLoader loader = new DelegateClassLoader(ClassLoaderProvider.getDefaultProvider()
- .getServerIntegrationClassLoader(), SecurityActions.getContextClassLoader());
- Class<?> clazz = SecurityActions.loadClass(loader, className);
- return clazz.newInstance();
- }
- catch (Exception e)
- {
- return null;
- }
- }
}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorUtils.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorUtils.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorUtils.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.interceptor.InterceptorProvider;
+import org.jboss.ws.common.utils.DelegateClassLoader;
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.stack.cxf.client.Constants;
+
+/**
+ * Utils methods for adding/removing CXF interceptors
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Oct-2014
+ *
+ */
+public class InterceptorUtils
+{
+ public static void addInterceptors(InterceptorProvider interceptorProvider, Map<String, String> properties) {
+ final String inInterceptors = properties.get(Constants.CXF_IN_INTERCEPTORS_PROP);
+ if (inInterceptors != null) {
+ interceptorProvider.getInInterceptors().addAll(createInterceptors(inInterceptors));
+ }
+ final String outInterceptors = properties.get(Constants.CXF_OUT_INTERCEPTORS_PROP);
+ if (outInterceptors != null) {
+ interceptorProvider.getOutInterceptors().addAll(createInterceptors(outInterceptors));
+ }
+ }
+
+ public static void removeInterceptors(List<Interceptor<?>> interceptorsList, String interceptors) {
+ Set<String> set = new HashSet<String>();
+ StringTokenizer st = new StringTokenizer(interceptors, ", ", false);
+ while (st.hasMoreTokens()) {
+ set.add(st.nextToken());
+ }
+ List<Interceptor<?>> toBeRemoved = new ArrayList<Interceptor<?>>();
+ for (Interceptor<?> itc : interceptorsList) {
+ if (set.contains(itc.getClass().getName())) {
+ toBeRemoved.add(itc);
+ }
+ }
+ interceptorsList.removeAll(toBeRemoved);
+ }
+
+ private static List<Interceptor<?>> createInterceptors(String propValue) {
+ List<Interceptor<?>> list = new ArrayList<Interceptor<?>>();
+ StringTokenizer st = new StringTokenizer(propValue, ", ", false );
+ while (st.hasMoreTokens()) {
+ String itc = st.nextToken();
+ Interceptor<?> interceptor = (Interceptor<?>)newInstance(itc);
+ if (interceptor != null) {
+ list.add(interceptor);
+ }
+ }
+ return list;
+ }
+
+ private static Object newInstance(String className)
+ {
+ try
+ {
+ ClassLoader loader = new DelegateClassLoader(ClassLoaderProvider.getDefaultProvider()
+ .getServerIntegrationClassLoader(), SecurityActions.getContextClassLoader());
+ Class<?> clazz = SecurityActions.loadClass(loader, className);
+ return clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorUtils.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java 2014-10-10 09:48:12 UTC (rev 18980)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -162,10 +162,8 @@
properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorA org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorC,org.jboss.wsf.stack.cxf.client.configuration.InterceptorD");
- CXFClientConfigurer cfg = new CXFClientConfigurer();
+ InterceptorUtils.addInterceptors(client, properties);
- cfg.addInterceptors(client, properties);
-
List<String> interceptors = toNameList(client.getInInterceptors());
assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
@@ -182,7 +180,7 @@
properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorD, FooInterceptor");
properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
- cfg.addInterceptors(client, properties);
+ InterceptorUtils.addInterceptors(client, properties);
interceptors = toNameList(client.getInInterceptors());
assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
@@ -243,7 +241,7 @@
properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorD, FooInterceptor");
properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
- cfg.addInterceptors(client, properties);
+ InterceptorUtils.addInterceptors(client, properties);
assertEquals("1", client.getEndpoint().get("A"));
assertEquals("2", client.getEndpoint().get("B"));
@@ -304,6 +302,8 @@
assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ ClientProxy.getClient(port).getInInterceptors().add(new InterceptorZ());
+
properties = new HashMap<String, String>();
properties.put("E", "10");
properties.put("F", "20");
@@ -326,6 +326,7 @@
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorZ"));
interceptors = toNameList(client.getOutInterceptors());
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
@@ -350,6 +351,7 @@
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorZ"));
interceptors = toNameList(client.getOutInterceptors());
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorZ.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorZ.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorZ.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+
+public class InterceptorZ implements Interceptor<Message> {
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handleFault(Message message)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorZ.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-10-10 09:48:12 UTC (rev 18980)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -68,6 +68,8 @@
import org.jboss.wsf.stack.cxf.Loggers;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer;
+import org.jboss.wsf.stack.cxf.client.configuration.InterceptorUtils;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.extensions.policy.PolicySetsAnnotationListener;
import org.jboss.wsf.stack.cxf.interceptor.EnableDecoupledFaultInterceptor;
@@ -218,6 +220,8 @@
if (SoapAddressRewriteHelper.isPathRewriteRequired(sarm) || SoapAddressRewriteHelper.isSchemeRewriteRequired(sarm)) {
bus.getInInterceptors().add(new WSDLSoapAddressRewriteInterceptor(sarm));
}
+
+ InterceptorUtils.addInterceptors(bus, props);
}
protected static void setResourceResolver(Bus bus, ResourceResolver resourceResolver)
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-10-10 09:48:12 UTC (rev 18980)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -45,6 +45,7 @@
import org.jboss.wsf.stack.cxf.Loggers;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
import org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer;
+import org.jboss.wsf.stack.cxf.client.configuration.InterceptorUtils;
/**
@@ -107,8 +108,7 @@
{
propMap.putAll(epConfProps);
}
- CXFClientConfigurer helper = new CXFClientConfigurer();
- helper.addInterceptors(this, epConfProps);
+ InterceptorUtils.addInterceptors(this, epConfProps);
}
//handlers config is done later, as when this methods is called getBinding() can't
//be used without messing with the servlet destinations due to the endpoint address
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpoint.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpoint.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpoint.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "AnotherEndpoint", targetNamespace = "http://org.jboss.ws.jaxws.cxf/interceptors", serviceName = "AnotherService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface AnotherEndpoint
+{
+ String echo(String input);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpoint.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpointImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpointImpl.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.annotation.Resource;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.interceptor.InInterceptors;
+import org.apache.cxf.message.Message;
+import org.jboss.logging.Logger;
+
+@WebService(name = "AnotherEndpoint", targetNamespace = "http://org.jboss.ws.jaxws.cxf/interceptors", serviceName = "AnotherService", portName = "AnotherEndpointPort")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@InInterceptors(interceptors="org.jboss.test.ws.jaxws.cxf.interceptors.DeclaredInterceptor")
+public class AnotherEndpointImpl
+{
+ private static AtomicInteger counter = new AtomicInteger(0);
+
+ @Resource
+ WebServiceContext ctx;
+
+ @WebMethod
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo:." + input);
+ Message cxfMessage = (Message)ctx.getMessageContext().get(Message.class.getName());
+ cxfMessage.getExchange().put(Counter.class, new Counter()
+ {
+ @Override
+ public void increment()
+ {
+ counter.incrementAndGet();
+ }
+ });
+ return input + "." + cxfMessage.get(StringBuilder.class) + "." + counter.get();
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/AnotherEndpointImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusCounterInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusCounterInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusCounterInterceptor.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class BusCounterInterceptor extends AbstractPhaseInterceptor<Message>
+{
+ public BusCounterInterceptor()
+ {
+ super(Phase.SETUP);
+ }
+
+ public void handleMessage(Message message) throws Fault
+ {
+ Counter c = message.getExchange().get(Counter.class);
+ if (c != null) {
+ c.increment();
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusCounterInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusInterceptor.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class BusInterceptor extends AbstractPhaseInterceptor<Message>
+{
+ public BusInterceptor()
+ {
+ super(Phase.RECEIVE);
+ }
+
+ public void handleMessage(Message message) throws Fault
+ {
+ String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
+ if (!method.equals("POST"))
+ {
+ return;
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append("Foo");
+ message.put(StringBuilder.class, sb);
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/BusInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Counter.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Counter.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Counter.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+
+public interface Counter
+{
+ public void increment();
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Counter.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/DeclaredInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/DeclaredInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/DeclaredInterceptor.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class DeclaredInterceptor extends AbstractPhaseInterceptor<Message>
+{
+ public DeclaredInterceptor()
+ {
+ super(Phase.READ);
+ }
+
+ public void handleMessage(Message message) throws Fault
+ {
+ StringBuilder sb = message.get(StringBuilder.class);
+ if (sb == null) {
+ sb = new StringBuilder();
+ message.put(StringBuilder.class, sb);
+ }
+ sb.append("!");
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/DeclaredInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Endpoint.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Endpoint.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Endpoint.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "MyEndpoint", targetNamespace = "http://org.jboss.ws.jaxws.cxf/interceptors", serviceName = "MyService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint
+{
+ String echo(String input);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/Endpoint.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointCounterInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointCounterInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointCounterInterceptor.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class EndpointCounterInterceptor extends AbstractPhaseInterceptor<Message>
+{
+ public EndpointCounterInterceptor()
+ {
+ super(Phase.SETUP);
+ }
+
+ public void handleMessage(Message message) throws Fault
+ {
+ Counter c = message.getExchange().get(Counter.class);
+ if (c != null) {
+ c.increment();
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointCounterInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointImpl.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.annotation.Resource;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.interceptor.InInterceptors;
+import org.apache.cxf.message.Message;
+import org.jboss.logging.Logger;
+
+@WebService(name = "MyEndpoint", targetNamespace = "http://org.jboss.ws.jaxws.cxf/interceptors", serviceName = "MyService", portName = "MyEndpointPort")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@InInterceptors(interceptors="org.jboss.test.ws.jaxws.cxf.interceptors.DeclaredInterceptor")
+public class EndpointImpl
+{
+ private static AtomicInteger counter = new AtomicInteger(0);
+
+ @Resource
+ WebServiceContext ctx;
+
+ @WebMethod
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo: " + input);
+ Message cxfMessage = (Message)ctx.getMessageContext().get(Message.class.getName());
+ cxfMessage.getExchange().put(Counter.class, new Counter()
+ {
+ @Override
+ public void increment()
+ {
+ counter.incrementAndGet();
+ }
+ });
+ return input + " " + cxfMessage.get(StringBuilder.class) + " " + counter.get();
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointInterceptor.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class EndpointInterceptor extends AbstractPhaseInterceptor<Message>
+{
+ public EndpointInterceptor()
+ {
+ super(Phase.RECEIVE);
+ addAfter(BusInterceptor.class.getName());
+ }
+
+ public void handleMessage(Message message) throws Fault
+ {
+ StringBuilder sb = message.get(StringBuilder.class);
+ if (sb == null) {
+ sb = new StringBuilder();
+ message.put(StringBuilder.class, sb);
+ }
+ sb.append("Bar");
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/EndpointInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/InterceptorsTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/InterceptorsTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/InterceptorsTestCase.java 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.interceptors;
+
+import java.io.File;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+
+/**
+ * Testcase for:
+ * [JBWS-3837] Apache CXF interceptors setup through properties
+ * [JBWS-3840] jboss-webservices.xml support for Apache CXF interceptor properties
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Oct-2014
+ */
+public class InterceptorsTestCase extends JBossWSTest
+{
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-interceptors.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.apache.cxf\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.EndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.AnotherEndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.BusInterceptor.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.BusCounterInterceptor.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.DeclaredInterceptor.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.EndpointInterceptor.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.EndpointCounterInterceptor.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.interceptors.Counter.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/interceptors/WEB-INF/jboss-webservices.xml"), "jboss-webservices.xml")
+ .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/interceptors/WEB-INF/jaxws-endpoint-config.xml"));
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(InterceptorsTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
+ }
+
+ public void testEndpointWithBothBusAndEndpointInterceptors() throws Exception {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-interceptors/MyService" + "?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://org.jboss.ws.jaxws.cxf/interceptors", "MyService"));
+ Endpoint port = service.getPort(new QName("http://org.jboss.ws.jaxws.cxf/interceptors", "MyEndpointPort"), Endpoint.class);
+ assertEquals("Hi FooBar! 0", port.echo("Hi"));
+ assertEquals("Hi FooBar! 2", port.echo("Hi"));
+ assertEquals("Hi FooBar! 4", port.echo("Hi"));
+ assertEquals("Hi FooBar! 6", port.echo("Hi"));
+ }
+
+ public void testEndpointWithBusInterceptorsOnly() throws Exception {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-interceptors/AnotherService" + "?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://org.jboss.ws.jaxws.cxf/interceptors", "AnotherService"));
+ AnotherEndpoint port = service.getPort(new QName("http://org.jboss.ws.jaxws.cxf/interceptors", "AnotherEndpointPort"), AnotherEndpoint.class);
+ assertEquals("Hi.Foo!.0", port.echo("Hi"));
+ assertEquals("Hi.Foo!.1", port.echo("Hi"));
+ assertEquals("Hi.Foo!.2", port.echo("Hi"));
+ assertEquals("Hi.Foo!.3", port.echo("Hi"));
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/interceptors/InterceptorsTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jaxws-endpoint-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jaxws-endpoint-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jaxws-endpoint-config.xml 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+ <config-name>org.jboss.test.ws.jaxws.cxf.interceptors.EndpointImpl</config-name>
+ <property>
+ <property-name>cxf.interceptors.in</property-name>
+ <property-value>org.jboss.test.ws.jaxws.cxf.interceptors.EndpointInterceptor</property-value>
+ </property>
+ <property>
+ <property-name>cxf.interceptors.out</property-name>
+ <property-value>org.jboss.test.ws.jaxws.cxf.interceptors.EndpointCounterInterceptor</property-value>
+ </property>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jaxws-endpoint-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jboss-webservices.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jboss-webservices.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jboss-webservices.xml 2014-10-10 14:50:24 UTC (rev 18981)
@@ -0,0 +1,17 @@
+<?xml version="1.1" encoding="UTF-8"?>
+<webservices
+ xmlns="http://www.jboss.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="1.2"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">
+
+ <property>
+ <name>cxf.interceptors.in</name>
+ <value>org.jboss.test.ws.jaxws.cxf.interceptors.BusInterceptor</value>
+ </property>
+ <property>
+ <name>cxf.interceptors.out</name>
+ <value>org.jboss.test.ws.jaxws.cxf.interceptors.BusCounterInterceptor</value>
+ </property>
+
+</webservices>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/interceptors/WEB-INF/jboss-webservices.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 2 months
JBossWS SVN: r18980 - in stack/cxf/trunk/modules/client/src: test/java/org/jboss/wsf/stack/cxf/client and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-10 05:48:12 -0400 (Fri, 10 Oct 2014)
New Revision: 18980
Added:
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/EndpointInterface.java
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorA.java
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorB.java
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorC.java
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorD.java
stack/cxf/trunk/modules/client/src/test/resources/META-INF/TestService.wsdl
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
Log:
[JBWS-3837] Adding a bunch of tests
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-07 16:29:15 UTC (rev 18979)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-10 09:48:12 UTC (rev 18980)
@@ -60,6 +60,10 @@
public void setConfigProperties(Object client, String configFile, String configName) {
Class<?> clazz = !(client instanceof Dispatch) ? client.getClass() : null;
ClientConfig config = readConfig(configFile, configName, clazz);
+ setConfigProperties(client, config);
+ }
+
+ protected void setConfigProperties(Object client, ClientConfig config) {
Client cxfClient;
if (client instanceof DispatchImpl<?>) {
cxfClient = ((DispatchImpl<?>)client).getClient();
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java 2014-10-10 09:48:12 UTC (rev 18980)
@@ -0,0 +1,373 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.Interceptor;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.stack.cxf.client.Constants;
+
+/**
+ * A test case for the CXFClientConfigurer
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Oct-2014
+ *
+ */
+public class CXFClientConfigurerTest extends TestCase
+{
+ public void testSetMapOfProperties() throws Exception
+ {
+ Bus bus = null;
+ try {
+ bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+
+ Service service = Service.create(this.getClass().getResource("META-INF/TestService.wsdl"), new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService"));
+ EndpointInterface port = service.getPort(new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointInterfacePort"), EndpointInterface.class);
+ Client client = ClientProxy.getClient(port);
+
+ CXFClientConfigurer cfg = new CXFClientConfigurer();
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put("A", "1");
+ properties.put("B", "2");
+ properties.put("C", "3");
+ properties.put("D", "4");
+ properties.put("E", "5");
+
+ cfg.setConfigProperties(client, properties);
+
+ assertEquals("1", client.getEndpoint().get("A"));
+ assertEquals("2", client.getEndpoint().get("B"));
+ assertEquals("3", client.getEndpoint().get("C"));
+ assertEquals("4", client.getEndpoint().get("D"));
+ assertEquals("5", client.getEndpoint().get("E"));
+ assertEquals(5, client.getEndpoint().size());
+
+ properties = new HashMap<String, String>();
+ properties.put("E", "10");
+ properties.put("F", "20");
+ properties.put("G", "30");
+
+ cfg.setConfigProperties(client, properties);
+
+ assertEquals("10", client.getEndpoint().get("E"));
+ assertEquals("20", client.getEndpoint().get("F"));
+ assertEquals("30", client.getEndpoint().get("G"));
+ assertEquals(7, client.getEndpoint().size());
+ } finally {
+ if (bus != null) {
+ bus.shutdown(true);
+ }
+ }
+ }
+
+ public void testSetConfigProperties() throws Exception
+ {
+ Bus bus = null;
+ try {
+ bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+
+ Service service = Service.create(this.getClass().getResource("META-INF/TestService.wsdl"), new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService"));
+ EndpointInterface port = service.getPort(new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointInterfacePort"), EndpointInterface.class);
+ Client client = ClientProxy.getClient(port);
+
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put("A", "1");
+ properties.put("B", "2");
+ properties.put("C", "3");
+ properties.put("D", "4");
+ properties.put("E", "5");
+ ClientConfig clientConfig = new ClientConfig("Foo", null, null, properties, null);
+
+ CXFClientConfigurer cfg = new CXFClientConfigurer();
+
+ cfg.setConfigProperties(port, clientConfig);
+
+ assertEquals("1", client.getEndpoint().get("A"));
+ assertEquals("2", client.getEndpoint().get("B"));
+ assertEquals("3", client.getEndpoint().get("C"));
+ assertEquals("4", client.getEndpoint().get("D"));
+ assertEquals("5", client.getEndpoint().get("E"));
+
+
+ properties = new HashMap<String, String>();
+ properties.put("E", "10");
+ properties.put("F", "20");
+ properties.put("G", "30");
+ clientConfig = new ClientConfig("Foo2", null, null, properties, null);
+
+ cfg.setConfigProperties(port, clientConfig);
+
+ assertEquals(null, client.getEndpoint().get("A"));
+ assertEquals(null, client.getEndpoint().get("B"));
+ assertEquals(null, client.getEndpoint().get("C"));
+ assertEquals(null, client.getEndpoint().get("D"));
+ assertEquals("10", client.getEndpoint().get("E"));
+ assertEquals("20", client.getEndpoint().get("F"));
+ assertEquals("30", client.getEndpoint().get("G"));
+ } finally {
+ if (bus != null) {
+ bus.shutdown(true);
+ }
+ }
+ }
+
+ public void testAddInterceptors() throws Exception
+ {
+ Bus bus = null;
+ try {
+ bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+
+ Service service = Service.create(this.getClass().getResource("META-INF/TestService.wsdl"), new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService"));
+ EndpointInterface port = service.getPort(new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointInterfacePort"), EndpointInterface.class);
+ Client client = ClientProxy.getClient(port);
+
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorA org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
+ properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorC,org.jboss.wsf.stack.cxf.client.configuration.InterceptorD");
+
+ CXFClientConfigurer cfg = new CXFClientConfigurer();
+
+ cfg.addInterceptors(client, properties);
+
+ List<String> interceptors = toNameList(client.getInInterceptors());
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ interceptors = toNameList(client.getOutInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+
+
+ properties = new HashMap<String, String>();
+ properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorD, FooInterceptor");
+ properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
+
+ cfg.addInterceptors(client, properties);
+
+ interceptors = toNameList(client.getInInterceptors());
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ assertFalse(interceptors.contains("FooInterceptor"));
+ interceptors = toNameList(client.getOutInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ } finally {
+ if (bus != null) {
+ bus.shutdown(true);
+ }
+ }
+ }
+
+ public void testAddInterceptorsThroughSetMapOfProperties() throws Exception
+ {
+ Bus bus = null;
+ try {
+ bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+
+ Service service = Service.create(this.getClass().getResource("META-INF/TestService.wsdl"), new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService"));
+ EndpointInterface port = service.getPort(new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointInterfacePort"), EndpointInterface.class);
+ Client client = ClientProxy.getClient(port);
+
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put("A", "1");
+ properties.put("B", "2");
+ properties.put("C", "3");
+ properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorA org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
+ properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorC,org.jboss.wsf.stack.cxf.client.configuration.InterceptorD");
+
+ CXFClientConfigurer cfg = new CXFClientConfigurer();
+
+ cfg.setConfigProperties(client, properties);
+
+ assertEquals("1", client.getEndpoint().get("A"));
+ assertEquals("2", client.getEndpoint().get("B"));
+ assertEquals("3", client.getEndpoint().get("C"));
+ List<String> interceptors = toNameList(client.getInInterceptors());
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ interceptors = toNameList(client.getOutInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+
+
+ properties = new HashMap<String, String>();
+ properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorD, FooInterceptor");
+ properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
+
+ cfg.addInterceptors(client, properties);
+
+ assertEquals("1", client.getEndpoint().get("A"));
+ assertEquals("2", client.getEndpoint().get("B"));
+ assertEquals("3", client.getEndpoint().get("C"));
+ interceptors = toNameList(client.getInInterceptors());
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ assertFalse(interceptors.contains("FooInterceptor"));
+ interceptors = toNameList(client.getOutInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ } finally {
+ if (bus != null) {
+ bus.shutdown(true);
+ }
+ }
+ }
+
+ public void testAddInterceptorsThroughSetConfigProperties() throws Exception
+ {
+ Bus bus = null;
+ try {
+ bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+
+ Service service = Service.create(this.getClass().getResource("META-INF/TestService.wsdl"), new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService"));
+ EndpointInterface port = service.getPort(new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointInterfacePort"), EndpointInterface.class);
+ Client client = ClientProxy.getClient(port);
+
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put("A", "1");
+ properties.put("B", "2");
+ properties.put("C", "3");
+ properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorA org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
+ properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorC,org.jboss.wsf.stack.cxf.client.configuration.InterceptorD");
+ ClientConfig clientConfig = new ClientConfig("Foo", null, null, properties, null);
+
+ CXFClientConfigurer cfg = new CXFClientConfigurer();
+
+ cfg.setConfigProperties(port, clientConfig);
+
+ assertEquals("1", client.getEndpoint().get("A"));
+ assertEquals("2", client.getEndpoint().get("B"));
+ assertEquals("3", client.getEndpoint().get("C"));
+ List<String> interceptors = toNameList(client.getInInterceptors());
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ interceptors = toNameList(client.getOutInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+
+
+ properties = new HashMap<String, String>();
+ properties.put("E", "10");
+ properties.put("F", "20");
+ properties.put("G", "30");
+ properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorD, FooInterceptor");
+ properties.put(Constants.CXF_OUT_INTERCEPTORS_PROP, "org.jboss.wsf.stack.cxf.client.configuration.InterceptorB");
+ clientConfig = new ClientConfig("Foo2", null, null, properties, null);
+
+ cfg.setConfigProperties(port, clientConfig);
+
+ assertEquals(null, client.getEndpoint().get("A"));
+ assertEquals(null, client.getEndpoint().get("B"));
+ assertEquals(null, client.getEndpoint().get("C"));
+ assertEquals(null, client.getEndpoint().get("D"));
+ assertEquals("10", client.getEndpoint().get("E"));
+ assertEquals("20", client.getEndpoint().get("F"));
+ assertEquals("30", client.getEndpoint().get("G"));
+ interceptors = toNameList(client.getInInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ interceptors = toNameList(client.getOutInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertTrue(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+
+ properties = new HashMap<String, String>();
+ properties.put(Constants.CXF_IN_INTERCEPTORS_PROP, "");
+ clientConfig = new ClientConfig("Foo2", null, null, properties, null);
+
+ cfg.setConfigProperties(port, clientConfig);
+
+ assertEquals(null, client.getEndpoint().get("A"));
+ assertEquals(null, client.getEndpoint().get("B"));
+ assertEquals(null, client.getEndpoint().get("C"));
+ assertEquals(null, client.getEndpoint().get("D"));
+ assertEquals(null, client.getEndpoint().get("E"));
+ assertEquals(null, client.getEndpoint().get("F"));
+ assertEquals(null, client.getEndpoint().get("G"));
+ interceptors = toNameList(client.getInInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+ interceptors = toNameList(client.getOutInterceptors());
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorA"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorB"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorC"));
+ assertFalse(interceptors.contains("org.jboss.wsf.stack.cxf.client.configuration.InterceptorD"));
+
+ } finally {
+ if (bus != null) {
+ bus.shutdown(true);
+ }
+ }
+ }
+
+ private static List<String> toNameList(Collection<Interceptor<?>> interceptors) {
+ List<String> list = new ArrayList<String>();
+ for (Interceptor<?> interceptor : interceptors) {
+ list.add(interceptor.getClass().getName());
+ }
+ return list;
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurerTest.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/EndpointInterface.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/EndpointInterface.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/EndpointInterface.java 2014-10-10 09:48:12 UTC (rev 18980)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", name = "EndpointInterface")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointInterface {
+
+ @WebResult(name = "return", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", partName = "return")
+ @WebMethod
+ public java.lang.String echo(@WebParam(partName = "arg0", name = "arg0")
+ java.lang.String arg0
+ );
+}
Property changes on: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/EndpointInterface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorA.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorA.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorA.java 2014-10-10 09:48:12 UTC (rev 18980)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+
+public class InterceptorA implements Interceptor<Message> {
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handleFault(Message message)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorA.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorB.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorB.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorB.java 2014-10-10 09:48:12 UTC (rev 18980)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+
+public class InterceptorB implements Interceptor<Message> {
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handleFault(Message message)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorB.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorC.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorC.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorC.java 2014-10-10 09:48:12 UTC (rev 18980)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+
+public class InterceptorC implements Interceptor<Message> {
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handleFault(Message message)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorC.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorD.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorD.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorD.java 2014-10-10 09:48:12 UTC (rev 18980)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.client.configuration;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+
+public class InterceptorD implements Interceptor<Message> {
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handleFault(Message message)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/configuration/InterceptorD.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/test/resources/META-INF/TestService.wsdl
===================================================================
--- stack/cxf/trunk/modules/client/src/test/resources/META-INF/TestService.wsdl (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/resources/META-INF/TestService.wsdl 2014-10-10 09:48:12 UTC (rev 18980)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="EndpointService" targetNamespace="http://www.openuri.org/2004/04/HelloWorld" xmlns:tns="http://www.openuri.org/2004/04/HelloWorld" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types/>
+ <message name="EndpointInterface_echo">
+ <part name="arg0" type="xsd:string"/>
+ </message>
+ <message name="EndpointInterface_echoResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <portType name="EndpointInterface">
+ <operation name="echo" parameterOrder="arg0">
+ <input message="tns:EndpointInterface_echo"/>
+ <output message="tns:EndpointInterface_echoResponse"/>
+ </operation>
+ </portType>
+ <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://www.openuri.org/2004/04/HelloWorld"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://www.openuri.org/2004/04/HelloWorld"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="EndpointService">
+ <port name="EndpointInterfacePort" binding="tns:EndpointInterfaceBinding">
+ <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+</definitions>
Property changes on: stack/cxf/trunk/modules/client/src/test/resources/META-INF/TestService.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 2 months
JBossWS SVN: r18979 - in stack/cxf/trunk/modules: client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-07 12:29:15 -0400 (Tue, 07 Oct 2014)
New Revision: 18979
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml
Log:
[JBWS-3837] Apache CXF interceptors setup through properties
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2014-10-07 10:27:01 UTC (rev 18978)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2014-10-07 16:29:15 UTC (rev 18979)
@@ -40,6 +40,8 @@
public static final String CXF_QUEUE_LOW_WATER_MARK_PROP = "lowWaterMark";
public static final String CXF_QUEUE_DEQUEUE_TIMEOUT_PROP = "dequeueTimeout";
public static final String CXF_POLICY_ALTERNATIVE_SELECTOR_PROP = "cxf.policy.alternativeSelector";
+ public static final String CXF_IN_INTERCEPTORS_PROP = "cxf.interceptors.in";
+ public static final String CXF_OUT_INTERCEPTORS_PROP = "cxf.interceptors.out";
public static final String CXF_MANAGEMENT_ENABLED = "cxf.management.enabled";
public static final String CXF_MANAGEMENT_INSTALL_RESPONSE_TIME_INTERCEPTORS = "cxf.management.installResponseTimeInterceptors";
public static final String CXF_WS_DISCOVERY_ENABLED = "cxf.ws-discovery.enabled";
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-07 10:27:01 UTC (rev 18978)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-07 16:29:15 UTC (rev 18979)
@@ -21,21 +21,29 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.StringTokenizer;
import javax.xml.ws.Dispatch;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.interceptor.InterceptorProvider;
import org.apache.cxf.jaxws.DispatchImpl;
import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.ws.common.configuration.ConfigHelper;
+import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.security.JASPIAuthenticationProvider;
import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.client.Constants;
/**
* CXF extension of common ClientConfigurer
@@ -80,6 +88,7 @@
public void setConfigProperties(Client client, Map<String, String> properties) {
client.getEndpoint().putAll(properties);
+ addInterceptors(client, properties);
}
private void savePropList(Client client, Map<String, String> props) {
@@ -92,9 +101,68 @@
String[] previousProps = (String[])ep.get(JBOSSWS_CXF_CLIENT_CONF_PROPS);
if (previousProps != null) {
for (String p : previousProps) {
+ if (Constants.CXF_IN_INTERCEPTORS_PROP.equals(p)) {
+ removeInterceptors(client.getInInterceptors(), (String)ep.get(p));
+ } else if (Constants.CXF_OUT_INTERCEPTORS_PROP.equals(p)) {
+ removeInterceptors(client.getOutInterceptors(), (String)ep.get(p));
+ }
ep.remove(p);
}
ep.remove(JBOSSWS_CXF_CLIENT_CONF_PROPS);
}
}
+
+ public void addInterceptors(InterceptorProvider interceptorProvider, Map<String, String> properties) {
+ final String inInterceptors = properties.get(Constants.CXF_IN_INTERCEPTORS_PROP);
+ if (inInterceptors != null) {
+ interceptorProvider.getInInterceptors().addAll(createInterceptors(inInterceptors));
+ }
+ final String outInterceptors = properties.get(Constants.CXF_OUT_INTERCEPTORS_PROP);
+ if (outInterceptors != null) {
+ interceptorProvider.getOutInterceptors().addAll(createInterceptors(outInterceptors));
+ }
+ }
+
+ private void removeInterceptors(List<Interceptor<?>> interceptorsList, String interceptors) {
+ Set<String> set = new HashSet<String>();
+ StringTokenizer st = new StringTokenizer(interceptors, ", ", false);
+ while (st.hasMoreTokens()) {
+ set.add(st.nextToken());
+ }
+ List<Interceptor<?>> toBeRemoved = new ArrayList<Interceptor<?>>();
+ for (Interceptor<?> itc : interceptorsList) {
+ if (set.contains(itc.getClass().getName())) {
+ toBeRemoved.add(itc);
+ }
+ }
+ interceptorsList.removeAll(toBeRemoved);
+ }
+
+ private static List<Interceptor<?>> createInterceptors(String propValue) {
+ List<Interceptor<?>> list = new ArrayList<Interceptor<?>>();
+ StringTokenizer st = new StringTokenizer(propValue, ", ", false );
+ while (st.hasMoreTokens()) {
+ String itc = st.nextToken();
+ Interceptor<?> interceptor = (Interceptor<?>)newInstance(itc);
+ if (interceptor != null) {
+ list.add(interceptor);
+ }
+ }
+ return list;
+ }
+
+ private static Object newInstance(String className)
+ {
+ try
+ {
+ ClassLoader loader = new DelegateClassLoader(ClassLoaderProvider.getDefaultProvider()
+ .getServerIntegrationClassLoader(), SecurityActions.getContextClassLoader());
+ Class<?> clazz = SecurityActions.loadClass(loader, className);
+ return clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java 2014-10-07 10:27:01 UTC (rev 18978)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java 2014-10-07 16:29:15 UTC (rev 18979)
@@ -23,6 +23,8 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
/**
*
@@ -99,6 +101,38 @@
}
/**
+ * Load a class using the provided classloader
+ *
+ * @param name
+ * @return
+ * @throws PrivilegedActionException
+ */
+ static Class<?> loadClass(final ClassLoader cl, final String name) throws PrivilegedActionException, ClassNotFoundException
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return cl.loadClass(name);
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
+ public Class<?> run() throws PrivilegedActionException
+ {
+ try
+ {
+ return cl.loadClass(name);
+ }
+ catch (Exception e)
+ {
+ throw new PrivilegedActionException(e);
+ }
+ }
+ });
+ }
+ }
+
+ /**
* Return the current value of the specified system property
*
* @param name
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-10-07 10:27:01 UTC (rev 18978)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-10-07 16:29:15 UTC (rev 18979)
@@ -33,7 +33,6 @@
import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
-import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.management.ServerConfig;
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-10-07 10:27:01 UTC (rev 18978)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-10-07 16:29:15 UTC (rev 18979)
@@ -44,6 +44,7 @@
import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.stack.cxf.Loggers;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
+import org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer;
/**
@@ -97,14 +98,17 @@
Map<String, String> epConfProps = config.getProperties();
if (!epConfProps.isEmpty())
{
- if (getProperties() == null)
+ final Map<String, Object> propMap = getProperties();
+ if (propMap == null)
{
setProperties(new HashMap<String, Object>(epConfProps));
}
else
{
- getProperties().putAll(epConfProps);
+ propMap.putAll(epConfProps);
}
+ CXFClientConfigurer helper = new CXFClientConfigurer();
+ helper.addInterceptors(this, epConfProps);
}
//handlers config is done later, as when this methods is called getBinding() can't
//be used without messing with the servlet destinations due to the endpoint address
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java 2014-10-07 10:27:01 UTC (rev 18978)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java 2014-10-07 16:29:15 UTC (rev 18979)
@@ -43,8 +43,6 @@
)
@SecurityDomain("JBossWS")
@EndpointConfig(configFile = "META-INF/jaxws-endpoint-config.xml", configName = "Custom WS-Security Endpoint")
-//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
-@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})
public class EJBServiceImpl
{
// Provide logging
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml 2014-10-07 10:27:01 UTC (rev 18978)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml 2014-10-07 16:29:15 UTC (rev 18979)
@@ -9,6 +9,10 @@
<property-name>ws-security.validate.token</property-name>
<property-value>false</property-value>
</property>
+ <property>
+ <property-name>cxf.interceptors.in</property-name>
+ <property-value>org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor</property-value>
+ </property>
</endpoint-config>
</jaxws-config>
\ No newline at end of file
10 years, 2 months
JBossWS SVN: r18978 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-07 06:27:01 -0400 (Tue, 07 Oct 2014)
New Revision: 18978
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3832] Restoring test
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-07 10:24:44 UTC (rev 18977)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-07 10:27:01 UTC (rev 18978)
@@ -850,9 +850,6 @@
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
-
- <!-- # [JBWS-3832] WFLY master still to be updated -->
- <exclude>org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCaseForked*</exclude>
</excludes>
</configuration>
</plugin>
10 years, 2 months
JBossWS SVN: r18977 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-07 06:24:44 -0400 (Tue, 07 Oct 2014)
New Revision: 18977
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3827] removing useless exclusion
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-05 19:59:44 UTC (rev 18976)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-07 10:24:44 UTC (rev 18977)
@@ -853,9 +853,6 @@
<!-- # [JBWS-3832] WFLY master still to be updated -->
<exclude>org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCaseForked*</exclude>
-
- <!-- [JBWS-3827] certificate to be resolved -->
- <exclude>org/jboss/test/ws/jaxws/cxf/jbws3827/JWBS3827TestCase</exclude>
</excludes>
</configuration>
</plugin>
10 years, 2 months
JBossWS SVN: r18976 - common/trunk/src/main/java/org/jboss/ws/common/utils.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-10-05 15:59:44 -0400 (Sun, 05 Oct 2014)
New Revision: 18976
Modified:
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
Log:
[JBWS-3827] Added check for https handling in method, publishWsdlImports
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2014-10-05 19:57:02 UTC (rev 18975)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2014-10-05 19:59:44 UTC (rev 18976)
@@ -143,7 +143,7 @@
{
String locationURI = wsdlImport.getLocationURI();
// its an external import, don't publish locally
- if (locationURI.startsWith("http://") == false)
+ if (locationURI.startsWith("http://") == false && locationURI.startsWith("https://") == false)
{
// infinity loops prevention
if (published.contains(locationURI))
10 years, 2 months
JBossWS SVN: r18974 - in stack/cxf/trunk/modules/testsuite/shared-tests/src/test: resources/jaxws/clientConfig/META-INF and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 18:05:25 -0400 (Fri, 03 Oct 2014)
New Revision: 18974
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/clientConfig/META-INF/jaxws-client-config.xml
Log:
[JBWS-3836] More tests
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2014-10-03 22:04:57 UTC (rev 18973)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2014-10-03 22:05:25 UTC (rev 18974)
@@ -48,6 +48,7 @@
list.add(new JBossWSTestHelper.JarDeployment("jaxws-clientConfig-client.jar") { {
archive
.addManifest()
+ .addAsResource("org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml", "jaxws-client-config.xml")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/clientConfig/META-INF/jaxws-client-config.xml"), "jaxws-client-config.xml");
}
});
@@ -60,6 +61,8 @@
.addClass(org.jboss.test.helper.TestServlet.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.CustomHandler.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint2.class)
+ .addAsResource("org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml", "jaxws-client-config.xml")
.addClass(org.jboss.test.ws.jaxws.clientConfig.Helper.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.LogHandler.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.RoutingHandler.class)
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03 22:04:57 UTC (rev 18973)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03 22:05:25 UTC (rev 18974)
@@ -117,7 +117,31 @@
bp.getBinding().setHandlerChain(hc);
String resStr = port.echo("Kermit");
- return ("Kermit|RoutOut|CustomOut|UserOut|LogOut|endpoint|LogIn|UserIn|CustomIn|RoutIn".equals(resStr));
+ if (!"Kermit|RoutOut|CustomOut|UserOut|LogOut|endpoint|LogIn|UserIn|CustomIn|RoutIn".equals(resStr)) {
+ return false;
+ }
+
+ Endpoint port3 = (Endpoint)service.getPort(Endpoint.class, new ClientConfigFeature("META-INF/jaxws-client-config.xml", null));
+
+ bp = (BindingProvider)port3;
+ hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ resStr = port3.echo("Kermit");
+ if (!"Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr)) {
+ return false;
+ }
+
+ Endpoint2 port2 = (Endpoint2)service.getPort(Endpoint2.class, new ClientConfigFeature(null, "My Custom Client Config"));
+
+ bp = (BindingProvider)port2;
+ hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ resStr = port2.echo("Kermit");
+ return ("Kermit|CustomOut|UserOut|endpoint|UserIn|CustomIn".equals(resStr));
}
public boolean testCustomClientConfigurationFromFileUsingFeatureOnDispatch() throws Exception
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml 2014-10-03 22:04:57 UTC (rev 18973)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml 2014-10-03 22:05:25 UTC (rev 18974)
@@ -22,5 +22,16 @@
</javaee:handler-chain>
</post-handler-chains>
</client-config>
+ <client-config>
+ <config-name>My Custom Client Config</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Routing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.clientConfig.CustomHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ </client-config>
</jaxws-config>
\ No newline at end of file
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/clientConfig/META-INF/jaxws-client-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/clientConfig/META-INF/jaxws-client-config.xml 2014-10-03 22:04:57 UTC (rev 18973)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/clientConfig/META-INF/jaxws-client-config.xml 2014-10-03 22:05:25 UTC (rev 18974)
@@ -27,6 +27,17 @@
</post-handler-chains>
</client-config>
<client-config>
+ <config-name>org.jboss.test.ws.jaxws.clientConfig.Endpoint</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Routing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.clientConfig.RoutingHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ </client-config>
+ <client-config>
<config-name>Another Client Config</config-name>
<pre-handler-chains>
<javaee:handler-chain>
10 years, 2 months
JBossWS SVN: r18973 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 18:04:57 -0400 (Fri, 03 Oct 2014)
New Revision: 18973
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
Log:
[JBWS-3836] Fix to use latest jbossws-common
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-03 22:02:20 UTC (rev 18972)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-10-03 22:04:57 UTC (rev 18973)
@@ -24,6 +24,8 @@
import java.util.Map;
import java.util.Set;
+import javax.xml.ws.Dispatch;
+
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.ClientProxy;
@@ -48,7 +50,8 @@
@Override
public void setConfigProperties(Object client, String configFile, String configName) {
- ClientConfig config = readConfig(configFile, configName);
+ Class<?> clazz = !(client instanceof Dispatch) ? client.getClass() : null;
+ ClientConfig config = readConfig(configFile, configName, clazz);
Client cxfClient;
if (client instanceof DispatchImpl<?>) {
cxfClient = ((DispatchImpl<?>)client).getClient();
10 years, 2 months