JBossWS SVN: r17350 - in shared-testsuite/trunk/testsuite/src/test: java/org/jboss/test/ws/jaxws/clientConfig and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 12:28:27 -0500 (Tue, 26 Feb 2013)
New Revision: 17350
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
Log:
[JBWS-3603] Further tests
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2013-02-26 16:35:29 UTC (rev 17349)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2013-02-26 17:28:27 UTC (rev 17350)
@@ -132,6 +132,9 @@
<classes dir="${tests.output.dir}/test-resources/jaxws/clientConfig">
<include name="META-INF/jaxws-client-config.xml"/>
</classes>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.common"/>
+ </manifest>
</war>
<!-- jaxws-clientConfig-client -->
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-02-26 16:35:29 UTC (rev 17349)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-02-26 17:28:27 UTC (rev 17350)
@@ -67,18 +67,34 @@
assertTrue(getHelper().testCustomClientConfigurationFromFile());
}
+ public void testCustomClientConfigurationOnDispatchFromFile() throws Exception {
+ assertTrue(getHelper().testCustomClientConfigurationOnDispatchFromFile());
+ }
+
public void testCustomClientConfigurationFromFileInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfigurationFromFile"));
}
+ public void testCustomClientConfigurationOnDispatchFromFileInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchFromFile"));
+ }
+
public void testCustomClientConfigurationFromFileUsingFeature() throws Exception {
- assertTrue(getHelper().testCustomClientConfigurationFromFile());
+ assertTrue(getHelper().testCustomClientConfigurationFromFileUsingFeature());
}
+ public void testCustomClientConfigurationFromFileUsingFeatureOnDispatch() throws Exception {
+ assertTrue(getHelper().testCustomClientConfigurationFromFileUsingFeatureOnDispatch());
+ }
+
public void testCustomClientConfigurationFromFileUsingFeatureInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfigurationFromFileUsingFeature"));
}
+ public void testCustomClientConfigurationFromFileUsingFeatureOnDispatchInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationFromFileUsingFeatureOnDispatch"));
+ }
+
/**
* Verifies a client configuration can be changed after another one has been set
*
@@ -88,10 +104,18 @@
assertTrue(getHelper().testConfigurationChange());
}
+ public void testConfigurationChangeOnDispatch() throws Exception {
+ assertTrue(getHelper().testConfigurationChangeOnDispatch());
+ }
+
public void testConfigurationChangeInContainer() throws Exception {
assertEquals("1", runTestInContainer("testConfigurationChange"));
}
+ public void testConfigurationChangeOnDispatchInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testConfigurationChangeOnDispatch"));
+ }
+
/**
* Verifies the default client configuration from AS model is used
*
@@ -103,6 +127,12 @@
}
}
+ public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ if (!isTargetJBoss71()) {
+ assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
+ }
+ }
+
/**
* Verifies a client configuration from AS model can be set
*
@@ -112,10 +142,18 @@
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() {
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2013-02-26 16:35:29 UTC (rev 17349)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2013-02-26 17:28:27 UTC (rev 17350)
@@ -25,14 +25,20 @@
import java.util.List;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
import javax.xml.ws.handler.Handler;
import org.jboss.test.helper.ClientHelper;
import org.jboss.ws.api.configuration.ClientConfigFeature;
import org.jboss.ws.api.configuration.ClientConfigUtil;
import org.jboss.ws.api.configuration.ClientConfigurer;
+import org.jboss.ws.common.DOMUtils;
+import org.w3c.dom.Element;
/**
* Verifies client configuration setup
@@ -73,6 +79,29 @@
return ("Kermit|RoutOut|CustomOut|UserOut|LogOut|endpoint|LogIn|UserIn|CustomIn|RoutIn".equals(resStr));
}
+ public boolean testCustomClientConfigurationOnDispatchFromFile() throws Exception
+ {
+ 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");
+
+ 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);
+
+ ClientConfigUtil.setConfigHandlers(bp, "META-INF/jaxws-client-config.xml", "Custom Client Config");
+
+ Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
+ String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
+ return ("Kermit|RoutOut|CustomOut|UserOut|LogOut|endpoint|LogIn|UserIn|CustomIn|RoutIn".equals(resStr));
+ }
+
public boolean testCustomClientConfigurationFromFileUsingFeature() throws Exception
{
QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
@@ -91,6 +120,28 @@
return ("Kermit|RoutOut|CustomOut|UserOut|LogOut|endpoint|LogIn|UserIn|CustomIn|RoutIn".equals(resStr));
}
+ public boolean testCustomClientConfigurationFromFileUsingFeatureOnDispatch() throws Exception
+ {
+ 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");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD,
+ new ClientConfigFeature("META-INF/jaxws-client-config.xml", "Custom Client Config"));
+
+ 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|RoutOut|CustomOut|UserOut|LogOut|endpoint|LogIn|UserIn|CustomIn|RoutIn".equals(resStr));
+ }
+
public boolean testConfigurationChange() throws Exception
{
QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
@@ -119,6 +170,38 @@
return ("Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
}
+ public boolean testConfigurationChangeOnDispatch() throws Exception
+ {
+ 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");
+
+ 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);
+
+ ClientConfigurer configurer = ClientConfigUtil.resolveClientConfigurer();
+ configurer.setConfigHandlers(bp, "META-INF/jaxws-client-config.xml", "Custom Client Config");
+
+ Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
+ String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
+ if (!"Kermit|RoutOut|CustomOut|UserOut|LogOut|endpoint|LogIn|UserIn|CustomIn|RoutIn".equals(resStr)) {
+ return false;
+ }
+
+ configurer.setConfigHandlers(bp, "META-INF/jaxws-client-config.xml", "Another Client Config");
+
+ resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
+ resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
+ return ("Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
+ }
+
/**
* This test hacks the current ServerConfig temporarily adding an handler from this testcase deployment
* into the AS default client configuration, verifies the handler is picked up and finally restores the
@@ -158,6 +241,40 @@
}
}
+ public boolean testDefaultClientConfigurationOnDispatch() throws Exception
+ {
+ 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();
+ // --
+ }
+ }
+
/**
* This test hacks the current ServerConfig temporarily adding a test client configuration, uses that
* for the test client and finally removes it from the ServerConfig.
@@ -199,6 +316,43 @@
}
}
+ public boolean testCustomClientConfigurationOnDispatch() throws Exception
+ {
+ 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 String testConfigName = "MyTestConfig";
+ try
+ {
+ //-- add test client configuration
+ TestUtils.addTestCaseClientConfiguration(testConfigName);
+ // --
+
+ 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);
+
+ ClientConfigUtil.setConfigHandlers(bp, null, testConfigName);
+
+ Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
+ String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
+ return ("Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
+ }
+ finally
+ {
+ // -- remove test client configuration --
+ TestUtils.removeTestCaseClientConfiguration(testConfigName);
+ // --
+ }
+ }
+
public boolean testCustomClientConfigurationUsingFeature() throws Exception
{
QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
@@ -231,6 +385,41 @@
}
}
+ public boolean testCustomClientConfigurationOnDispatchUsingFeature() throws Exception
+ {
+ 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 String testConfigName = "MyTestConfig";
+ try
+ {
+ //-- add test client configuration
+ TestUtils.addTestCaseClientConfiguration(testConfigName);
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD, new ClientConfigFeature(null, testConfigName));
+
+ 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|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
+ }
+ finally
+ {
+ // -- remove test client configuration --
+ TestUtils.removeTestCaseClientConfiguration(testConfigName);
+ // --
+ }
+ }
+
@Override
public void setTargetEndpoint(String address)
{
11 years, 10 months
JBossWS SVN: r17349 - api/trunk/src/main/java/org/jboss/ws/api/configuration.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 11:35:29 -0500 (Tue, 26 Feb 2013)
New Revision: 17349
Modified:
api/trunk/src/main/java/org/jboss/ws/api/configuration/ClientConfigurer.java
Log:
[JBWS-3603] Minor doc update
Modified: api/trunk/src/main/java/org/jboss/ws/api/configuration/ClientConfigurer.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/configuration/ClientConfigurer.java 2013-02-26 16:34:52 UTC (rev 17348)
+++ api/trunk/src/main/java/org/jboss/ws/api/configuration/ClientConfigurer.java 2013-02-26 16:35:29 UTC (rev 17349)
@@ -42,10 +42,10 @@
/**
* Reads a client configuration and setups the properties in the provided client proxy accordingly.
*
- * @param proxy The client proxy (port)
+ * @param obj The client proxy (port) or dispatch
* @param configFile The configuration file
* @param configName The configuration name
*/
- public void setConfigProperties(Object proxy, String configFile, String configName);
+ public void setConfigProperties(Object obj, String configFile, String configName);
}
11 years, 10 months
JBossWS SVN: r17348 - common/trunk/src/main/java/org/jboss/ws/common/configuration.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 11:34:52 -0500 (Tue, 26 Feb 2013)
New Revision: 17348
Modified:
common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
Log:
[JBWS-3603] Minor update
Modified: common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2013-02-26 16:33:54 UTC (rev 17347)
+++ common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2013-02-26 16:34:52 UTC (rev 17348)
@@ -79,7 +79,7 @@
}
@Override
- public void setConfigProperties(Object proxy, String configFile, String configName)
+ public void setConfigProperties(Object client, String configFile, String configName)
{
throw MESSAGES.operationNotSupportedBy("setConfigProperties", this.getClass());
}
11 years, 10 months
JBossWS SVN: r17347 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 11:33:54 -0500 (Tue, 26 Feb 2013)
New Revision: 17347
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
Log:
[JBWS-3603] Adding some tests...
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-02-26 16:32:57 UTC (rev 17346)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-02-26 16:33:54 UTC (rev 17347)
@@ -52,18 +52,34 @@
assertTrue(getHelper().testCustomClientConfigurationFromFile());
}
+ public void testCustomClientConfigurationOnDispatchFromFile() throws Exception {
+ assertTrue(getHelper().testCustomClientConfigurationOnDispatchFromFile());
+ }
+
public void testCustomClientConfigurationFromFileInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfigurationFromFile"));
}
+ public void testCustomClientConfigurationOnDispatchFromFileInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchFromFile"));
+ }
+
public void testCustomClientConfigurationFromFileUsingFeature() throws Exception {
assertTrue(getHelper().testCustomClientConfigurationFromFileUsingFeature());
}
+ public void testCustomClientConfigurationOnDispatchFromFileUsingFeature() throws Exception {
+ assertTrue(getHelper().testCustomClientConfigurationOnDispatchFromFileUsingFeature());
+ }
+
public void testCustomClientConfigurationFromFileUsingFeatureInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfigurationFromFileUsingFeature"));
}
+ public void testCustomClientConfigurationOnDispatchFromFileUsingFeatureInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchFromFileUsingFeature"));
+ }
+
/**
* Verifies a client configuration can be changed after another one has been set
*
@@ -73,10 +89,18 @@
assertTrue(getHelper().testConfigurationChange());
}
+ public void testConfigurationChangeOnDispatch() throws Exception {
+ assertTrue(getHelper().testConfigurationChangeOnDispatch());
+ }
+
public void testConfigurationChangeInContainer() throws Exception {
assertEquals("1", runTestInContainer("testConfigurationChange"));
}
+ public void testConfigurationChangeOnDispatchInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testConfigurationChangeOnDispatch"));
+ }
+
/**
* Verifies the default client configuration from AS model is used
*
@@ -88,6 +112,12 @@
}
}
+ public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ if (!isTargetJBoss71()) {
+ assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
+ }
+ }
+
/**
* Verifies a client configuration from AS model can be set
*
@@ -97,10 +127,18 @@
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() {
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-02-26 16:32:57 UTC (rev 17346)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-02-26 16:33:54 UTC (rev 17347)
@@ -24,9 +24,13 @@
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.jaxws.DispatchImpl;
import org.jboss.ws.api.configuration.ClientConfigFeature;
import org.jboss.ws.api.configuration.ClientConfigUtil;
import org.jboss.ws.api.configuration.ClientConfigurer;
@@ -41,6 +45,7 @@
public class Helper implements ClientHelper
{
private final QName serviceName = new QName("http://clientConfig.cxf.jaxws.ws.test.jboss.org/", "EndpointImplService");
+ private final QName portName = new QName("http://clientConfig.cxf.jaxws.ws.test.jboss.org/", "EndpointPort");
private String address;
public boolean testCustomClientConfigurationFromFile() throws Exception
@@ -53,6 +58,16 @@
return ClientProxy.getClient(port).getEndpoint().get("propA").equals("fileValueA");
}
+ public boolean testCustomClientConfigurationOnDispatchFromFile() throws Exception
+ {
+ Service service = Service.create(new URL(address + "?wsdl"), serviceName);
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
+
+ ClientConfigUtil.setConfigProperties(dispatch, "META-INF/jaxws-client-config.xml", "Custom Client Config");
+
+ return ((DispatchImpl<?>)dispatch).getClient().getEndpoint().get("propA").equals("fileValueA");
+ }
+
public boolean testCustomClientConfigurationFromFileUsingFeature() throws Exception
{
Service service = Service.create(new URL(address + "?wsdl"), serviceName);
@@ -61,6 +76,15 @@
return ClientProxy.getClient(port).getEndpoint().get("propA").equals("fileValueA");
}
+ public boolean testCustomClientConfigurationOnDispatchFromFileUsingFeature() throws Exception
+ {
+ Service service = Service.create(new URL(address + "?wsdl"), serviceName);
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE,
+ new ClientConfigFeature("META-INF/jaxws-client-config.xml", "Custom Client Config", true));
+
+ return ((DispatchImpl<?>)dispatch).getClient().getEndpoint().get("propA").equals("fileValueA");
+ }
+
public boolean testConfigurationChange() throws Exception
{
Service service = Service.create(new URL(address + "?wsdl"), serviceName);
@@ -84,6 +108,27 @@
return (ep.get("propA") == null && ep.get("propB") == null && ep.get("propC").equals("fileValueC") && ep.get("propZ").equals("valueZ"));
}
+ public boolean testConfigurationChangeOnDispatch() throws Exception
+ {
+ Service service = Service.create(new URL(address + "?wsdl"), serviceName);
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
+ org.apache.cxf.endpoint.Endpoint ep = ((DispatchImpl<SOAPMessage>)dispatch).getClient().getEndpoint();
+ assert(ep.get("propA") == null);
+ assert(ep.get("propB") == null);
+ ep.put("propZ", "valueZ");
+
+ ClientConfigurer configurer = ClientConfigUtil.resolveClientConfigurer();
+ configurer.setConfigProperties(dispatch, "META-INF/jaxws-client-config.xml", "Custom Client Config");
+
+ if (!ep.get("propA").equals("fileValueA") || !ep.get("propB").equals("fileValueB") || !ep.get("propZ").equals("valueZ")) {
+ return false;
+ }
+
+ configurer.setConfigProperties(dispatch, "META-INF/jaxws-client-config.xml", "Another Client Config");
+
+ return (ep.get("propA") == null && ep.get("propB") == null && ep.get("propC").equals("fileValueC") && ep.get("propZ").equals("valueZ"));
+ }
+
/**
* This test hacks the current ServerConfig temporarily adding a property into the AS default client configuration,
* verifies the handler is picked up and finally restores the original default client configuration.
@@ -114,6 +159,29 @@
}
}
+ public boolean testDefaultClientConfigurationOnDispatch() throws Exception
+ {
+ 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();
+ // --
+ }
+ }
+
/**
* This test hacks the current ServerConfig temporarily adding a test client configuration, uses that
* for the test client and finally removes it from the ServerConfig.
@@ -148,6 +216,33 @@
}
}
+ public boolean testCustomClientConfigurationOnDispatch() throws Exception
+ {
+ final URL wsdlURL = new URL(address + "?wsdl");
+ final String testConfigName = "MyTestConfig";
+ try
+ {
+ //-- add test client configuration
+ TestUtils.addTestCaseClientConfiguration(testConfigName);
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
+ org.apache.cxf.endpoint.Endpoint ep = ((DispatchImpl<SOAPMessage>)dispatch).getClient().getEndpoint();
+ ep.put("propZ", "valueZ");
+
+ ClientConfigUtil.setConfigProperties(dispatch, null, testConfigName);
+
+ return (ep.get("propT").equals("valueT") && ep.get("propZ").equals("valueZ"));
+ }
+ finally
+ {
+ // -- remove test client configuration --
+ TestUtils.removeTestCaseClientConfiguration(testConfigName);
+ // --
+ }
+ }
+
public boolean testCustomClientConfigurationUsingFeature() throws Exception
{
final URL wsdlURL = new URL(address + "?wsdl");
@@ -173,6 +268,31 @@
}
}
+ public boolean testCustomClientConfigurationOnDispatchUsingFeature() throws Exception
+ {
+ final URL wsdlURL = new URL(address + "?wsdl");
+ final String testConfigName = "MyTestConfig";
+ try
+ {
+ //-- add test client configuration
+ TestUtils.addTestCaseClientConfiguration(testConfigName);
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE, new ClientConfigFeature(null, testConfigName, true));
+ org.apache.cxf.endpoint.Endpoint ep = ((DispatchImpl<SOAPMessage>)dispatch).getClient().getEndpoint();
+ ep.put("propZ", "valueZ");
+
+ return (ep.get("propT").equals("valueT") && ep.get("propZ").equals("valueZ"));
+ }
+ finally
+ {
+ // -- remove test client configuration --
+ TestUtils.removeTestCaseClientConfiguration(testConfigName);
+ // --
+ }
+ }
+
@Override
public void setTargetEndpoint(String address)
{
11 years, 10 months
JBossWS SVN: r17346 - in stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client: configuration and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 11:32:57 -0500 (Tue, 26 Feb 2013)
New Revision: 17346
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
Log:
[JBWS-3603] Fix client configuration for Dispatch instances
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-02-25 14:16:05 UTC (rev 17345)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-02-26 16:32:57 UTC (rev 17346)
@@ -28,15 +28,18 @@
import java.util.Map;
import java.util.concurrent.Executor;
+import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointContext;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.Service.Mode;
import javax.xml.ws.spi.Invoker;
import javax.xml.ws.spi.ServiceDelegate;
@@ -44,6 +47,7 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.jaxws.DispatchImpl;
import org.apache.cxf.jaxws.ServiceImpl;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
import org.jboss.ws.api.configuration.AbstractClientFeature;
@@ -480,11 +484,28 @@
super(b, url, name, cls, f);
}
+ @Override
protected <T> T createPort(QName portName, EndpointReferenceType epr, Class<T> serviceEndpointInterface,
WebServiceFeature... features) {
T port = super.createPort(portName, epr, serviceEndpointInterface, features);
- Binding binding = ((BindingProvider)port).getBinding();
- Client client = ClientProxy.getClient(port);
+ setupClient(port, features);
+ return port;
+ }
+
+ @Override
+ public <T> Dispatch<T> createDispatch(QName portName,
+ Class<T> type,
+ JAXBContext context,
+ Mode mode,
+ WebServiceFeature... features) {
+ Dispatch<T> dispatch = super.createDispatch(portName, type, context, mode, features);
+ setupClient(dispatch, features);
+ return dispatch;
+ }
+
+ protected void setupClient(Object obj, WebServiceFeature... features) {
+ Binding binding = ((BindingProvider)obj).getBinding();
+ Client client = obj instanceof DispatchImpl<?> ? ((DispatchImpl<?>)obj).getClient() : ClientProxy.getClient(obj);
client.getOutInterceptors().add(new HandlerChainSortInterceptor(binding));
if (jbossModulesEnv) { //optimization for avoiding checking for a server config when we know for sure we're out-of-container
ServerConfig sc = getServerConfig();
@@ -501,13 +522,11 @@
if (features != null) {
for (WebServiceFeature f : features) {
if (f instanceof AbstractClientFeature) {
- ((AbstractClientFeature)f).initialize(port);
+ ((AbstractClientFeature)f).initialize(obj);
}
}
}
- return port;
}
-
}
//lazy get the server config (and try once per classloader only)
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 2013-02-25 14:16:05 UTC (rev 17345)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2013-02-26 16:32:57 UTC (rev 17346)
@@ -27,6 +27,7 @@
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.jaxws.DispatchImpl;
import org.jboss.ws.common.configuration.ConfigHelper;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
@@ -42,15 +43,20 @@
private static final String JBOSSWS_CXF_CLIENT_CONF_PROPS = "jbossws.cxf.client.conf.props";
@Override
- public void setConfigProperties(Object proxy, String configFile, String configName) {
+ public void setConfigProperties(Object client, String configFile, String configName) {
ClientConfig config = readConfig(configFile, configName);
- Client client = ClientProxy.getClient(proxy);
- cleanupPreviousProps(client);
+ Client cxfClient;
+ if (client instanceof DispatchImpl<?>) {
+ cxfClient = ((DispatchImpl<?>)client).getClient();
+ } else {
+ cxfClient = ClientProxy.getClient(client);
+ }
+ cleanupPreviousProps(cxfClient);
Map<String, String> props = config.getProperties();
if (props != null && !props.isEmpty()) {
- savePropList(client, props);
+ savePropList(cxfClient, props);
}
- setConfigProperties(client, props);
+ setConfigProperties(cxfClient, props);
}
public void setConfigProperties(Client client, Map<String, String> properties) {
11 years, 10 months
JBossWS SVN: r17345 - in stack/cxf/trunk/modules/resources/src/main/resources/modules: jboss720/org/jboss/ws/jaxws-client/main and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-25 09:16:05 -0500 (Mon, 25 Feb 2013)
New Revision: 17345
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/jaxws-client/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/jaxws-client/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss800/org/jboss/ws/jaxws-client/main/module.xml
Log:
[JBWS-3602] Fixing org.jboss.ws.jaxws-client module
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/jaxws-client/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/jaxws-client/main/module.xml 2013-02-22 12:38:45 UTC (rev 17344)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/jaxws-client/main/module.xml 2013-02-25 14:16:05 UTC (rev 17345)
@@ -30,6 +30,7 @@
<dependencies>
<module name="javax.api" />
+ <module name="javax.servlet.api" />
<module name="javax.xml.bind.api" />
<module name="com.sun.xml.bind" services="import"/>
<module name="javax.xml.ws.api" />
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/jaxws-client/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/jaxws-client/main/module.xml 2013-02-22 12:38:45 UTC (rev 17344)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/jaxws-client/main/module.xml 2013-02-25 14:16:05 UTC (rev 17345)
@@ -34,6 +34,7 @@
<dependencies>
<module name="javax.api" />
+ <module name="javax.servlet.api" />
<module name="javax.xml.bind.api" />
<module name="com.sun.xml.bind" services="import"/>
<module name="javax.xml.ws.api" />
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss800/org/jboss/ws/jaxws-client/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss800/org/jboss/ws/jaxws-client/main/module.xml 2013-02-22 12:38:45 UTC (rev 17344)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss800/org/jboss/ws/jaxws-client/main/module.xml 2013-02-25 14:16:05 UTC (rev 17345)
@@ -34,6 +34,7 @@
<dependencies>
<module name="javax.api" />
+ <module name="javax.servlet.api" />
<module name="javax.xml.bind.api" />
<module name="com.sun.xml.bind" services="import"/>
<module name="javax.xml.ws.api" />
11 years, 10 months
JBossWS SVN: r17344 - thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb.
by jbossws-commits@lists.jboss.org
Author: mmusaji
Date: 2013-02-22 07:38:45 -0500 (Fri, 22 Feb 2013)
New Revision: 17344
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
Log:
[JBPAPP-10651] Added check to see if a paramatized collection is being used to return the correct type
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-02-22 12:35:42 UTC (rev 17343)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-02-22 12:38:45 UTC (rev 17344)
@@ -580,6 +580,12 @@
for (Method m : Utils.getGetters(cls, accessType)) {
//map method
Type type = Utils.getMethodReturnType(m);
+ //we want to return the right type for collections so if we get null
+ //from the return type we check if it's ParameterizedType and get the
+ //generic return type.
+ if((type==null) && (m.getGenericReturnType() instanceof ParameterizedType)) {
+ type = m.getGenericReturnType();
+ }
JAXBBeanInfo beanInfo = getBeanInfo(type);
if (beanInfo != null) {
int idx = m.getName().startsWith("get") ? 3 : 2;
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-02-22 12:35:42 UTC (rev 17343)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-02-22 12:38:45 UTC (rev 17344)
@@ -209,9 +209,17 @@
}
static Class<?> getMethodReturnType(Method m) {
- XmlJavaTypeAdapter adapter = getMethodXJTA(m);
- Class<?> adapterType = getTypeFromXmlAdapter(adapter);
- return adapterType != null ? adapterType : m.getReturnType();
+ XmlJavaTypeAdapter adapter = getMethodXJTA(m);
+ //if there is no adapter, yet we have a collection make sure
+ //we return the Generic type; if there is an annotation let the
+ //adapter handle what gets populated
+ if(adapter==null) {
+ if(m.getGenericReturnType() instanceof ParameterizedType) {
+ return null;
+ }
+ }
+ Class<?> adapterType = getTypeFromXmlAdapter(adapter);
+ return adapterType != null ? adapterType : m.getReturnType();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
11 years, 10 months
JBossWS SVN: r17343 - in thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651: rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: mmusaji
Date: 2013-02-22 07:35:42 -0500 (Fri, 22 Feb 2013)
New Revision: 17343
Added:
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java
Removed:
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Log:
[JBPAPP-10651] Commit depending bug fixes from JBPAPP-10129 first so easier to see what's changed
Property changes on: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651
___________________________________________________________________
Added: svn:mergeinfo
+ /thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129:17139-17235
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-02-22 10:47:27 UTC (rev 17342)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -33,14 +33,13 @@
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
import javax.xml.namespace.QName;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
@@ -196,13 +195,19 @@
if (anns != null) {
for (Annotation a : anns) {
if (XmlJavaTypeAdapter.class.isAssignableFrom(a.annotationType())) {
- inspectTypeAdapter(((XmlJavaTypeAdapter)a).value());
+ Type t = Utils.getTypeFromXmlAdapter((XmlJavaTypeAdapter)a);
+ if (t != null) {
+ addType(t);
+ }
}
}
}
XmlJavaTypeAdapter xjta = clazz.getAnnotation(XmlJavaTypeAdapter.class);
if (xjta != null) {
- inspectTypeAdapter(xjta.value());
+ Type t = Utils.getTypeFromXmlAdapter(xjta);
+ if (t != null) {
+ addType(t);
+ }
}
}
@@ -285,9 +290,10 @@
}
}
XmlJavaTypeAdapter xjta = cls.getAnnotation(XmlJavaTypeAdapter.class);
- if (xjta != null) {
- Class<? extends XmlAdapter> c2 = xjta.value();
- inspectTypeAdapter(c2);
+ if (xjta != null && Utils.getTypeFromXmlAdapter(xjta) != null) {
+ Type t = Utils.getTypeFromXmlAdapter(xjta);
+ addType(t);
+ return;
}
} else if (classes.contains(cls)) {
return;
@@ -299,16 +305,24 @@
}
}
- private void inspectTypeAdapter(Class<? extends XmlAdapter> aclass) {
- Class<?> c2 = aclass;
- Type sp = c2.getGenericSuperclass();
- while (!XmlAdapter.class.equals(c2) && c2 != null) {
- sp = c2.getGenericSuperclass();
- c2 = c2.getSuperclass();
+ static XmlJavaTypeAdapter getFieldXJTA(final Field f) {
+ XmlJavaTypeAdapter adapter = f.getAnnotation(XmlJavaTypeAdapter.class);
+ if (adapter == null) {
+ adapter = f.getType().getAnnotation(XmlJavaTypeAdapter.class);
}
- if (sp instanceof ParameterizedType) {
- addType(((ParameterizedType)sp).getActualTypeArguments()[0]);
+ if (adapter == null) {
+ XmlJavaTypeAdapters adapters =
+ f.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
+ if (adapters != null) {
+ for (XmlJavaTypeAdapter candidate : adapters.value()) {
+ if (candidate != null && candidate.type().equals(f.getType())) {
+ adapter = candidate;
+ break;
+ }
+ }
+ }
}
+ return adapter;
}
private void walkReferences(Class<?> cls) {
@@ -325,11 +339,7 @@
//We'll grab the public field/method types and then add the ObjectFactory stuff
//as well as look for jaxb.index files in those packages.
- XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
- if (accessorType == null && cls.getPackage() != null) {
- accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
- }
- XmlAccessType accessType = accessorType != null ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;
+ XmlAccessType accessType = Utils.getXmlAccessType(cls);
if (accessType != XmlAccessType.PROPERTY) { // only look for fields if we are instructed to
//fields are accessible even if not public, must look at the declared fields
@@ -368,9 +378,6 @@
&& !Modifier.isPublic(field.getModifiers())) {
return false;
}
- if (field.getAnnotation(XmlJavaTypeAdapter.class) != null) {
- return false;
- }
if (accessType == XmlAccessType.NONE
|| accessType == XmlAccessType.PROPERTY) {
return checkJaxbAnnotation(field.getAnnotations());
@@ -397,12 +404,6 @@
return false;
}
- boolean isPropGetter = method.getName().startsWith("get") || method.getName().startsWith("is");
-
- if (!isPropGetter
- || method.getAnnotation(XmlJavaTypeAdapter.class) != null) {
- return false;
- }
int beginIndex = 3;
if (method.getName().startsWith("is")) {
beginIndex = 2;
@@ -428,7 +429,7 @@
* @param annotations the array of annotations from the class member
* @return true if JAXB annotations are present, false otherwise
*/
- private static boolean checkJaxbAnnotation(Annotation[] annotations) {
+ static boolean checkJaxbAnnotation(Annotation[] annotations) {
// must check if there are any jaxb annotations
Package jaxbAnnotationsPackage = XmlElement.class.getPackage();
for (Annotation annotation : annotations) {
@@ -438,4 +439,4 @@
}
return false;
}
-}
\ No newline at end of file
+}
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java 2013-02-22 10:47:27 UTC (rev 17342)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -48,7 +48,7 @@
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
import javax.xml.bind.attachment.AttachmentMarshaller;
import javax.xml.bind.attachment.AttachmentUnmarshaller;
@@ -65,7 +65,6 @@
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.SOAPConstants;
@@ -335,12 +334,7 @@
try {
writer.writeStartElement("ns1", qn.getLocalPart(), qn.getNamespaceURI());
Class<?> cls = part.getTypeClass();
- XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
- if (accessorType == null && cls.getPackage() != null) {
- accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
- }
- XmlAccessType accessType = accessorType != null
- ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;
+ XmlAccessType accessType = Utils.getXmlAccessType(cls);
String namespace = part.getElementQName().getNamespaceURI();
SchemaInfo sch = part.getMessageInfo().getOperation().getInterface()
@@ -353,33 +347,31 @@
LOG.warning("Schema associated with " + namespace + " is null");
}
- for (Field f : cls.getDeclaredFields()) {
- if (JAXBContextInitializer.isFieldAccepted(f, accessType)) {
+ for (Field f : Utils.getFields(cls, accessType)) {
+ XmlAttribute at = f.getAnnotation(XmlAttribute.class);
+ if (at == null) {
QName fname = new QName(namespace, f.getName());
f.setAccessible(true);
if (JAXBSchemaInitializer.isArray(f.getGenericType())) {
- writeArrayObject(marshaller, writer, fname, f.get(elValue));
+ writeArrayObject(marshaller, writer, fname, f.get(elValue));
} else {
- writeObject(marshaller, writer, new JAXBElement(fname, String.class,
- f.get(elValue)));
+ Object o = Utils.getFieldValue(f, elValue);
+ writeObject(marshaller, writer, new JAXBElement(fname, String.class, o));
}
}
}
- for (Method m : cls.getMethods()) {
- if (JAXBContextInitializer.isMethodAccepted(m, accessType)) {
- int idx = m.getName().startsWith("get") ? 3 : 2;
- String name = m.getName().substring(idx);
- name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
- QName mname = new QName(namespace, name);
- if (JAXBSchemaInitializer.isArray(m.getGenericReturnType())) {
- writeArrayObject(marshaller, writer, mname, m.invoke(elValue));
- } else {
- writeObject(marshaller, writer, new JAXBElement(mname, String.class,
- m.invoke(elValue)));
- }
+ for (Method m : Utils.getGetters(cls, accessType)) {
+ int idx = m.getName().startsWith("get") ? 3 : 2;
+ String name = m.getName().substring(idx);
+ name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
+ QName mname = new QName(namespace, name);
+ if (JAXBSchemaInitializer.isArray(m.getGenericReturnType())) {
+ writeArrayObject(marshaller, writer, mname, m.invoke(elValue));
+ } else {
+ Object o = Utils.getMethodValue(m, elValue);
+ writeObject(marshaller, writer, new JAXBElement(mname, String.class, o));
}
}
-
writer.writeEndElement();
writer.flush();
} catch (Exception e) {
@@ -448,55 +440,43 @@
obj = cons.newInstance(new Object[1]);
}
- XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
- if (accessorType == null && cls.getPackage() != null) {
- accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
- }
- XmlAccessType accessType = accessorType != null
- ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;
+ XmlAccessType accessType = Utils.getXmlAccessType(cls);
reader.nextTag();
while (reader.getEventType() == XMLStreamReader.START_ELEMENT) {
QName q = reader.getName();
- try {
- Field f = cls.getField(q.getLocalPart());
+ String fieldName = q.getLocalPart();
+ Field f = Utils.getField(cls, accessType, fieldName);
+ if (f != null) {
Type type = f.getGenericType();
- if (JAXBContextInitializer.isFieldAccepted(f, accessType)) {
- f.setAccessible(true);
- if (JAXBSchemaInitializer.isArray(type)) {
- Class<?> compType = JAXBSchemaInitializer
- .getArrayComponentType(type);
- List<Object> ret = unmarshallArray(u, reader,
- q,
- compType,
- createList(type));
- Object o = ret;
- if (!isList(type)) {
- if (compType.isPrimitive()) {
- o = java.lang.reflect.Array.newInstance(compType, ret.size());
- for (int x = 0; x < ret.size(); x++) {
- Array.set(o, x, ret.get(x));
- }
- } else {
- o = ret.toArray((Object[])Array.newInstance(compType, ret.size()));
+ f.setAccessible(true);
+ if (JAXBSchemaInitializer.isArray(type)) {
+ Class<?> compType = JAXBSchemaInitializer.getArrayComponentType(type);
+ List<Object> ret = unmarshallArray(u, reader, q, compType, createList(type));
+ Object o = ret;
+ if (!isList(type)) {
+ if (compType.isPrimitive()) {
+ o = java.lang.reflect.Array.newInstance(compType, ret.size());
+ for (int x = 0; x < ret.size(); x++) {
+ Array.set(o, x, ret.get(x));
}
+ } else {
+ o = ret.toArray((Object[]) Array.newInstance(compType, ret.size()));
}
-
- f.set(obj, o);
- } else {
- f.set(obj, u.unmarshal(reader, f.getType()));
}
+ f.set(obj, o);
+ } else {
+ Object o = getElementValue(u.unmarshal(reader, Utils.getFieldType(f)));
+ Utils.setFieldValue(f, obj, o);
}
- } catch (NoSuchFieldException ex) {
+ } else {
String s = Character.toUpperCase(q.getLocalPart().charAt(0))
+ q.getLocalPart().substring(1);
- Method m = null;
- try {
- m = cls.getMethod("get" + s);
- } catch (NoSuchMethodException mex) {
- m = cls.getMethod("is" + s);
+ Method m = Utils.getMethod(cls, accessType, "get" + s);
+ if (m == null) {
+ m = Utils.getMethod(cls, accessType, "is" + s);
}
Type type = m.getGenericReturnType();
- Method m2 = cls.getMethod("set" + s, m.getReturnType());
+ Method m2 = Utils.getMethod(cls, accessType, "set" + s, m.getReturnType());
if (JAXBSchemaInitializer.isArray(type)) {
Class<?> compType = JAXBSchemaInitializer
.getArrayComponentType(type);
@@ -518,8 +498,8 @@
m2.invoke(obj, o);
} else {
- Object o = getElementValue(u.unmarshal(reader, m.getReturnType()));
- m2.invoke(obj, o);
+ Object o = getElementValue(u.unmarshal(reader, Utils.getMethodReturnType(m)));
+ Utils.setMethodValue(m, m2, obj, o);
}
}
}
@@ -527,7 +507,8 @@
} catch (Exception e) {
throw new Fault(new Message("MARSHAL_ERROR", LOG, e.getMessage()), e);
}
- }
+ }
+
private static void writeObject(Marshaller u, Object source, Object mObj) throws Fault, JAXBException {
if (source instanceof XMLStreamWriter) {
Modified: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-02-22 10:47:27 UTC (rev 17342)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -26,13 +26,22 @@
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.annotation.XmlAccessOrder;
import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorOrder;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlList;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;
@@ -368,7 +377,7 @@
MessagePartInfo part = fault.getMessageParts().get(0);
Class<?> cls = part.getTypeClass();
Class<?> cl2 = (Class)fault.getProperty(Class.class.getName());
- if (cls != cl2) {
+ if (cls != cl2) {
QName name = (QName)fault.getProperty("elementName");
part.setElementQName(name);
JAXBBeanInfo beanInfo = getBeanInfo(cls);
@@ -427,6 +436,8 @@
XmlSchemaSequence seq = new XmlSchemaSequence();
ct.setParticle(seq);
+ List<XmlSchemaElement> elementList = new ArrayList<XmlSchemaElement>();
+
Method methods[] = cls.getMethods();
for (Method m : methods) {
if (m.getName().startsWith("get")
@@ -454,15 +465,38 @@
el.setSchemaTypeName(typeName);
}
- seq.getItems().add(el);
+ elementList.add(el);
} catch (Exception e) {
//not mappable
}
}
}
+ XmlAccessorOrder xmlAccessorOrder = cls.getAnnotation(XmlAccessorOrder.class);
+ XmlType xmlTypeAnno = cls.getAnnotation(XmlType.class);
+ String[] propertyOrder = null;
+
+ if (xmlTypeAnno != null && xmlTypeAnno.propOrder().length > 0) {
+ propertyOrder = xmlTypeAnno.propOrder();
+ //TODO: handle @XmlAccessOrder
+ }
+
+ if (propertyOrder != null && propertyOrder.length == elementList.size()) {
+ sortItems(elementList, propertyOrder);
+ } else if (propertyOrder != null && propertyOrder.length != elementList.size()) {
+ LOG.log(Level.WARNING, "propOrder in @XmlType doesn't define all schema elements: "
+ + Arrays.toString(propertyOrder));
+ }
+
+ if (xmlAccessorOrder != null && xmlAccessorOrder.value().equals(XmlAccessOrder.ALPHABETICAL)
+ && propertyOrder == null) {
+ sort(elementList);
+ }
+
+ for (XmlSchemaElement elem : elementList) {
+ seq.getItems().add(elem);
+ }
}
}
-
private void buildExceptionType(MessagePartInfo part, Class<?> cls) {
SchemaInfo schemaInfo = null;
@@ -472,6 +506,15 @@
break;
}
}
+ XmlAccessorOrder xmlAccessorOrder = cls.getAnnotation(XmlAccessorOrder.class);
+ XmlType xmlTypeAnno = cls.getAnnotation(XmlType.class);
+ String[] propertyOrder = null;
+
+ if (xmlTypeAnno != null && xmlTypeAnno.propOrder().length > 0) {
+ propertyOrder = xmlTypeAnno.propOrder();
+ //TODO: handle @XmlAccessOrder
+ }
+
XmlSchema schema;
if (schemaInfo == null) {
schema = schemas.newXmlSchemaInCollection(part.getElementQName().getNamespaceURI());
@@ -521,32 +564,47 @@
if (accessorType == null && cls.getPackage() != null) {
accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
}
- XmlAccessType accessType = accessorType != null ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;
+ XmlAccessType accessType = Utils.getXmlAccessType(cls);
+
+ List<XmlSchemaElement> elementList = new ArrayList<XmlSchemaElement>();
+
+ for (Field f : Utils.getFields(cls, accessType)) {
+ //map field
+ Type type = Utils.getFieldType(f);
+ JAXBBeanInfo beanInfo = getBeanInfo(type);
+ if (beanInfo != null) {
+ addElement(elementList, beanInfo, new QName(namespace, f.getName()), isArray(type));
+ }
+ }
+ for (Method m : Utils.getGetters(cls, accessType)) {
+ //map method
+ Type type = Utils.getMethodReturnType(m);
+ JAXBBeanInfo beanInfo = getBeanInfo(type);
+ if (beanInfo != null) {
+ int idx = m.getName().startsWith("get") ? 3 : 2;
+ String name = m.getName().substring(idx);
+ name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
+ addElement(elementList, beanInfo, new QName(namespace, name), isArray(type));
+ }
+ }
+
+ if (propertyOrder != null && propertyOrder.length == elementList.size()) {
+ sortItems(elementList, propertyOrder);
+ } else if (propertyOrder != null && propertyOrder.length != elementList.size()) {
+ LOG.log(Level.WARNING, "propOrder in @XmlType doesn't define all schema elements: "
+ + Arrays.toString(propertyOrder));
+ }
- for (Field f : cls.getDeclaredFields()) {
- if (JAXBContextInitializer.isFieldAccepted(f, accessType)) {
- //map field
- Type type = f.getGenericType();
- JAXBBeanInfo beanInfo = getBeanInfo(type);
- if (beanInfo != null) {
- addElement(seq, beanInfo, new QName(namespace, f.getName()), isArray(type));
- }
- }
+ if (xmlAccessorOrder != null && xmlAccessorOrder.value().equals(XmlAccessOrder.ALPHABETICAL)
+ && propertyOrder == null) {
+ sort(elementList);
}
- for (Method m : cls.getMethods()) {
- if (JAXBContextInitializer.isMethodAccepted(m, accessType)) {
- //map field
- Type type = m.getGenericReturnType();
- JAXBBeanInfo beanInfo = getBeanInfo(type);
- if (beanInfo != null) {
- int idx = m.getName().startsWith("get") ? 3 : 2;
- String name = m.getName().substring(idx);
- name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
- addElement(seq, beanInfo, new QName(namespace, name), isArray(type));
- }
- }
+
+ for (XmlSchemaElement elem : elementList) {
+ seq.getItems().add(elem);
}
+
part.setProperty(JAXBDataBinding.class.getName() + ".CUSTOM_EXCEPTION", Boolean.TRUE);
}
@@ -561,7 +619,7 @@
return false;
}
- public void addElement(XmlSchemaSequence seq, JAXBBeanInfo beanInfo,
+ public void addElement(List<XmlSchemaElement> elementList, JAXBBeanInfo beanInfo,
QName name, boolean isArray) {
XmlSchemaElement el = new XmlSchemaElement();
el.setName(name.getLocalPart());
@@ -591,7 +649,7 @@
el.setSchemaTypeName(typeName);
}
- seq.getItems().add(el);
+ elementList.add(el);
}
@@ -609,4 +667,25 @@
}
return isExist;
}
+
+ //sort to Alphabetical order
+ private void sort(final List<XmlSchemaElement> elementList) {
+ Collections.sort(elementList, new Comparator<XmlSchemaElement>() {
+ public int compare(XmlSchemaElement e1, XmlSchemaElement e2) {
+ return e1.getName().compareTo(e2.getName());
+ }
+ });
+ }
+
+ private void sortItems(List<XmlSchemaElement> elementList, String[] propOrder) {
+ final List<String> propList = Arrays.asList(propOrder);
+
+ Collections.sort(elementList, new Comparator<XmlSchemaElement>() {
+ public int compare(XmlSchemaElement el1, XmlSchemaElement el2) {
+ int index1 = propList.indexOf(el1.getName());
+ int index2 = propList.indexOf(el2.getName());
+ return index1 - index2;
+ }
+ });
+ }
}
Copied: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java (from rev 17235, thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java)
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -0,0 +1,310 @@
+/**
+ * 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;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
+
+/**
+ * JAXB reflection utilities.
+ */
+final class Utils {
+ private Utils() {
+ }
+
+ static XmlAccessType getXmlAccessType(Class<?> cls) {
+ XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
+ if (accessorType == null && cls.getPackage() != null) {
+ accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);
+ }
+ return accessorType != null
+ ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;
+ }
+
+ static Collection<Field> getFields(Class<?> cls, XmlAccessType accessType) {
+ return getFieldsInternal(cls, accessType);
+ }
+
+ private static Collection<Field> getFieldsInternal(Class<?> cls, XmlAccessType accessType) {
+ Set<Field> fields = new HashSet<Field>();
+ Class<?> superClass = cls.getSuperclass();
+ if (superClass != null && !superClass.equals(Object.class) && !superClass.equals(Throwable.class)) {
+ // process super class until java.lang.Object or java.lang.Throwable is not reached
+ fields.addAll(getFieldsInternal(superClass, accessType));
+ }
+ // process current class
+ for (Field field : cls.getDeclaredFields()) {
+ if (JAXBContextInitializer.isFieldAccepted(field, accessType)) {
+ fields.add(field);
+ }
+ }
+ return fields;
+ }
+
+ private static Collection<Method> getMethods(Class<?> cls,
+ XmlAccessType accessType, boolean acceptSetters) {
+ return getMethodsInternal(cls, accessType, acceptSetters);
+ }
+
+ private static Collection<Method> getMethodsInternal(Class<?> cls, XmlAccessType accessType,
+ boolean acceptSetters) {
+ Set<Method> methods = new HashSet<Method>();
+ Class<?> superClass = cls.getSuperclass();
+ if (superClass != null && !superClass.equals(Object.class) && !superClass.equals(Throwable.class)) {
+ // process super class until java.lang.Object or java.lang.Throwable is not reached
+ methods.addAll(getMethodsInternal(superClass, accessType, acceptSetters));
+ }
+ // process current class
+ for (Method method : cls.getDeclaredMethods()) {
+ if (isMethodAccepted(method, accessType, acceptSetters)) {
+ methods.add(method);
+ }
+ }
+ return methods;
+ }
+
+ static Method getMethod(Class<?> cls, XmlAccessType accessType, String methodName,
+ Class<?>... paramTypes) {
+ for (Method m : getMethods(cls, accessType, true)) {
+ if (m.getName().equals(methodName) && Arrays.equals(m.getParameterTypes(), paramTypes)) {
+ return m;
+ }
+ }
+ return null;
+ }
+
+ static Field getField(Class<?> cls, XmlAccessType accessType, String fieldName) {
+ for (final Field f : getFields(cls, accessType)) {
+ if (f.getName().equals(fieldName)) {
+ return f;
+ }
+ }
+ return null;
+ }
+
+ static Collection<Method> getGetters(Class<?> cls, XmlAccessType accessType) {
+ return getMethods(cls, accessType, false);
+ }
+
+ static boolean isMethodAccepted(Method method, XmlAccessType accessType, boolean acceptSetters) {
+ // ignore bridge, static, @XmlTransient methods plus methods declared in Throwable
+ if (method.isBridge()
+ || Modifier.isStatic(method.getModifiers())
+ || method.isAnnotationPresent(XmlTransient.class)
+ || method.getDeclaringClass().equals(Throwable.class)) {
+ return false;
+ }
+ // Allow only public methods if PUBLIC_MEMBER access is requested
+ if (accessType == XmlAccessType.PUBLIC_MEMBER && !Modifier.isPublic(method.getModifiers())) {
+ return false;
+ }
+ if (isGetter(method)) {
+ // does nothing
+ } else if (isSetter(method)) {
+ if (!acceptSetters) {
+ return false;
+ }
+ } else {
+ // we accept only getters and setters
+ return false;
+ }
+ // let JAXB annotations decide if NONE or FIELD access is requested
+ if (accessType == XmlAccessType.NONE || accessType == XmlAccessType.FIELD) {
+ return JAXBContextInitializer.checkJaxbAnnotation(method.getAnnotations());
+ }
+ // method accepted
+ return true;
+ }
+
+ private static boolean isGetter(Method m) {
+ if (m.getReturnType() != Void.class
+ && m.getReturnType() != Void.TYPE
+ && m.getParameterTypes().length == 0) {
+ Method setter = getSetter(m);
+ if (setter != null) {
+ return !setter.isAnnotationPresent(XmlTransient.class);
+ }
+ }
+ return false;
+ }
+
+ private static Method getSetter(Method m) {
+ final int index = getterIndex(m.getName());
+ if (index != -1) {
+ String setterName = "set" + m.getName().substring(index);
+ Class<?> paramTypes = m.getReturnType();
+ return getDeclaredMethod(m.getDeclaringClass(), setterName, paramTypes);
+ }
+ return null;
+ }
+
+ private static boolean isSetter(Method m) {
+ Class<?> declaringClass = m.getDeclaringClass();
+ boolean isVoidReturnType = m.getReturnType() == Void.class || m.getReturnType() == Void.TYPE;
+ if (isVoidReturnType && m.getParameterTypes().length == 1 && m.getName().startsWith("set")) {
+ String getterName = "get" + m.getName().substring(3);
+ Class<?> setterParamType = m.getParameterTypes()[0];
+ Method getter = getDeclaredMethod(declaringClass, getterName);
+ if (getter != null && getter.getReturnType().equals(setterParamType)
+ && !getter.isAnnotationPresent(XmlTransient.class)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static int getterIndex(String methodName) {
+ if (methodName.startsWith("is")) {
+ return 2;
+ }
+ if (methodName.startsWith("get")) {
+ return 3;
+ }
+ return -1;
+ }
+
+ private static Method getDeclaredMethod(Class<?> cls, String methodName, Class<?>... paramTypes) {
+ try {
+ return cls.getDeclaredMethod(methodName, paramTypes);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ static Class<?> getFieldType(Field f) {
+ XmlJavaTypeAdapter adapter = getFieldXJTA(f);
+ Class<?> adapterType = getTypeFromXmlAdapter(adapter);
+ return adapterType != null ? adapterType : f.getType();
+ }
+
+ static Class<?> getMethodReturnType(Method m) {
+ XmlJavaTypeAdapter adapter = getMethodXJTA(m);
+ Class<?> adapterType = getTypeFromXmlAdapter(adapter);
+ return adapterType != null ? adapterType : m.getReturnType();
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ static Object getFieldValue(Field f, Object target) throws Exception {
+ XmlJavaTypeAdapter adapterAnnotation = getFieldXJTA(f);
+ XmlAdapter adapter = getXmlAdapter(adapterAnnotation);
+ return adapter != null ? adapter.marshal(f.get(target)) : f.get(target);
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ static Object getMethodValue(Method m, Object target) throws Exception {
+ XmlJavaTypeAdapter adapterAnnotation = getMethodXJTA(m);
+ XmlAdapter adapter = getXmlAdapter(adapterAnnotation);
+ return adapter != null ? adapter.marshal(m.invoke(target)) : m.invoke(target);
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ static void setFieldValue(Field f, Object target, Object value) throws Exception {
+ XmlJavaTypeAdapter xjta = getFieldXJTA(f);
+ XmlAdapter adapter = getXmlAdapter(xjta);
+ f.set(target, adapter != null ? adapter.unmarshal(value) : value);
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ static void setMethodValue(Method getter, Method setter, Object target, Object value) throws Exception {
+ XmlJavaTypeAdapter xjta = getMethodXJTA(getter);
+ XmlAdapter adapter = getXmlAdapter(xjta);
+ setter.invoke(target, adapter != null ? adapter.unmarshal(value) : value);
+ }
+
+ @SuppressWarnings("rawtypes")
+ static XmlAdapter getXmlAdapter(XmlJavaTypeAdapter adapterAnnotation)
+ throws InstantiationException, IllegalAccessException {
+ return adapterAnnotation != null ? adapterAnnotation.value().newInstance() : null;
+ }
+
+ static XmlJavaTypeAdapter getFieldXJTA(final Field f) {
+ XmlJavaTypeAdapter adapter = f.getAnnotation(XmlJavaTypeAdapter.class);
+ if (adapter == null) {
+ adapter = f.getType().getAnnotation(XmlJavaTypeAdapter.class);
+ }
+ if (adapter == null) {
+ XmlJavaTypeAdapters adapters =
+ f.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
+ if (adapters != null) {
+ for (XmlJavaTypeAdapter candidate : adapters.value()) {
+ if (candidate != null && candidate.type().equals(f.getType())) {
+ adapter = candidate;
+ break;
+ }
+ }
+ }
+ }
+ return adapter;
+ }
+
+ static XmlJavaTypeAdapter getMethodXJTA(final Method m) {
+ XmlJavaTypeAdapter adapter = m.getAnnotation(XmlJavaTypeAdapter.class);
+ if (adapter == null) {
+ Method setter = getSetter(m);
+ adapter = setter.getAnnotation(XmlJavaTypeAdapter.class);
+ }
+ if (adapter == null) {
+ adapter = m.getReturnType().getAnnotation(XmlJavaTypeAdapter.class);
+ }
+ if (adapter == null) {
+ XmlJavaTypeAdapters adapters =
+ m.getDeclaringClass().getPackage().getAnnotation(XmlJavaTypeAdapters.class);
+ if (adapters != null) {
+ for (XmlJavaTypeAdapter candidate : adapters.value()) {
+ if (candidate != null && candidate.type().equals(m.getGenericReturnType())) {
+ adapter = candidate;
+ break;
+ }
+ }
+ }
+ }
+ return adapter;
+ }
+
+ static Class<?> getTypeFromXmlAdapter(XmlJavaTypeAdapter xjta) {
+ if (xjta != null) {
+ Class<?> c2 = xjta.value();
+ Type sp = c2.getGenericSuperclass();
+ while (!XmlAdapter.class.equals(c2) && c2 != null) {
+ sp = c2.getGenericSuperclass();
+ c2 = c2.getSuperclass();
+ }
+ if (sp instanceof ParameterizedType) {
+ return (Class<?>)((ParameterizedType)sp).getActualTypeArguments()[0];
+ }
+ }
+ return null;
+ }
+
+}
Deleted: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java 2013-01-11 23:52:05 UTC (rev 17235)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -1,26 +0,0 @@
-/**
- * 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.tools.fortest.exception;
-
-import javax.jws.WebService;
-
-@WebService(targetNamespace = "http://cxf.apache.org/test/HelloService", name = "HelloService")
-public interface Echo {
- String echo(String request) throws MyException;
-}
Copied: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java (from rev 17235, thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java)
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -0,0 +1,26 @@
+/**
+ * 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.tools.fortest.exception;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://cxf.apache.org/test/HelloService", name = "HelloService")
+public interface Echo {
+ String echo(String request) throws MyException;
+}
Deleted: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java 2013-01-11 23:52:05 UTC (rev 17235)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -1,33 +0,0 @@
-/**
- * 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.tools.fortest.exception;
-
-import javax.jws.WebService;
-
-@WebService(serviceName = "HelloService",
- portName = "HelloPort",
- endpointInterface = "org.apache.cxf.tools.fortest.exception.Echo",
- targetNamespace = "http://cxf.apache.org/test/HelloService")
-public class EchoImpl {
- public String echo(String request) throws MyException {
- return "Response";
-
- }
-
-}
Copied: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java (from rev 17235, thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java)
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/EchoImpl.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -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.tools.fortest.exception;
+
+import javax.jws.WebService;
+
+@WebService(serviceName = "HelloService",
+ portName = "HelloPort",
+ endpointInterface = "org.apache.cxf.tools.fortest.exception.Echo",
+ targetNamespace = "http://cxf.apache.org/test/HelloService")
+public class EchoImpl {
+ public String echo(String request) throws MyException {
+ return "Response";
+
+ }
+
+}
Deleted: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java 2013-01-11 23:52:05 UTC (rev 17235)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -1,52 +0,0 @@
-/**
- * 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.tools.fortest.exception;
-
-import javax.xml.bind.annotation.XmlType;
-
-(a)javax.xml.ws.WebFault
-@XmlType(namespace = "http://cxf.apache.org/test/HelloService",
- name = "MyException",
- propOrder = { "summary", "from", "id" })
-public class MyException extends SuperException {
- private static final long serialVersionUID = 8575109064272599936L;
- private String summary;
- private String from;
-
- public MyException(String message) {
- super(message);
- }
-
- public void setSummary(String summary) {
- this.summary = summary;
- }
-
- public void setFrom(String from) {
- this.from = from;
- }
-
- public String getSummary() {
- return summary;
- }
-
- public String getFrom() {
- return from;
- }
-
-}
Copied: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java (from rev 17235, thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java)
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -0,0 +1,52 @@
+/**
+ * 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.tools.fortest.exception;
+
+import javax.xml.bind.annotation.XmlType;
+
+(a)javax.xml.ws.WebFault
+@XmlType(namespace = "http://cxf.apache.org/test/HelloService",
+ name = "MyException",
+ propOrder = { "summary", "from", "id" })
+public class MyException extends SuperException {
+ private static final long serialVersionUID = 8575109064272599936L;
+ private String summary;
+ private String from;
+
+ public MyException(String message) {
+ super(message);
+ }
+
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ public void setFrom(String from) {
+ this.from = from;
+ }
+
+ public String getSummary() {
+ return summary;
+ }
+
+ public String getFrom() {
+ return from;
+ }
+
+}
Deleted: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java 2013-01-11 23:52:05 UTC (rev 17235)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -1,36 +0,0 @@
-/**
- * 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.tools.fortest.exception;
-
-public class SuperException extends Exception {
- private static final long serialVersionUID = 1L;
- private int id;
-
- public SuperException(String message) {
- super(message);
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public int getId() {
- return id;
- }
-}
Copied: thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java (from rev 17235, thirdparty/cxf/branches/cxf-2.2.12-patch02_JBPAPP-10129/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java)
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java (rev 0)
+++ thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java 2013-02-22 12:35:42 UTC (rev 17343)
@@ -0,0 +1,36 @@
+/**
+ * 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.tools.fortest.exception;
+
+public class SuperException extends Exception {
+ private static final long serialVersionUID = 1L;
+ private int id;
+
+ public SuperException(String message) {
+ super(message);
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getId() {
+ return id;
+ }
+}
11 years, 10 months
JBossWS SVN: r17342 - thirdparty/cxf/branches.
by jbossws-commits@lists.jboss.org
Author: mmusaji
Date: 2013-02-22 05:47:27 -0500 (Fri, 22 Feb 2013)
New Revision: 17342
Added:
thirdparty/cxf/branches/cxf-2.2.12-patch-02_JBPAPP-10651/
Log:
[JBPAPP-10651] Create one off patch branch
11 years, 10 months
JBossWS SVN: r17341 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-21 07:45:05 -0500 (Thu, 21 Feb 2013)
New Revision: 17341
Modified:
stack/native/trunk/pom.xml
Log:
Use latest shared-testesuite snapshot
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2013-02-20 17:30:30 UTC (rev 17340)
+++ stack/native/trunk/pom.xml 2013-02-21 12:45:05 UTC (rev 17341)
@@ -60,7 +60,7 @@
<jbossws.spi.version>2.1.1.Final</jbossws.spi.version>
<jbossws.common.version>2.1.1.Final</jbossws.common.version>
<jbossws.common.tools.version>1.1.0.Final</jbossws.common.tools.version>
- <jbossws.shared.testsuite.version>4.1.0.Final</jbossws.shared.testsuite.version>
+ <jbossws.shared.testsuite.version>4.2.0-SNAPSHOT</jbossws.shared.testsuite.version>
<jbossws.jboss720.version>4.2.0-SNAPSHOT</jbossws.jboss720.version>
<jboss720.version>7.2.0.Final</jboss720.version>
<jboss800.version>8.0.0.Alpha1-SNAPSHOT</jboss800.version>
11 years, 10 months