org.jcoderz.commons.types
Class PeriodTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jcoderz.commons.types.PeriodTest
All Implemented Interfaces:
Test

public class PeriodTest
extends TestCase

Implements test-cases for the Period class.

Author:
Michael Rumpf

Field Summary
static long ONE_DAY_IN_MSEC
          One day in milli-seconds: 24*60*60*1000.
static int TEN_MSEC
          A constant for 10 msec.
static int THIRTY_MSEC
          A constant for 30 msec.
static int TWENTY_MSEC
          A constant for 20 msec.
 
Constructor Summary
PeriodTest()
           
 
Method Summary
 void testCreateDayPeriod()
          Tests the method Period.createDayPeriod(Date).
 void testCreateMonthPeriod()
          Tests the method Period.createMonthPeriod(Date).
 void testDayFactoryMethod()
          Test the constructor argument combinations and milli-second resolution.
 void testDayPeriodIntersection()
          Test the intersection method of the Period class in day resolution.
 void testDayPeriodUnion()
          Test the union method of the Period class in day resolution.
 void testEmptyPeriodUnion()
          Test the union method of the Period class in milli-second resolution.
 void testFactoryMethods()
          Test the constructor argument combinations and milli-second resolution.
 void testGetNextPrevPeriodTime()
          Test the Period.getNextPeriodStartTime() and Period.getPrevPeriodEndTime() methods.
 void testIsIncludedDayPeriod()
          Test the isIncluded() method of the Period class in day resolution.
 void testIsIncludedPeriod()
          Test the isIncluded() method of the Period class in milli-second resolution.
 void testLargestPeriod()
          Tries to create a period with the largest possible start and end dates.
 void testNext()
          Tests the method Period.next().
 void testNextDay()
          Tests the methods Period.nextDay() and Period.nextDay(Date).
 void testNextHour()
          Tests the methods Period.nextHour() and Period.nextHour(Date).
 void testNextMonth()
          Tests the methods Period.nextMonth() and Period.nextMonth(Date).
 void testPeriodIntersection()
          Test the intersection method of the Period class in milli-second resolution.
 void testPeriodUnion()
          Test the union method of the Period class in milli-second resolution.
 void testPrevious()
          Tests the method Period.previous().
 void testPreviousDay()
          Tests the methods Period.previousDay() and Period.previousDay(Date).
 void testPreviousHour()
          Tests the methods Period.previousHour() and Period.previousHour(Date).
 void testPreviousMonth()
          Tests the methods Period.previousMonth() and Period.previousDay(Date).
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ONE_DAY_IN_MSEC

public static final long ONE_DAY_IN_MSEC
One day in milli-seconds: 24*60*60*1000.

See Also:
Constant Field Values

TEN_MSEC

public static final int TEN_MSEC
A constant for 10 msec.

See Also:
Constant Field Values

TWENTY_MSEC

public static final int TWENTY_MSEC
A constant for 20 msec.

See Also:
Constant Field Values

THIRTY_MSEC

public static final int THIRTY_MSEC
A constant for 30 msec.

See Also:
Constant Field Values
Constructor Detail

PeriodTest

public PeriodTest()
Method Detail

testLargestPeriod

public void testLargestPeriod()
Tries to create a period with the largest possible start and end dates.


testFactoryMethods

public void testFactoryMethods()
Test the constructor argument combinations and milli-second resolution.


testDayFactoryMethod

public void testDayFactoryMethod()
Test the constructor argument combinations and milli-second resolution.


testCreateDayPeriod

public void testCreateDayPeriod()
Tests the method Period.createDayPeriod(Date).


testCreateMonthPeriod

public void testCreateMonthPeriod()
Tests the method Period.createMonthPeriod(Date).


testPeriodUnion

public void testPeriodUnion()
Test the union method of the Period class in milli-second resolution.


testEmptyPeriodUnion

public void testEmptyPeriodUnion()
Test the union method of the Period class in milli-second resolution.


testDayPeriodUnion

public void testDayPeriodUnion()
Test the union method of the Period class in day resolution.


testPeriodIntersection

public void testPeriodIntersection()
Test the intersection method of the Period class in milli-second resolution.


testDayPeriodIntersection

public void testDayPeriodIntersection()
Test the intersection method of the Period class in day resolution.


testIsIncludedPeriod

public void testIsIncludedPeriod()
Test the isIncluded() method of the Period class in milli-second resolution.


testIsIncludedDayPeriod

public void testIsIncludedDayPeriod()
Test the isIncluded() method of the Period class in day resolution.


testGetNextPrevPeriodTime

public void testGetNextPrevPeriodTime()
Test the Period.getNextPeriodStartTime() and Period.getPrevPeriodEndTime() methods.


testNext

public void testNext()
Tests the method Period.next().


testPrevious

public void testPrevious()
Tests the method Period.previous().


testNextHour

public void testNextHour()
Tests the methods Period.nextHour() and Period.nextHour(Date).


testPreviousHour

public void testPreviousHour()
Tests the methods Period.previousHour() and Period.previousHour(Date).


testNextDay

public void testNextDay()
Tests the methods Period.nextDay() and Period.nextDay(Date).


testPreviousDay

public void testPreviousDay()
Tests the methods Period.previousDay() and Period.previousDay(Date).


testNextMonth

public void testNextMonth()
Tests the methods Period.nextMonth() and Period.nextMonth(Date).


testPreviousMonth

public void testPreviousMonth()
Tests the methods Period.previousMonth() and Period.previousDay(Date).



Copyright 2007 The jCoderZ Project.