Hi,

When I run the test suite for adb in Eclipse, I get a failure in this block (in 
ConverterUtilTest.testConvertToDate):

        TimeZone timeZone = TimeZone.getTimeZone("Australia/Perth");
        Calendar c = Calendar.getInstance(timeZone);
        c.clear();
        c.set(2008, Calendar.JANUARY, 1);
        
TestCase.assertTrue(ConverterUtil.convertToString(c).endsWith("+08:00"));

The result I get from convertToString is 2008-01-01T00:00:00.000+09:00. 
According to this page:

http://www.timeanddate.com/worldclock/timezone.html?n=196

DST was in effect in Perth on January 1, 2008, so the correct offset is indeed 
+09:00.

Related to this, the pom.xml contains the following line:

<exclude>**/*Util*.java</exclude>

This seems to prevent this test from ever being run during the build. 
ConverterUtilTest.java seems to be the only file matching this pattern. Is this 
intentional?

The attached patch removes the exclusion and fixes the time zone offset. It 
also moves the offending block into it's own test method, as it is not testing 
convertToDate.

Pétur Runólfsson
Betware

The content of this e-mail, together with any of its attachments, is for the 
exclusive and confidential use of the named addressee(s) and it may contain 
legally privileged and confidential information and/or copyrighted material. 
Any other distribution, use or reproduction without the sender's prior consent 
is unauthorized and strictly prohibited. If you have by coincidence, mistake or 
without specific authorization received this e-mail in error, please notify the 
sender by e-mail immediately, uphold strict confidentiality and neither read, 
copy, transfer, disseminate, disclose nor otherwise make use of its content in 
any way and delete the material from your computer.

The content of the e-mail and its attachments is the liability of the 
individual sender, if it does not relate to the affairs of Betware.
Betware does not assume any civil or criminal liability should the e-mail or 
it´s attachments be virus infected.
Index: test/org/apache/axis2/databinding/utils/ConverterUtilTest.java
===================================================================
--- test/org/apache/axis2/databinding/utils/ConverterUtilTest.java	(revision 782926)
+++ test/org/apache/axis2/databinding/utils/ConverterUtilTest.java	(working copy)
@@ -157,11 +157,15 @@
         System.out.println("calendar ==> " + simpleDateFormat.format(date));
         System.out.println("calendar ==> " + ConverterUtil.convertToString(date));
 
+    }
+
+    public void testConvertCalendarToString() {
+        
         TimeZone timeZone = TimeZone.getTimeZone("Australia/Perth");
         Calendar c = Calendar.getInstance(timeZone);
         c.clear();
         c.set(2008, Calendar.JANUARY, 1);
-        TestCase.assertTrue(ConverterUtil.convertToString(c).endsWith("+08:00"));
+        TestCase.assertTrue(ConverterUtil.convertToString(c).endsWith("+09:00"));
         
     }
 
Index: pom.xml
===================================================================
--- pom.xml	(revision 782926)
+++ pom.xml	(working copy)
@@ -105,7 +105,6 @@
                     <skip>false</skip>
                     <excludes>
                         <exclude>**/*Abstract*.java</exclude>
-                        <exclude>**/*Util*.java</exclude>
                         <exclude>**/*PhaseResolvingTest.java</exclude>
                     </excludes>
                     <includes>

Reply via email to