JBossWS SVN: r18146 - common/trunk/src/main/java/org/jboss/ws/common/management.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 19:46:54 -0500 (Thu, 05 Dec 2013)
New Revision: 18146
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfigMBean.java
Log:
- [JBWS-3708] Removing client/endpoint config stuff from AbstractServerConfigMBean (it was not working properly anyway and the JMX management approach is not suggested for these things)
- Removing a useless objectname
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-12-06 00:43:37 UTC (rev 18145)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-12-06 00:46:54 UTC (rev 18146)
@@ -30,9 +30,7 @@
import java.util.concurrent.CopyOnWriteArrayList;
import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.utils.AddressUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
@@ -62,12 +60,6 @@
*/
public abstract class AbstractServerConfig implements AbstractServerConfigMBean, ServerConfig
{
- protected static final ObjectName OBJECT_NAME_SERVER_CONFIG;
- static
- {
- OBJECT_NAME_SERVER_CONFIG = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- }
-
// The MBeanServer
private volatile MBeanServer mbeanServer;
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfigMBean.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfigMBean.java 2013-12-06 00:43:37 UTC (rev 18145)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfigMBean.java 2013-12-06 00:46:54 UTC (rev 18146)
@@ -21,13 +21,41 @@
*/
package org.jboss.ws.common.management;
+import java.io.File;
+import java.net.UnknownHostException;
+
import javax.management.ObjectName;
import org.jboss.ws.common.ObjectNameFactory;
-import org.jboss.wsf.spi.management.ServerConfig;
-public interface AbstractServerConfigMBean extends ServerConfig
+public interface AbstractServerConfigMBean
{
/** The object name in the MBean server */
ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+
+ String getImplementationTitle();
+
+ String getImplementationVersion();
+
+ File getHomeDir();
+
+ File getServerTempDir();
+
+ File getServerDataDir();
+
+ String getWebServiceHost();
+
+ void setWebServiceHost(String host) throws UnknownHostException;
+
+ int getWebServicePort();
+
+ void setWebServicePort(int port);
+
+ int getWebServiceSecurePort();
+
+ void setWebServiceSecurePort(int port);
+
+ boolean isModifySOAPAddress();
+
+ void setModifySOAPAddress(boolean flag);
}
11 years, 1 month
JBossWS SVN: r18145 - spi/trunk/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 19:43:37 -0500 (Thu, 05 Dec 2013)
New Revision: 18145
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java
Log:
Adding few comments on thread safety analysis
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java 2013-12-05 16:09:03 UTC (rev 18144)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java 2013-12-06 00:43:37 UTC (rev 18145)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -27,9 +27,16 @@
import java.util.Set;
/**
- * A general extendible artifact
+ * A general extendible artifact; please note the 'attachments' and 'properties' fields are not meant to be modified concurrently,
+ * as they are initialied to plain HashMap instances. Extensions of this class should override the methods accessing those fields
+ * and add synchronized keyword.
+ * Most of the time, though, there will only be a single thread writing/deleting stuff in this class at the same time, for example
+ * because that only happens during deployment processing (which executes in the same thread for deployment processors / aspects
+ * and only the last aspect installs a service for each endpoint that run very limited stuff in different threads).
+ * Visibility is ensured by the fields being final.
*
* @author Thomas.Diesler(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
* @since 20-Apr-2007
*/
public abstract class AbstractExtensible implements Extensible
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java 2013-12-05 16:09:03 UTC (rev 18144)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java 2013-12-06 00:43:37 UTC (rev 18145)
@@ -45,6 +45,10 @@
public static final String STACK_SERVLET_DELEGATE_CLASS = "org.jboss.wsf.spi.deployment.stackServletDelegateClass";
public static final String INTEGRATION_CLASSLOADER = "org.jboss.wsf.spi.deployment.integrationClassLoader";
+ //Besides for the obvious visibility consequence on the actual field, the 'volatile' keyword here also
+ //establishes a "happens-before" relationship between what happened on the WS model during deployment
+ //and the model usage for serving requests. Everything that is only written during deployment, can be
+ //safely read after this point without visibility issues related to different threads serving requests.
private volatile ServletDelegate delegate = null;
@Override
11 years, 1 month
JBossWS SVN: r18144 - stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 11:09:03 -0500 (Thu, 05 Dec 2013)
New Revision: 18144
Modified:
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java
Log:
[JBWS-3708] Restoring testcase
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2013-12-05 15:21:45 UTC (rev 18143)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2013-12-05 16:09:03 UTC (rev 18144)
@@ -35,7 +35,6 @@
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.junit.Ignore;
/**
* A testcase for verifying default schema validation configured
@@ -43,7 +42,6 @@
*
* @author alessio.soldano(a)jboss.com
*/
-@Ignore(value = "[JBWS-3708] FIXME: refactor testcase")
public class DefaultSchemaValidationTestCaseForked extends JBossWSTest
{
public static Test suite()
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java 2013-12-05 15:21:45 UTC (rev 18143)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java 2013-12-05 16:09:03 UTC (rev 18144)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxws.samples.schemavalidation;
import java.net.URL;
+import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -47,6 +48,8 @@
{
private String address;
+ private static final EndpointConfig defaultEndpointConfig = getServerConfig().getEndpointConfig(EndpointConfig.STANDARD_ENDPOINT_CONFIG);
+
public boolean testDefaultClientValidation() throws Exception
{
// first verify schema validation is not enabled yet: a wsdl with schema restrictions is used on client side,
@@ -68,10 +71,11 @@
return false;
}
+ final ClientConfig defClientConfig = (ClientConfig)getAndVerifyDefaultConfiguration(true);
// then modify default conf to enable default client schema validation
try
{
- modifyDefaultClientConfiguration(getAndVerifyDefaultConfiguration(true));
+ modifyDefaultConfiguration(true);
service = Service.create(wsdlURL, serviceName);
proxy = (Hello) service.getPort(portName, Hello.class);
@@ -94,18 +98,19 @@
finally
{
// -- restore default conf --
- cleanupConfig(true);
+ registerClientConfigAndReload(defClientConfig);
// --
}
}
public boolean enableDefaultEndpointSchemaValidation() throws Exception {
- modifyDefaultClientConfiguration(getAndVerifyDefaultConfiguration(false));
+ getAndVerifyDefaultConfiguration(false);
+ modifyDefaultConfiguration(false);
return true;
}
public boolean disableDefaultEndpointSchemaValidation() throws Exception {
- cleanupConfig(false);
+ registerEndpointConfigAndReload(defaultEndpointConfig);
return true;
}
@@ -115,10 +120,9 @@
this.address = address;
}
- protected static AbstractCommonConfig getAndVerifyDefaultConfiguration(boolean client) throws Exception {
- ServerConfig sc = getServerConfig();
+ protected AbstractCommonConfig getAndVerifyDefaultConfiguration(boolean client) throws Exception {
final String DEFCFG = client ? ClientConfig.STANDARD_CLIENT_CONFIG : EndpointConfig.STANDARD_ENDPOINT_CONFIG;
- final AbstractCommonConfig defaultConfig = client ? sc.getClientConfig(DEFCFG) : sc.getEndpointConfig(DEFCFG);
+ final AbstractCommonConfig defaultConfig = client ? getServerConfig().getClientConfig(DEFCFG) : defaultEndpointConfig;
if (defaultConfig == null) {
throw new Exception("Missing AS config '" + DEFCFG + "'!");
}
@@ -129,25 +133,28 @@
return defaultConfig;
}
- protected static void modifyDefaultClientConfiguration(AbstractCommonConfig defaultConfig) {
- //TODO
-// defaultConfig.setProperty("schema-validation-enabled", "true");
+ protected static void modifyDefaultConfiguration(final boolean client) {
+ final Map<String, String> props = new HashMap<String, String>();
+ props.put("schema-validation-enabled", "true");
+ if (client) {
+ registerClientConfigAndReload(new ClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG, null, null, props, null));
+ } else {
+ registerEndpointConfigAndReload(new EndpointConfig(EndpointConfig.STANDARD_ENDPOINT_CONFIG, null, null, props, null));
+ }
}
- protected static void cleanupConfig(boolean client) throws Exception {
+ protected static void registerClientConfigAndReload(ClientConfig config) {
ServerConfig sc = getServerConfig();
- final String DEFCFG = client ? ClientConfig.STANDARD_CLIENT_CONFIG : EndpointConfig.STANDARD_ENDPOINT_CONFIG;
- final AbstractCommonConfig defaultConfig = client ? sc.getClientConfig(DEFCFG) : sc.getEndpointConfig(DEFCFG);
- if (defaultConfig == null) {
- throw new Exception("Missing AS config '" + DEFCFG + "'!");
- }
- Map<String, String> props = defaultConfig.getProperties();
- if (props == null || props.isEmpty()) {
- throw new Exception("'" + DEFCFG + "' is already empty!");
- }
- props.clear();
+ sc.registerClientConfig(config);
+ sc.reloadClientConfigs();
}
+ protected static void registerEndpointConfigAndReload(EndpointConfig config) {
+ ServerConfig sc = getServerConfig();
+ sc.registerEndpointConfig(config);
+ sc.reloadEndpointConfigs();
+ }
+
private static ServerConfig getServerConfig()
{
final ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
11 years, 1 month
JBossWS SVN: r18143 - stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 10:21:45 -0500 (Thu, 05 Dec 2013)
New Revision: 18143
Added:
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
Modified:
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java
Log:
[JBWS-3708] Restoring some tests disabled previously (and splitting ClientConfigurationTestCase into two testcases)
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-12-05 14:50:42 UTC (rev 18142)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-12-05 15:21:45 UTC (rev 18143)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -116,52 +116,6 @@
assertEquals("1", runTestInContainer("testConfigurationChangeOnDispatch"));
}
- /**
- * Verifies the default client configuration from AS model is used
- *
- * @throws Exception
- */
- public void testDefaultClientConfigurationInContainer() throws Exception {
- if (true) {
- System.out.println("[JBWS-3708] FIXME: refactor testcase");
- return;
- }
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
- }
- }
-
- public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
- if (true) {
- System.out.println("[JBWS-3708] FIXME: refactor testcase");
- return;
- }
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
- }
- }
-
- /**
- * Verifies a client configuration from AS model can be set
- *
- * @throws Exception
- */
- public void testCustomClientConfigurationInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfiguration"));
- }
-
- public void testCustomClientConfigurationOnDispatchInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatch"));
- }
-
- public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfigurationUsingFeature"));
- }
-
- public void testCustomClientConfigurationOnDispatchUsingFeatureInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchUsingFeature"));
- }
-
// -------------------------
private Helper getHelper() {
Added: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java (rev 0)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2013-12-05 15:21:45 UTC (rev 18143)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.clientConfig;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Verifies client configuration setup (in-container tests, relying on AS model)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 31-May-2012
+ */
+public class ClientConfigurationTestCaseForked extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(ClientConfigurationTestCaseForked.class, "jaxws-clientConfig.war,jaxws-clientConfig-client.jar, jaxws-clientConfig-inContainer-client.war");
+ }
+
+ /**
+ * Verifies the default client configuration from AS model is used
+ *
+ * @throws Exception
+ */
+ public void testDefaultClientConfigurationInContainer() throws Exception {
+ if (!isTargetJBoss71()) {
+ assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
+ }
+ }
+
+ public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ if (!isTargetJBoss71()) {
+ assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
+ }
+ }
+
+ /**
+ * Verifies a client configuration from AS model can be set
+ *
+ * @throws Exception
+ */
+ public void testCustomClientConfigurationInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfiguration"));
+ }
+
+ public void testCustomClientConfigurationOnDispatchInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatch"));
+ }
+
+ public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationUsingFeature"));
+ }
+
+ public void testCustomClientConfigurationOnDispatchUsingFeatureInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchUsingFeature"));
+ }
+
+ // -------------------------
+
+ private String runTestInContainer(String test) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost()
+ + ":8080/jaxws-clientConfig-inContainer-client?path=/jaxws-clientConfig/EndpointImpl&method=" + test
+ + "&helper=" + Helper.class.getName());
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ return br.readLine();
+ }
+}
Property changes on: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2013-12-05 14:50:42 UTC (rev 18142)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2013-12-05 15:21:45 UTC (rev 18143)
@@ -38,6 +38,7 @@
import org.jboss.ws.api.configuration.ClientConfigUtil;
import org.jboss.ws.api.configuration.ClientConfigurer;
import org.jboss.ws.common.DOMUtils;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
/**
* Verifies client configuration setup
@@ -211,69 +212,69 @@
*/
public boolean testDefaultClientConfiguration() throws Exception
{
- return false;
-// QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
-// URL wsdlURL = new URL(address + "?wsdl");
-//
-// // -- modify default conf --
-// try
-// {
-// TestUtils.modifyDefaultClientConfiguration(TestUtils.getAndVerifyDefaultClientConfiguration());
-// // --
-//
-// Service service = Service.create(wsdlURL, serviceName);
-// Endpoint port = (Endpoint)service.getPort(Endpoint.class);
-//
-// BindingProvider bp = (BindingProvider)port;
-// @SuppressWarnings("rawtypes")
-// List<Handler> hc = bp.getBinding().getHandlerChain();
-// hc.add(new UserHandler());
-// bp.getBinding().setHandlerChain(hc);
-//
-// String resStr = port.echo("Kermit");
-// return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
-// }
-// finally
-// {
-// // -- restore default conf --
-// TestUtils.cleanupClientConfig();
-// // --
-// }
+ QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
+ URL wsdlURL = new URL(address + "?wsdl");
+ final ClientConfig defaultClientConfig = TestUtils.getAndVerifyDefaultClientConfiguration();
+
+ // -- modify default conf --
+ try
+ {
+ TestUtils.changeDefaultClientConfiguration();
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ BindingProvider bp = (BindingProvider)port;
+ @SuppressWarnings("rawtypes")
+ List<Handler> hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ String resStr = port.echo("Kermit");
+ return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
+ }
+ finally
+ {
+ // -- restore default conf --
+ TestUtils.setClientConfigAndReload(defaultClientConfig);
+ // --
+ }
}
public boolean testDefaultClientConfigurationOnDispatch() throws Exception
{
- return false;
-// final String reqString = "<ns1:echo xmlns:ns1=\"http://clientConfig.jaxws.ws.test.jboss.org/\"><arg0>Kermit</arg0></ns1:echo>";
-// QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
-// QName portName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointPort");
-// URL wsdlURL = new URL(address + "?wsdl");
-//
-// // -- modify default conf --
-// try
-// {
-// TestUtils.modifyDefaultClientConfiguration(TestUtils.getAndVerifyDefaultClientConfiguration());
-// // --
-//
-// Service service = Service.create(wsdlURL, serviceName);
-// Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
-//
-// BindingProvider bp = (BindingProvider)dispatch;
-// @SuppressWarnings("rawtypes")
-// List<Handler> hc = bp.getBinding().getHandlerChain();
-// hc.add(new UserHandler());
-// bp.getBinding().setHandlerChain(hc);
-//
-// Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
-// String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
-// return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
-// }
-// finally
-// {
-// // -- restore default conf --
-// TestUtils.cleanupClientConfig();
-// // --
-// }
+ final String reqString = "<ns1:echo xmlns:ns1=\"http://clientConfig.jaxws.ws.test.jboss.org/\"><arg0>Kermit</arg0></ns1:echo>";
+ QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
+ QName portName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointPort");
+ URL wsdlURL = new URL(address + "?wsdl");
+ final ClientConfig defaultClientConfig = TestUtils.getAndVerifyDefaultClientConfiguration();
+
+ // -- modify default conf --
+ try
+ {
+ TestUtils.changeDefaultClientConfiguration();
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+
+ BindingProvider bp = (BindingProvider)dispatch;
+ @SuppressWarnings("rawtypes")
+ List<Handler> hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
+ String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
+ return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
+ }
+ finally
+ {
+ // -- restore default conf --
+ TestUtils.setClientConfigAndReload(defaultClientConfig);
+ // --
+ }
}
/**
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java 2013-12-05 14:50:42 UTC (rev 18142)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java 2013-12-05 15:21:45 UTC (rev 18143)
@@ -58,42 +58,27 @@
return defaultConfig;
}
-// public static void modifyDefaultClientConfiguration(ClientConfig defaultConfig) {
-// UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.clientConfig.LogHandler", "Log Handler", null, null, null, null);
-// UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
-// List<UnifiedHandlerChainMetaData> postHC = new LinkedList<UnifiedHandlerChainMetaData>();
-// postHC.add(uhcmd);
-// defaultConfig.setPostHandlerChains(postHC);
-// }
-//
-// public static void cleanupClientConfig() throws Exception {
-// ServerConfig sc = getServerConfig();
-// ClientConfig defaultConfig = null;
-// for (ClientConfig c : sc.getClientConfigs()) {
-// if (ClientConfig.STANDARD_CLIENT_CONFIG.equals(c.getConfigName())) {
-// defaultConfig = c;
-// }
-// }
-// if (defaultConfig == null) {
-// throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
-// }
-// List<UnifiedHandlerChainMetaData> preHC = defaultConfig.getPreHandlerChains();
-// List<UnifiedHandlerChainMetaData> postHC = defaultConfig.getPostHandlerChains();
-// if ((preHC == null || preHC.isEmpty()) && (postHC == null || postHC.isEmpty())) {
-// throw new Exception("'" + ClientConfig.STANDARD_CLIENT_CONFIG + "' is already empty!");
-// }
-// defaultConfig.setPostHandlerChains(null);
-// defaultConfig.setPreHandlerChains(null);
-// }
+ public static void changeDefaultClientConfiguration() {
+ UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.clientConfig.LogHandler", "Log Handler", null, null, null, null);
+ UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
+ List<UnifiedHandlerChainMetaData> postHC = Collections.singletonList(uhcmd);
+
+ ClientConfig newDefaultClientConfig = new ClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG, null, postHC, null, null);
+ setClientConfigAndReload(newDefaultClientConfig);
+ }
+ public static void setClientConfigAndReload(ClientConfig config) {
+ ServerConfig sc = getServerConfig();
+ sc.registerClientConfig(config);
+ sc.reloadClientConfigs();
+ }
+
public static void addTestCaseClientConfiguration(String testConfigName) {
UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.clientConfig.RoutingHandler", "Routing Handler", null, null, null, null);
UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
List<UnifiedHandlerChainMetaData> preHC = new LinkedList<UnifiedHandlerChainMetaData>();
preHC.add(uhcmd);
- ServerConfig sc = getServerConfig();
- sc.registerClientConfig(new ClientConfig(testConfigName, preHC, null, null, null));
- sc.reloadClientConfigs();
+ setClientConfigAndReload(new ClientConfig(testConfigName, preHC, null, null, null));
}
public static void removeTestCaseClientConfiguration(String testConfigName) {
11 years, 1 month
JBossWS SVN: r18142 - stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 09:50:42 -0500 (Thu, 05 Dec 2013)
New Revision: 18142
Added:
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java
Modified:
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java
Log:
[JBWS-3708] Restoring some tests disabled previously (and splitting CXFClientConfigurationTestCase into two testcases)
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-12-05 14:49:08 UTC (rev 18141)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-12-05 14:50:42 UTC (rev 18142)
@@ -100,53 +100,7 @@
public void testConfigurationChangeOnDispatchInContainer() throws Exception {
assertEquals("1", runTestInContainer("testConfigurationChangeOnDispatch"));
}
-
- /**
- * Verifies the default client configuration from AS model is used
- *
- * @throws Exception
- */
- public void testDefaultClientConfigurationInContainer() throws Exception {
- if (true) {
- System.out.println("[JBWS-3708] FIXME: refactor testcase");
- return;
- }
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
- }
- }
- public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
- if (true) {
- System.out.println("[JBWS-3708] FIXME: refactor testcase");
- return;
- }
- if (!isTargetJBoss71()) {
- assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
- }
- }
-
- /**
- * Verifies a client configuration from AS model can be set
- *
- * @throws Exception
- */
- public void testCustomClientConfigurationInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfiguration"));
- }
-
- public void testCustomClientConfigurationOnDispatchInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatch"));
- }
-
- public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfigurationUsingFeature"));
- }
-
- public void testCustomClientConfigurationOnDispatchUsingFeatureInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchUsingFeature"));
- }
-
// -------------------------
private Helper getHelper() {
Added: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java (rev 0)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java 2013-12-05 14:50:42 UTC (rev 18142)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.clientConfig;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Verifies client configuration setup (in-container tests, relying on AS model)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 31-May-2012
+ */
+public class CXFClientConfigurationTestCaseForked extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(CXFClientConfigurationTestCaseForked.class, "jaxws-cxf-clientConfig.war,jaxws-cxf-clientConfig-client.jar,jaxws-cxf-clientConfig-inContainer-client.war");
+ }
+
+ /**
+ * Verifies the default client configuration from AS model is used
+ *
+ * @throws Exception
+ */
+ public void testDefaultClientConfigurationInContainer() throws Exception {
+ if (!isTargetJBoss71()) {
+ assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
+ }
+ }
+
+ public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ if (!isTargetJBoss71()) {
+ assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
+ }
+ }
+
+ /**
+ * Verifies a client configuration from AS model can be set
+ *
+ * @throws Exception
+ */
+ public void testCustomClientConfigurationInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfiguration"));
+ }
+
+ public void testCustomClientConfigurationOnDispatchInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatch"));
+ }
+
+ public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationUsingFeature"));
+ }
+
+ public void testCustomClientConfigurationOnDispatchUsingFeatureInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchUsingFeature"));
+ }
+
+ // -------------------------
+
+ private String runTestInContainer(String test) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost()
+ + ":8080/jaxws-cxf-clientConfig-inContainer-client?path=/jaxws-cxf-clientConfig/EndpointImpl&method=" + test
+ + "&helper=" + Helper.class.getName());
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ return br.readLine();
+ }
+}
Property changes on: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-12-05 14:49:08 UTC (rev 18141)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-12-05 14:50:42 UTC (rev 18142)
@@ -22,6 +22,8 @@
package org.jboss.test.ws.jaxws.cxf.clientConfig;
import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
@@ -34,6 +36,7 @@
import org.jboss.ws.api.configuration.ClientConfigFeature;
import org.jboss.ws.api.configuration.ClientConfigUtil;
import org.jboss.ws.api.configuration.ClientConfigurer;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.test.ClientHelper;
/**
@@ -138,50 +141,55 @@
*/
public boolean testDefaultClientConfiguration() throws Exception
{
- return false; //TODO
-// final URL wsdlURL = new URL(address + "?wsdl");
-//
-// // -- modify default conf --
-// try
-// {
-// TestUtils.getAndVerifyDefaultClientConfiguration().setProperty("propA", "valueA");
-// // --
-//
-// Service service = Service.create(wsdlURL, serviceName);
-// Endpoint port = (Endpoint)service.getPort(Endpoint.class);
-//
-// return (ClientProxy.getClient(port).getEndpoint().get("propA").equals("valueA"));
-// }
-// finally
-// {
-// // -- restore default conf --
-// TestUtils.cleanupClientConfig();
-// // --
-// }
+ final URL wsdlURL = new URL(address + "?wsdl");
+ final ClientConfig defaultClientConfig = TestUtils.getAndVerifyDefaultClientConfiguration();
+
+ // -- modify default conf --
+ try
+ {
+
+ final Map<String, String> props = new HashMap<String, String>();
+ props.put("propA", "valueA");
+ TestUtils.registerClientConfigAndReload(new ClientConfig(defaultClientConfig.getConfigName(), null, null, props, null));
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ return (ClientProxy.getClient(port).getEndpoint().get("propA").equals("valueA"));
+ }
+ finally
+ {
+ // -- restore default conf --
+ TestUtils.registerClientConfigAndReload(defaultClientConfig);
+ // --
+ }
}
public boolean testDefaultClientConfigurationOnDispatch() throws Exception
{
- return false; //TODO
-// final URL wsdlURL = new URL(address + "?wsdl");
-//
-// // -- modify default conf --
-// try
-// {
-// TestUtils.getAndVerifyDefaultClientConfiguration().setProperty("propA", "valueA");
-// // --
-//
-// Service service = Service.create(wsdlURL, serviceName);
-// Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
-//
-// return (((DispatchImpl<SOAPMessage>)dispatch).getClient().getEndpoint().get("propA").equals("valueA"));
-// }
-// finally
-// {
-// // -- restore default conf --
-// TestUtils.cleanupClientConfig();
-// // --
-// }
+ final URL wsdlURL = new URL(address + "?wsdl");
+ final ClientConfig defaultClientConfig = TestUtils.getAndVerifyDefaultClientConfiguration();
+
+ // -- modify default conf --
+ try
+ {
+ final Map<String, String> props = new HashMap<String, String>();
+ props.put("propA", "valueA");
+ TestUtils.registerClientConfigAndReload(new ClientConfig(defaultClientConfig.getConfigName(), null, null, props, null));
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
+
+ return (((DispatchImpl<SOAPMessage>)dispatch).getClient().getEndpoint().get("propA").equals("valueA"));
+ }
+ finally
+ {
+ // -- restore default conf --
+ TestUtils.registerClientConfigAndReload(defaultClientConfig);
+ // --
+ }
}
/**
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java 2013-12-05 14:49:08 UTC (rev 18141)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java 2013-12-05 14:50:42 UTC (rev 18142)
@@ -52,24 +52,15 @@
return defaultConfig;
}
- public static void cleanupClientConfig() throws Exception {
+ public static void registerClientConfigAndReload(ClientConfig config) {
ServerConfig sc = getServerConfig();
- ClientConfig defaultConfig = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
- if (defaultConfig == null) {
- throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
- }
- Map<String, String> props = defaultConfig.getProperties();
- if (props == null || props.isEmpty()) {
- throw new Exception("'" + ClientConfig.STANDARD_CLIENT_CONFIG + "' property set is already empty!");
- }
- props.clear();
+ sc.registerClientConfig(config);
+ sc.reloadClientConfigs();
}
public static void addTestCaseClientConfiguration(String testConfigName) {
ClientConfig config = new ClientConfig(testConfigName, null, null, Collections.singletonMap("propT", "valueT"), null);
- ServerConfig sc = getServerConfig();
- sc.registerClientConfig(config);
- sc.reloadClientConfigs();
+ registerClientConfigAndReload(config);
}
public static void removeTestCaseClientConfiguration(String testConfigName) {
11 years, 1 month
JBossWS SVN: r18141 - spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 09:49:08 -0500 (Thu, 05 Dec 2013)
New Revision: 18141
Modified:
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
Log:
minor change of parameter names
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2013-12-05 10:44:03 UTC (rev 18140)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2013-12-05 14:49:08 UTC (rev 18141)
@@ -75,21 +75,21 @@
}
}
- protected AbstractCommonConfig(AbstractCommonConfig base, AbstractCommonConfig conf)
+ protected AbstractCommonConfig(AbstractCommonConfig base, AbstractCommonConfig addon)
{
super();
this.configName = base.getConfigName();
- if (conf.features != null && !conf.features.isEmpty())
+ if (addon.features != null && !addon.features.isEmpty())
{
Map<String, Feature> map;
if (base.features.isEmpty())
{
- map = conf.features;
+ map = addon.features;
}
else
{
map = new HashMap<String, Feature>(base.features);
- map.putAll(conf.features);
+ map.putAll(addon.features);
}
this.features = Collections.unmodifiableMap(map);
}
@@ -97,17 +97,17 @@
{
this.features = Collections.emptyMap();
}
- if (conf.properties != null && !conf.properties.isEmpty())
+ if (addon.properties != null && !addon.properties.isEmpty())
{
Map<String, String> map;
if (base.properties.isEmpty())
{
- map = conf.properties;
+ map = addon.properties;
}
else
{
map = new HashMap<String, String>(base.properties);
- map.putAll(conf.properties);
+ map.putAll(addon.properties);
}
this.properties = Collections.unmodifiableMap(map);
}
@@ -115,17 +115,17 @@
{
this.properties = Collections.emptyMap();
}
- if (conf.preHandlerChains != null && !conf.preHandlerChains.isEmpty())
+ if (addon.preHandlerChains != null && !addon.preHandlerChains.isEmpty())
{
List<UnifiedHandlerChainMetaData> list;
if (base.preHandlerChains.isEmpty())
{
- list = conf.preHandlerChains;
+ list = addon.preHandlerChains;
}
else
{
list = new ArrayList<UnifiedHandlerChainMetaData>(base.preHandlerChains);
- list.addAll(conf.preHandlerChains);
+ list.addAll(addon.preHandlerChains);
}
this.preHandlerChains = Collections.unmodifiableList(list);
}
@@ -133,12 +133,12 @@
{
this.preHandlerChains = Collections.emptyList();
}
- if (conf.postHandlerChains != null && !conf.postHandlerChains.isEmpty())
+ if (addon.postHandlerChains != null && !addon.postHandlerChains.isEmpty())
{
List<UnifiedHandlerChainMetaData> list;
if (base.postHandlerChains.isEmpty())
{
- list = conf.postHandlerChains;
+ list = addon.postHandlerChains;
}
else
{
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2013-12-05 10:44:03 UTC (rev 18140)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2013-12-05 14:49:08 UTC (rev 18141)
@@ -43,7 +43,7 @@
super(configName, preHandlerChains, postHandlerChains, properties, features);
}
- public ClientConfig(ClientConfig base, ClientConfig conf) {
- super(base, conf);
+ public ClientConfig(ClientConfig base, ClientConfig addon) {
+ super(base, addon);
}
}
11 years, 1 month
JBossWS SVN: r18140 - container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 05:44:03 -0500 (Thu, 05 Dec 2013)
New Revision: 18140
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java
Log:
Making a field final
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java 2013-12-05 10:42:58 UTC (rev 18139)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java 2013-12-05 10:44:03 UTC (rev 18140)
@@ -27,7 +27,7 @@
public class WebServerInfoImpl implements WebServerInfo {
- private WebServer webserver;
+ private final WebServer webserver;
public WebServerInfoImpl(WebServer webServer) {
webserver = webServer;
11 years, 1 month
JBossWS SVN: r18139 - container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 05:42:58 -0500 (Thu, 05 Dec 2013)
New Revision: 18139
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
Log:
Backport part of [WFLY-2565] to 7.2.0 ASIL (excluding backport the endpoint publisher stuff)
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2013-12-05 10:17:37 UTC (rev 18138)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2013-12-05 10:42:58 UTC (rev 18139)
@@ -30,6 +30,7 @@
import org.jboss.as.security.plugins.SecurityDomainContext;
import org.jboss.as.security.service.SecurityDomainService;
+import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.webservices.security.SecurityDomainContextAdaptor;
import org.jboss.as.webservices.util.WSServices;
@@ -230,6 +231,9 @@
builder.addDependency(DependencyType.REQUIRED, WSServices.CONFIG_SERVICE);
builder.setInitialMode(Mode.ACTIVE);
builder.install();
+ //add a dependency on the endpoint service to web deployments, so that the
+ //endpoint servlet is not started before the endpoint is actually available
+ unit.addToAttachmentList(Attachments.WEB_DEPENDENCIES, serviceName);
}
public static void uninstall(final Endpoint endpoint, final DeploymentUnit unit) {
11 years, 1 month
JBossWS SVN: r18138 - in thirdparty/cxf/branches/cxf-2.2.12: rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-12-05 05:17:37 -0500 (Thu, 05 Dec 2013)
New Revision: 18138
Added:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java
Log:
[JBPAPP-10907]:Ability to set custom JAXB validation event handlers on outgoing responses in JBossWS-CXF(Review and apply patch from Joe Wertz)
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java 2013-12-05 09:13:56 UTC (rev 18137)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -50,6 +50,7 @@
public class DataWriterImpl<T> extends JAXBDataBase implements DataWriter<T> {
private static final Logger LOG = LogUtils.getLogger(JAXBDataBinding.class);
+ ValidationEventHandler veventHandler;
private JAXBDataBinding databinding;
public DataWriterImpl(JAXBDataBinding binding) {
@@ -60,6 +61,18 @@
public void write(Object obj, T output) {
write(obj, null, output);
}
+
+ public void setProperty(String prop, Object value) {
+ if (prop.equals(org.apache.cxf.message.Message.class.getName())) {
+ org.apache.cxf.message.Message m = (org.apache.cxf.message.Message)value;
+ veventHandler = (ValidationEventHandler)m.getContextualProperty(
+ "jaxb-writer-validation-event-handler");
+ if (veventHandler == null) {
+ veventHandler = databinding.getValidationEventHandler();
+ }
+ }
+ }
+
private static class MtomValidationHandler implements ValidationEventHandler {
ValidationEventHandler origHandler;
JAXBAttachmentMarshaller marshaller;
@@ -104,7 +117,8 @@
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE);
marshaller.setListener(databinding.getMarshallerListener());
- if (databinding.getValidationEventHandler() != null) {
+ marshaller.setEventHandler(veventHandler);
+ if (veventHandler == null && databinding.getValidationEventHandler() != null) {
marshaller.setEventHandler(databinding.getValidationEventHandler());
}
Added: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jaxb.io;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+
+public class MyCustomHandler implements ValidationEventHandler {
+
+ private boolean used;
+ public boolean getUsed() {
+ return used;
+ }
+
+ public boolean handleEvent(ValidationEvent event) {
+ used = true;
+ return true;
+ }
+
+}
\ No newline at end of file
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java 2013-12-05 09:13:56 UTC (rev 18137)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -57,6 +57,33 @@
}
@Test
+ public void testSetProperty() throws Exception {
+ JAXBDataBinding db = getDataBinding(GreetMe.class);
+
+ reader = getTestReader("../resources/SetPropertyValidationFailureReq.xml");
+ assertNotNull(reader);
+
+ @SuppressWarnings("unchecked")
+ DataReaderImpl<XMLStreamReader> dr = (DataReaderImpl)db.createReader(XMLStreamReader.class);
+ assertNotNull(dr);
+
+ // Build message to set custom event handler
+ org.apache.cxf.message.Message message = new org.apache.cxf.message.MessageImpl();
+ message.put("jaxb-validation-event-handler", new MyCustomHandler());
+ message.put("unwrap.jaxb.element", true);
+
+ dr.setProperty("org.apache.cxf.message.Message", message);
+
+ // Should fail if custom handler doesn't skip formatting error
+ Object val = dr.read(reader);
+ assertTrue(val instanceof GreetMe);
+ assertEquals("TestSOAPInputPMessage", ((GreetMe)val).getRequestType());
+
+ // Check handler used
+ assertTrue(((MyCustomHandler)dr.veventHandler).getUsed());
+ }
+
+ @Test
public void testReadWrapper() throws Exception {
JAXBDataBinding db = getDataBinding(GreetMe.class);
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java 2013-12-05 09:13:56 UTC (rev 18137)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -62,6 +62,36 @@
public void tearDown() throws Exception {
baos.close();
}
+
+ @Test
+ public void testSetProperty() throws Exception {
+ JAXBDataBinding db = getTestWriterFactory();
+
+ @SuppressWarnings("unchecked")
+ DataWriterImpl<XMLStreamWriter> dw = (DataWriterImpl)db.createWriter(XMLStreamWriter.class);
+ assertNotNull(dw);
+
+ // Build message to set custom event handler
+ org.apache.cxf.message.Message message = new org.apache.cxf.message.MessageImpl();
+ message.put("jaxb-writer-validation-event-handler", new MyCustomHandler());
+
+ dw.setProperty("org.apache.cxf.message.Message", message);
+
+ // Write Stuff
+ TradePriceData val = new TradePriceData();
+ val.setTickerSymbol("This is a symbol");
+ val.setTickerPrice(1.0f);
+
+ QName elName = new QName("http://apache.org/hello_world_doc_lit_bare/types", "inout");
+ MessagePartInfo part = new MessagePartInfo(elName, null);
+ part.setElement(true);
+ part.setElementQName(elName);
+ dw.write(val, part, streamWriter);
+ streamWriter.flush();
+
+ // Test MyCustomHandler
+ assertTrue(((MyCustomHandler)dw.veventHandler).getUsed());
+ }
@Test
public void testWriteRPCLit1() throws Exception {
Added: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,22 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types">
+ <ns4:requestType>TestSOAPInputPMessage</ns4:requestType>
+ <ns4:somethingElse>bla bla bla</ns4:somethingElse>
+</ns4:greetMe>
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxb.validators;
+
+import org.apache.cxf.testutil.common.TestUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+@ContextConfiguration(locations = { "classpath:jaxbCustomValidators.xml" })
+public class CustomValidatorJAXBTest extends AbstractJUnit4SpringContextTests {
+ static final String PORT = TestUtil.getPortNumber(CustomValidatorJAXBTest.class);
+
+ @Test
+ public void cleanTest() {
+ HelloWorld client = (HelloWorld)applicationContext
+ .getBean("testClient", HelloWorld.class);
+
+ PassedObject hi = client.sayHi(new PassedObject("John", "Doe"));
+ Assert.assertTrue("Expected: 'Hello John Doe' Actual: " + hi.getName(),
+ "Hello John Doe".equals(hi.getName()));
+
+ }
+
+ @Test
+ public void sendNullTest() {
+ HelloWorld client = (HelloWorld)applicationContext
+ .getBean("testClient", HelloWorld.class);
+
+ PassedObject hi = client.sayHi(new PassedObject());
+ Assert.assertTrue("Expected: 'Hello null null' Actual: '" + hi.getName() + "'",
+ "Hello null null".equals(hi.getName()));
+
+ }
+
+ @Test
+ public void returnNullTest() {
+ HelloWorld client = (HelloWorld)applicationContext
+ .getBean("testClient", HelloWorld.class);
+
+ PassedObject hi = client.returnNull(new PassedObject("John", "Doe"));
+ Assert.assertTrue("Expected: 'Hello null' Actual: '" + hi.getName() + "'",
+ "Hello null".equals(hi.getName()));
+
+ }
+}
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxb.validators;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+
+(a)javax.jws.WebService(targetNamespace = "aNamespace")
+public interface HelloWorld {
+
+ @WebMethod(operationName = "sayHi")
+ PassedObject sayHi(@WebParam(name = "text") PassedObject name);
+
+ @WebMethod(operationName = "returnNull")
+ PassedObject returnNull(@WebParam(name = "text") PassedObject name);
+}
+
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxb.validators;
+
+(a)javax.jws.WebService(endpointInterface = "org.apache.cxf.systest.jaxb.validators.HelloWorld")
+public class HelloWorldImpl implements HelloWorld {
+
+ public PassedObject sayHi(PassedObject name) {
+ return new PassedObject("Hello", name.getName());
+ }
+
+ public PassedObject returnNull(PassedObject name) {
+ return new PassedObject("Hello", null);
+ }
+
+}
+
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxb.validators;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+
+public class MyCustomHandler implements ValidationEventHandler {
+
+ private boolean used;
+ public boolean getUsed() {
+ return used;
+ }
+
+ public boolean handleEvent(ValidationEvent event) {
+ used = true;
+ return true;
+ }
+
+}
\ No newline at end of file
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxb.validators;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "UserType", propOrder = { "firstName", "lastName" })
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class PassedObject {
+
+ @XmlElement(required = true, nillable = false)
+ private String firstName;
+
+ @XmlElement(required = true, nillable = false)
+ private String lastName;
+
+ public PassedObject() { }
+
+ public PassedObject(String firstName, String lastName) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getName() {
+ return firstName + " " + lastName;
+ }
+
+}
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml 2013-12-05 10:17:37 UTC (rev 18138)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:http="http://cxf.apache.org/transports/http/configuration"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+ http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+ <!-- Services -->
+ <jaxws:server
+ id="testServer"
+ serviceClass="org.apache.cxf.systest.jaxb.validators.HelloWorld"
+ address="http://localhost:${testutil.ports.CustomValidatorJAXBTest}/Hello">
+ <jaxws:serviceBean>
+ <bean class="org.apache.cxf.systest.jaxb.validators.HelloWorldImpl"/>
+ </jaxws:serviceBean>
+ <jaxws:properties>
+ <entry key="schema-validation-enabled" value="true" />
+ <entry key="jaxb-validation-event-handler">
+ <bean class="org.apache.cxf.systest.jaxb.validators.MyCustomHandler"></bean>
+ </entry>
+ <entry key="jaxb-writer-validation-event-handler">
+ <bean class="org.apache.cxf.systest.jaxb.validators.MyCustomHandler"></bean>
+ </entry>
+ </jaxws:properties>
+ </jaxws:server>
+
+ <!-- Client Proxy -->
+ <jaxws:client
+ id="testClient"
+ serviceClass="org.apache.cxf.systest.jaxb.validators.HelloWorld"
+ address="http://localhost:${testutil.ports.CustomValidatorJAXBTest}/Hello">
+ </jaxws:client>
+
+
+</beans>
Property changes on: thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years, 1 month
JBossWS SVN: r18137 - common/trunk/src/main/java/org/jboss/ws/common/monitoring.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 04:13:56 -0500 (Thu, 05 Dec 2013)
New Revision: 18137
Modified:
common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java
Log:
Better fix
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java 2013-12-05 08:50:22 UTC (rev 18136)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java 2013-12-05 09:13:56 UTC (rev 18137)
@@ -51,12 +51,7 @@
public HostFilter(Collection<String> hosts, boolean source)
{
- if (hosts instanceof List) {
- this.hosts = Collections.unmodifiableList((List<String>)hosts);
- } else {
- final List<String> l = new LinkedList<String>(hosts);
- this.hosts = Collections.unmodifiableList(l);
- }
+ this.hosts = Collections.unmodifiableList(new LinkedList<String>(hosts));
this.source = source;
}
11 years, 1 month