Author: veithen
Date: Sat Mar 20 18:19:35 2010
New Revision: 925648

URL: http://svn.apache.org/viewvc?rev=925648&view=rev
Log:
Propagated some old changes from ADBBeanTemplate-bean.xsl to 
ADBBeanTemplate-helpermode.xsl to make sure that tracker attributes are updated 
in the same way. Also added a test case.

Added:
    axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/
    axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/
    axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/
    axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/
    
axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/
    
axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/testsuite/
    
axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/testsuite/TrackerTest.java
   (with props)
Modified:
    axis/axis2/java/core/trunk/modules/adb-codegen/pom.xml
    
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
    axis/axis2/java/core/trunk/modules/adb-codegen/sub-build.xml
    
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/testsuite/TrackerTest.java

Modified: axis/axis2/java/core/trunk/modules/adb-codegen/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/pom.xml?rev=925648&r1=925647&r2=925648&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/pom.xml Sat Mar 20 18:19:35 
2010
@@ -113,6 +113,9 @@
                        <fork>true</fork>
                        <meminitial>128m</meminitial>
                        <maxmem>256m</maxmem>
+                    <testExcludes>
+                        
<exclude>helper/org/apache/axis2/schema/testsuite/TestAnyType*Helper.java</exclude>
+                    </testExcludes>
                    </configuration>
                </plugin>
             <plugin>

Modified: 
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl?rev=925648&r1=925647&r2=925648&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
 Sat Mar 20 18:19:35 2010
@@ -34,6 +34,7 @@
         <xsl:variable name="extension" select="@extension"/>
         <xsl:variable name="restriction" select="@restriction"/>
         <xsl:variable name="mapperClass" select="@mapperClass"/>
+        <xsl:variable name="usewrapperclasses" select="@usewrapperclasses"/>
         <xsl:variable name="package" select="@package"/>
         <xsl:variable name="helpername"><xsl:value-of 
select="$name"/>Helper</xsl:variable>
 
@@ -435,7 +436,43 @@
                                 <xsl:choose>
                                    <xsl:when test="@primitive and not(@array)">
                                        // setting primitive attribute tracker 
to true
-                                       <xsl:value-of 
select="$settingTracker"/> = true;
+                                       <xsl:choose>
+                                           <xsl:when test="$usewrapperclasses">
+                                              if (false) {
+                                           </xsl:when>
+                                           <xsl:when 
test="$propertyType='int'">
+                                               if 
(param==java.lang.Integer.MIN_VALUE) {
+                                           </xsl:when>
+                                           <xsl:when 
test="$propertyType='long'">
+                                               if 
(param==java.lang.Long.MIN_VALUE) {
+                                           </xsl:when>
+                                           <xsl:when 
test="$propertyType='byte'">
+                                               if 
(param==java.lang.Byte.MIN_VALUE) {
+                                           </xsl:when>
+                                           <xsl:when 
test="$propertyType='double'">
+                                               if 
(java.lang.Double.isNaN(param)) {
+                                           </xsl:when>
+                                           <xsl:when 
test="$propertyType='float'">
+                                               if 
(java.lang.Float.isNaN(param)) {
+                                           </xsl:when>
+                                           <xsl:when 
test="$propertyType='short'">
+                                               if 
(param==java.lang.Short.MIN_VALUE) {
+                                           </xsl:when>
+                                           <xsl:otherwise>
+                                               if (false) {
+                                           </xsl:otherwise>
+                                       </xsl:choose>
+                                            <xsl:choose>
+                                              <xsl:when test="@nillable">
+                                                  <xsl:value-of 
select="$settingTracker"/> = true;
+                                              </xsl:when>
+                                              <xsl:otherwise>
+                                                  <xsl:value-of 
select="$settingTracker"/> = false;
+                                              </xsl:otherwise>
+                                          </xsl:choose>
+                                       } else {
+                                          <xsl:value-of 
select="$settingTracker"/> = true;
+                                       }
                                    </xsl:when>
                                    <xsl:otherwise>
                                        if (param != null){

Modified: axis/axis2/java/core/trunk/modules/adb-codegen/sub-build.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/sub-build.xml?rev=925648&r1=925647&r2=925648&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/sub-build.xml (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/sub-build.xml Sat Mar 20 
18:19:35 2010
@@ -104,6 +104,7 @@
                        <arg value="-p"/>
                        <arg value="helper."/>
                        <arg value="-h"/>
+                       <arg file="${testsuite.source.dir}/testsuite.xsd"/>
                        <arg file="${testsuite.source.dir}/all.xsd"/>
                        <arg file="${testsuite.source.dir}/boolean.xsd"/>
                        <arg file="${testsuite.source.dir}/chameleon.xsd"/>

Added: 
axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/testsuite/TrackerTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/testsuite/TrackerTest.java?rev=925648&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/testsuite/TrackerTest.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/testsuite/TrackerTest.java
 Sat Mar 20 18:19:35 2010
@@ -0,0 +1,108 @@
+/*
+ * 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 helper.org.apache.axis2.schema.testsuite;
+
+import junit.framework.TestCase;
+
+// NOTE: Please keep this test case in sync with the one in 
org.apache.axis2.schema.testsuite!
+public class TrackerTest extends TestCase {
+    public void testInt1WithNonNullValue() {
+        TestInt1 bean = new TestInt1();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(new int[] { 123 });
+        assertTrue(bean.localTestValueTracker);
+    }
+    
+    public void testInt1WithNullValue() {
+        TestInt1 bean = new TestInt1();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(null);
+        assertTrue(bean.localTestValueTracker);
+    }
+    
+    public void testInt2() {
+        TestInt2 bean = new TestInt2();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(1234);
+        assertTrue(bean.localTestValueTracker);
+    }
+    
+    public void testInt2WithMinValue() {
+        TestInt2 bean = new TestInt2();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(Integer.MIN_VALUE);
+        assertTrue(bean.localTestValueTracker);
+    }
+    
+    public void testInt3WithNonNullValue() {
+        TestInt3 bean = new TestInt3();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(new int[] { 123 });
+        assertTrue(bean.localTestValueTracker);
+    }
+    
+    public void testInt3WithNullValue() {
+        TestInt3 bean = new TestInt3();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(null);
+        assertFalse(bean.localTestValueTracker);
+    }
+    
+    public void testInt4() {
+        TestInt4 bean = new TestInt4();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(1234);
+        assertTrue(bean.localTestValueTracker);
+    }
+    
+    public void testInt4WithMinValue() {
+        TestInt4 bean = new TestInt4();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(Integer.MIN_VALUE);
+        assertFalse(bean.localTestValueTracker);
+    }
+    
+    public void testString2WithNonNullValue() {
+        TestString2 bean = new TestString2();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue("test");
+        assertTrue(bean.localTestValueTracker);
+    }
+
+    public void testString2WithNullValue() {
+        TestString2 bean = new TestString2();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(null);
+        assertTrue(bean.localTestValueTracker);
+    }
+    
+    public void testString4WithNonNullValue() {
+        TestString4 bean = new TestString4();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue("test");
+        assertTrue(bean.localTestValueTracker);
+    }
+
+    public void testString4WithNullValue() {
+        TestString4 bean = new TestString4();
+        assertFalse(bean.localTestValueTracker);
+        bean.setTestValue(null);
+        assertFalse(bean.localTestValueTracker);
+    }
+}

Propchange: 
axis/axis2/java/core/trunk/modules/adb-codegen/test/helper/org/apache/axis2/schema/testsuite/TrackerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/testsuite/TrackerTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/testsuite/TrackerTest.java?rev=925648&r1=925647&r2=925648&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/testsuite/TrackerTest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/testsuite/TrackerTest.java
 Sat Mar 20 18:19:35 2010
@@ -20,6 +20,7 @@ package org.apache.axis2.schema.testsuit
 
 import junit.framework.TestCase;
 
+// NOTE: Please keep this test case in sync with the one in 
helper.org.apache.axis2.schema.testsuite!
 public class TrackerTest extends TestCase {
     public void testInt1WithNonNullValue() {
         TestInt1 bean = new TestInt1();


Reply via email to