Author: ema
Date: Fri Aug 23 09:12:57 2013
New Revision: 1516766
URL: http://svn.apache.org/r1516766
Log:
Merged revisions 1516724,1516735,1516754,1516760 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1516724 | ema | 2013-08-23 15:53:23 +0800 (Fri, 23 Aug 2013) | 1 line
[CXF-5230]:Message element is not generated for exception class which extends
Exception
........
r1516735 | ema | 2013-08-23 16:14:28 +0800 (Fri, 23 Aug 2013) | 1 line
[CXF-5230]:Message element is not generated for exception class which extends
Exception
........
r1516754 | ema | 2013-08-23 16:57:48 +0800 (Fri, 23 Aug 2013) | 1 line
[CXF-5219]:Apply patch from Kyle and add testcase
........
r1516760 | ema | 2013-08-23 17:07:11 +0800 (Fri, 23 Aug 2013) | 1 line
[CXF-5219]:Add missing files in previous commit
........
Added:
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Cl1ToCl2Adapter.java
- copied unchanged from r1516760,
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Cl1ToCl2Adapter.java
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyClass1.java
- copied unchanged from r1516760,
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyClass1.java
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyClass2.java
- copied unchanged from r1516760,
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyClass2.java
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/TypeAdapterEcho.java
- copied unchanged from r1516760,
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/TypeAdapterEcho.java
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/TypeAdapterException.java
- copied unchanged from r1516760,
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/TypeAdapterException.java
Modified:
cxf/branches/2.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Merged /cxf/trunk:r1516724-1516735,1516754-1516760
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java?rev=1516766&r1=1516765&r2=1516766&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
(original)
+++
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Fri Aug 23 09:12:57 2013
@@ -339,6 +339,14 @@ class JAXBContextInitializer extends Ser
Field fields[] = ReflectionUtil.getDeclaredFields(cls);
for (Field f : fields) {
if (isFieldAccepted(f, accessType)) {
+ XmlJavaTypeAdapter xjta = Utils.getFieldXJTA(f);
+ if (xjta != null) {
+ Type t = Utils.getTypeFromXmlAdapter(xjta);
+ if (t != null) {
+ addType(t);
+ continue;
+ }
+ }
addType(f.getGenericType());
}
}
@@ -349,6 +357,14 @@ class JAXBContextInitializer extends Ser
Method methods[] = ReflectionUtil.getDeclaredMethods(cls);
for (Method m : methods) {
if (isMethodAccepted(m, accessType)) {
+ XmlJavaTypeAdapter xjta = Utils.getMethodXJTA(m);
+ if (xjta != null) {
+ Type t = Utils.getTypeFromXmlAdapter(xjta);
+ if (t != null) {
+ addType(t);
+ continue;
+ }
+ }
addType(m.getGenericReturnType());
for (Type t : m.getGenericParameterTypes()) {
addType(t);
Modified:
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=1516766&r1=1516765&r2=1516766&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++
cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Fri Aug 23 09:12:57 2013
@@ -569,7 +569,7 @@ class JAXBSchemaInitializer extends Serv
}
}
// Create element in xsd:sequence for Exception.class
- if (cls.equals(Exception.class)) {
+ if (Exception.class.isAssignableFrom(cls)) {
JAXBBeanInfo beanInfo = getBeanInfo(java.lang.String.class);
XmlSchemaElement exEle = new XmlSchemaElement(schema, false);
exEle.setName("message");
Modified:
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java?rev=1516766&r1=1516765&r2=1516766&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java
(original)
+++
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyException.java
Fri Aug 23 09:12:57 2013
@@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlType
@javax.xml.ws.WebFault
@XmlType(namespace = "http://cxf.apache.org/test/HelloService",
name = "MyException",
- propOrder = { "summary", "from", "id" })
+ propOrder = { "summary", "from", "id", "message" })
public class MyException extends SuperException {
private static final long serialVersionUID = 8575109064272599936L;
private String summary;
Modified:
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?rev=1516766&r1=1516765&r2=1516766&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++
cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Fri Aug 23 09:12:57 2013
@@ -707,6 +707,7 @@ public class JavaToProcessorTest extends
@Test
public void testPropOrderInException() throws Exception {
env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() +
"/exception_prop_order.wsdl");
+ //env.put(ToolConstants.CFG_OUTPUTFILE,
"/x1/tmp/exception_prop_order.wsdl");
env.put(ToolConstants.CFG_CLASSNAME,
"org.apache.cxf.tools.fortest.exception.EchoImpl");
env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
try {
@@ -797,6 +798,28 @@ public class JavaToProcessorTest extends
}
+ @Test
+ public void testExceptionTypeAdapter() throws Exception {
+ env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() +
"/exception-type-adapter.wsdl");
+ env.put(ToolConstants.CFG_CLASSNAME,
"org.apache.cxf.tools.fortest.exception.TypeAdapterEcho");
+ env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
+ try {
+ processor.setEnvironment(env);
+ processor.process();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ File wsdlFile = new File(output, "exception-type-adapter.wsdl");
+ assertTrue(wsdlFile.exists());
+ String wsdlContent = getStringFromFile(wsdlFile).replaceAll(" ", " ");
+ int class2Element = wsdlContent.indexOf("<xs:complexType
name=\"myClass2\">");
+ assertTrue(class2Element > -1);
+ int refElement = wsdlContent.indexOf("<xs:element name=\"adapted\"
nillable=\"true\" type=\"tns:myClass2\"/>");
+ assertTrue(refElement > -1);
+
+ }
+
@Test
public void testCXF4877() throws Exception {