package org.tigris.subversion.svnclientadapter.commandline;

import java.util.Date;

import junit.framework.TestCase;

public class HelperTest extends TestCase {

	public void testConvertXMLDate() throws Exception {
		
		// before patch from Jennifer Bevan, svnClientAdapter was incorrectly
		// setting dates at 12:xx PM to 12:xx AM  
		assertEquals(new Date(2003-1900, 0, 10, 23, 21,54), Helper.convertXMLDate("2003-01-10T23:21:54.831325Z"));
		assertEquals(new Date(2003-1900, 0, 11, 12, 01,06), Helper.convertXMLDate("2003-01-11T12:01:06.649052Z"));
		assertEquals(new Date(2003-1900, 0, 11, 0, 4,33), Helper.convertXMLDate("2003-01-11T00:04:33.633658Z"));
		assertEquals(new Date(2003-1900, 0, 11, 12, 13,31), Helper.convertXMLDate("2003-01-11T12:13:31.499504Z"));
	}

}

@@ -71,20 +71,24 @@
 va.util.
-Date
+Calendar
 ;%0A%0Aimpor
@@ -338,48 +338,76 @@
   %0A%09
-%09assertEquals(new Date(2003-1900
+    Calendar cal = Calendar.getInstance();%0A%09    cal.set(2003
 , 0, 10,
  23,
@@ -406,19 +406,58 @@
  10,
- 
 23,
- 
 21,54)
+;%0A%09%09assertEquals(cal.getTime().toString()
 , He
@@ -510,52 +510,44 @@
 5Z%22)
-);%0A%09%09assertEquals(new Date(2003-1900
+.toString());%0A%09%09cal.set(2003
 , 0, 11,
  12,
@@ -546,19 +546,58 @@
  11,
- 
 12,
- 
 01,06)
+;%0A%09%09assertEquals(cal.getTime().toString()
 , He
@@ -650,61 +650,91 @@
 2Z%22)
-);%0A%09%09assertEquals(new Date(2003-1900
+.toString());%0A%09%09cal.set(2003
 , 0,
- 
 11,
- 
 0,
- 
 4,33)
+;%0A%09%09assertEquals(cal.getTime().toString()
 , He
@@ -787,63 +787,92 @@
 8Z%22)
-);%0A%09%09assertEquals(new Date(2003-1900, 
+.toString());%0A%09%09cal.set(2003,
 0,
- 
 11,
- 
 12,
- 
 13,31)
+;%0A%09%09assertEquals(cal.getTime().toString()
 , He
@@ -921,16 +921,27 @@
 99504Z%22)
+.toString()
 );%0A%09%7D%0A%0A%7D

fix for deprecations