package com.ebay.build.profiler.utils;

import static org.junit.Assert.assertEquals;

import java.util.Calendar;

import org.junit.Test;

public class DateUtilsTest {
	@Test
	public void testGetCALDateTimeString() {
		Calendar cal = Calendar.getInstance();
		cal.set(Calendar.YEAR, 2011);
		cal.set(Calendar.MONTH, Calendar.MAY);
		cal.set(Calendar.DAY_OF_MONTH, 8);
		
		cal.set(Calendar.HOUR, 17);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		
		assertEquals("09-05-2011 05:00:00", DateUtils.getCALDateTimeString(cal.getTime()));
		
		assertEquals("05:00:00.00", DateUtils.getCALTimeString(cal.getTime()));
		
		assertEquals("09-05-2011 04:00:00", 
				DateUtils.getCALDateTimeString(DateUtils.getAnHourBack(cal.getTime()).getTime()));
	}
}

@@ -386,16 +386,23 @@
 dar.HOUR
+_OF_DAY
 , 17);%0A%09
@@ -474,33 +474,33 @@
 %09assertEquals(%220
-9
+8
 -05-2011 05:00:0
@@ -492,18 +492,18 @@
 05-2011 
-05
+17
 :00:00%22,
@@ -570,18 +570,18 @@
 Equals(%22
-05
+17
 :00:00.0
@@ -652,9 +652,9 @@
 s(%220
-9
+8
 -05-
@@ -662,10 +662,10 @@
 011 
-04
+16
 :00:

add unit tests