cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1445371 - in /cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src: main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Date Tue, 12 Feb 2013 21:15:37 GMT
Author: dkulp
Date: Tue Feb 12 21:15:37 2013
New Revision: 1445371

URL: http://svn.apache.org/r1445371
Log:
Merged revisions 1443588 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1443588 | dkulp | 2013-02-07 11:17:53 -0500 (Thu, 07 Feb 2013) | 2 lines

  [CXF-4711] Add testcase, show's it's working

........

Modified:
    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/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java

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=1445371&r1=1445370&r2=1445371&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
Tue Feb 12 21:15:37 2013
@@ -265,7 +265,7 @@ class JAXBContextInitializer extends Ser
     }
 
 
-    private  void addClass(Class<?> cls) {
+    void addClass(Class<?> cls) {
         if (Throwable.class.isAssignableFrom(cls)) {
             if (!Throwable.class.equals(cls)
                 && !Exception.class.equals(cls)) {

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java?rev=1445371&r1=1445370&r2=1445371&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Tue Feb 12 21:15:37 2013
@@ -22,7 +22,9 @@ package org.apache.cxf.jaxb;
 
 import java.io.OutputStream;
 import java.io.StringWriter;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -230,4 +232,24 @@ public class JAXBDataBindingTest extends
         String xml = stringWriter.toString();
         assertTrue(xml, xml.contains("greenland=\"uri:ultima:thule"));
     }
+    
+    
+    @Test
+    public void testResursiveType() throws Exception {
+        Set<Class<?>> classes = new HashSet<Class<?>>();
+        Collection<Object> typeReferences = new ArrayList<Object>();
+        JAXBContextInitializer init = new JAXBContextInitializer(null, classes, typeReferences);
+        init.addClass(Type2.class);
+        assertEquals(2, classes.size());
+    }
+    
+    public abstract static class Type2 extends AddressEntity<Type2> {
+    }
+    
+    public abstract static class AddressEntity<T extends AddressEntity<T>> {
+        public abstract Addressable<T> getEntity();
+    }
+    
+    public interface Addressable<T extends AddressEntity<T>> {
+    }    
 }



Mime
View raw message