org.hackystat.utilities.time.period
Class TestDay

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.hackystat.utilities.time.period.TestDay
All Implemented Interfaces:
junit.framework.Test

public class TestDay
extends junit.framework.TestCase

Tests the Day implementation.

Author:
Hongbing Kou

Constructor Summary
TestDay()
           
 
Method Summary
 void testDay()
          Test the APIs of day object.
 void testDaylightSavingsIssues()
          Tests the day light savings issue associated with getting a day.
 void testGetFirstTickOfTheDay()
          Tests getFirstTickOfTheDay and getLastTickOfTheDay method.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestDay

public TestDay()
Method Detail

testDay

public void testDay()
             throws java.lang.Exception
Test the APIs of day object.

Throws:
java.lang.Exception - If problems occur.

testDaylightSavingsIssues

public void testDaylightSavingsIssues()
Tests the day light savings issue associated with getting a day. When a Day instance is created it is retrieved from DayCache. The DayCache must account for differences in timestamps due to TimeZone and Daylight Saving Issues. This unit tests ensures that we are able to correctly create Day objects for a 3 year period at 30 minute intervals.

A failure in this method is caused by a date (ie. 0-31) of the Day object does not equal the date of the Date object. This indicates that the DayCache is not interpreting the TimeZone and DST correctly.


testGetFirstTickOfTheDay

public void testGetFirstTickOfTheDay()
Tests getFirstTickOfTheDay and getLastTickOfTheDay method.