cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1056596 - in /cxf/xjc-utils/trunk: dv-test/src/test/java/org/apache/cxf/xjc/dv/DefaultValueTest.java dv-test/src/test/resources/schemas/configuration/foo.xsd dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java pom.xml
Date Sat, 08 Jan 2011 02:16:10 GMT
Author: dkulp
Date: Sat Jan  8 02:16:09 2011
New Revision: 1056596

URL: http://svn.apache.org/viewvc?rev=1056596&view=rev
Log:
[CXF-3131] Fix problem of XmlElemtn annotions being removed
Update builds for latest plugins and config and such

Modified:
    cxf/xjc-utils/trunk/dv-test/src/test/java/org/apache/cxf/xjc/dv/DefaultValueTest.java
    cxf/xjc-utils/trunk/dv-test/src/test/resources/schemas/configuration/foo.xsd
    cxf/xjc-utils/trunk/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java
    cxf/xjc-utils/trunk/pom.xml

Modified: cxf/xjc-utils/trunk/dv-test/src/test/java/org/apache/cxf/xjc/dv/DefaultValueTest.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/dv-test/src/test/java/org/apache/cxf/xjc/dv/DefaultValueTest.java?rev=1056596&r1=1056595&r2=1056596&view=diff
==============================================================================
--- cxf/xjc-utils/trunk/dv-test/src/test/java/org/apache/cxf/xjc/dv/DefaultValueTest.java
(original)
+++ cxf/xjc-utils/trunk/dv-test/src/test/java/org/apache/cxf/xjc/dv/DefaultValueTest.java
Sat Jan  8 02:16:09 2011
@@ -19,10 +19,12 @@
 
 package org.apache.cxf.xjc.dv;
 
+import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 
 import javax.xml.bind.DatatypeConverter;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
 import javax.xml.namespace.QName;
 
@@ -43,12 +45,18 @@ public class DefaultValueTest extends As
         Foo foo = new org.apache.cxf.configuration.foo.ObjectFactory().createFoo();
 
         // verify default values
+        checkCXF3131(foo);
 
         assertAttributeValuesWithoutDefault(foo);
         assertDefaultAttributeValues(foo);        
         assertDefaultElementValues(foo);   
     }
 
+    private void checkCXF3131(Foo foo) throws Exception {
+        Field f = foo.getClass().getDeclaredField("point");
+        assertNotNull(f.getAnnotation(XmlElement.class));
+    }
+
     private void assertDefaultAttributeValues(Foo foo) {
         assertEquals("Unexpected value for attribute stringAttr",
                      "hello", foo.getStringAttr());

Modified: cxf/xjc-utils/trunk/dv-test/src/test/resources/schemas/configuration/foo.xsd
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/dv-test/src/test/resources/schemas/configuration/foo.xsd?rev=1056596&r1=1056595&r2=1056596&view=diff
==============================================================================
--- cxf/xjc-utils/trunk/dv-test/src/test/resources/schemas/configuration/foo.xsd (original)
+++ cxf/xjc-utils/trunk/dv-test/src/test/resources/schemas/configuration/foo.xsd Sat Jan 
8 02:16:09 2011
@@ -52,9 +52,9 @@
         <xs:sequence>
 	    <xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>
             <xs:element name="driving" type="tns:drivingDecision" default="LeftTurn" minOccurs="0"></xs:element>
-            <xs:element name="stringElem" type="xs:string" default="hello" minOccurs="0"></xs:element>
-            <xs:element name="booleanElem" type="xs:boolean" default="true" minOccurs="0"></xs:element>
-            <xs:element name="integerElem" type="xs:integer" default="11" minOccurs="0"></xs:element>
+            <xs:element name="StringElem" type="xs:string" default="hello" minOccurs="0"></xs:element>
+            <xs:element name="BooleanElem" type="xs:boolean" default="true" minOccurs="0"></xs:element>
+            <xs:element name="IntegerElem" type="xs:integer" default="11" minOccurs="0"></xs:element>
             <xs:element name="intElem" type="xs:int" default="12" minOccurs="0"></xs:element>
             <xs:element name="longElem" type="xs:long" default="13" minOccurs="0"></xs:element>
             <xs:element name="shortElem" type="xs:short" default="14" minOccurs="0"></xs:element>
@@ -72,9 +72,9 @@
             <xs:element name="temperature" type="tns:celsius" default="37" minOccurs="0"></xs:element>
             <xs:element name="roomTemperature" type="tns:cel" default="38" minOccurs="0"></xs:element>
             
-            <xs:element name="point" type="tns:point" minOccurs="0"></xs:element>
+            <xs:element name="Point" type="tns:point" minOccurs="0"></xs:element>
 
-            <xs:element name="address" minOccurs="0">
+            <xs:element name="Address" minOccurs="0">
             <xs:complexType>
                 <xs:sequence>
                     <xs:element name="city" type="xs:string"></xs:element>
@@ -125,8 +125,8 @@
     
     <xs:complexType name="point">
         <xs:sequence>
-            <xs:element name="x" type="xs:int"></xs:element>
-            <xs:element name="y" type="xs:int"></xs:element>
+            <xs:element name="X" type="xs:int" default="0" minOccurs="0"></xs:element>
+            <xs:element name="Y" type="xs:int" default="0" minOccurs="0"></xs:element>
         </xs:sequence>
     </xs:complexType>    
         

Modified: cxf/xjc-utils/trunk/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java?rev=1056596&r1=1056595&r2=1056596&view=diff
==============================================================================
--- cxf/xjc-utils/trunk/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java (original)
+++ cxf/xjc-utils/trunk/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java Sat
Jan  8 02:16:09 2011
@@ -136,13 +136,7 @@ public class DefaultValuePlugin {
                     String varName = f.getPropertyInfo().getName(false);
                     JFieldVar var = co.implClass.fields().get(varName);
                     if (var != null) {
-                        co.implClass.removeField(var);
-
-                        JFieldVar newVar = co.implClass.field(var.mods().getValue(), 
-                                                              var.type(), 
-                                                              var.name(), 
-                                                              JExpr._new(f.getRawType()));
-                        newVar.javadoc().append(var.javadoc());
+                        var.init(JExpr._new(f.getRawType()));
                     }
                 }
 

Modified: cxf/xjc-utils/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/pom.xml?rev=1056596&r1=1056595&r2=1056596&view=diff
==============================================================================
--- cxf/xjc-utils/trunk/pom.xml (original)
+++ cxf/xjc-utils/trunk/pom.xml Sat Jan  8 02:16:09 2011
@@ -39,10 +39,6 @@
     <properties>
         <jdk.version>1.6</jdk.version>
 
-        <jaxb.version>2.1</jaxb.version>
-        <jaxb.xjc.version>2.1.12</jaxb.xjc.version>
-        <jaxb.impl.version>2.1.12</jaxb.impl.version>
-
         <eclipse.outputDirectory>${basedir}/target/classes</eclipse.outputDirectory>
         <downloadSources>true</downloadSources>
 
@@ -87,12 +83,12 @@
             <dependency>
                 <groupId>com.sun.xml.bind</groupId>
                 <artifactId>jaxb-impl</artifactId>
-                <version>2.1.12</version>
+                <version>2.1.13</version>
             </dependency>
             <dependency>
                 <groupId>com.sun.xml.bind</groupId>
                 <artifactId>jaxb-xjc</artifactId>
-                <version>2.1.12</version>
+                <version>2.1.13</version>
             </dependency>
             <dependency>
                 <groupId>junit</groupId>
@@ -233,11 +229,15 @@
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <version>2.5</version>
+                    <configuration>
+                        <reportFormat>brief</reportFormat>
+                        <useFile>false</useFile>
+                    </configuration>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
-                    <version>2.0.2</version>
+                    <version>2.1</version>
                     <configuration>
                         <source>1.5</source>
                         <target>1.5</target>
@@ -294,7 +294,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-site-plugin</artifactId>
-                    <version>2.0.1</version>
+                    <version>3.0-beta-3</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -309,7 +309,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-project-info-reports-plugin</artifactId>
-                    <version>2.1.1</version>
+                    <version>2.2</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -319,7 +319,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-eclipse-plugin</artifactId>
-                    <version>2.7</version>
+                    <version>2.8</version>
                     <configuration>
                         <outputDirectory>${eclipse.outputDirectory}</outputDirectory>
                         <buildcommands>
@@ -352,19 +352,19 @@
                         <dependency>
                             <groupId>org.apache.cxf.build-utils</groupId>
                             <artifactId>cxf-buildtools</artifactId>
-                            <version>2.3.0</version>
+                            <version>2.3.1</version>
                         </dependency>
                     </dependencies>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-checkstyle-plugin</artifactId>
-                    <version>2.5</version>
+                    <version>2.6</version>
                     <dependencies>
                         <dependency>
                             <groupId>org.apache.cxf.build-utils</groupId>
                             <artifactId>cxf-buildtools</artifactId>
-                            <version>2.3.0</version>
+                            <version>2.3.1</version>
                         </dependency>
                     </dependencies>
                     <configuration>
@@ -397,7 +397,7 @@
                         <dependency>
                             <groupId>org.apache.cxf.build-utils</groupId>
                             <artifactId>cxf-buildtools</artifactId>
-                            <version>2.3.0</version>
+                            <version>2.3.1</version>
                         </dependency>
                     </dependencies>
                     <configuration>



Mime
View raw message