org.opensubsystems.core.util
Class DateUtilsTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.opensubsystems.core.util.DateUtilsTest
All Implemented Interfaces:
junit.framework.Test

public class DateUtilsTest
extends junit.framework.TestCase

Tests for common operations with dates.

Version:
$Id: DateUtilsTest.java,v 1.4 2007/01/07 06:14:55 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
protected  java.text.DateFormat m_dateTimeFormat
          Formatter to format dates and times;
 
Constructor Summary
DateUtilsTest(java.lang.String arg0)
          Constructor for DateUtilsTest.
 
Method Summary
protected  void setUp()
          Set up environment for the test case.
protected  void tearDown()
          Restore original environment after the test case.
 void testDateAndTimeEquals()
          Test comparison of two equal date times.
 void testDateAndTimeEqualsFirstNull()
          Test comparison of null and date time.
 void testDateAndTimeEqualsNullAndNull()
          Test comparison of null and null.
 void testDateAndTimeEqualsSecondNull()
          Test comparison of date time and null.
 void testDateAndTimeEqualsWithDayDiff()
          Test comparison of two date times which differ in day.
 void testDateAndTimeEqualsWithEraDiff()
          Test comparison of two date times which differ in era.
 void testDateAndTimeEqualsWithHourDiff()
          Test comparison of two date times which differ in hour.
 void testDateAndTimeEqualsWithMilliDiff()
          Test comparison of two date times which differ in milliseconds.
 void testDateAndTimeEqualsWithMinuteDiff()
          Test comparison of two date times which differ in minutes.
 void testDateAndTimeEqualsWithMonthDiff()
          Test comparison of two date times which differ in month.
 void testDateAndTimeEqualsWithSecondDiff()
          Test comparison of two date times which differ in seconds.
 void testDateAndTimeEqualsWithTheSameObject()
          Test comparison of the same date time object.
 void testDateAndTimeEqualsWithYearDiff()
          Test comparison of two date times which differ in year.
 void testDateEquals()
          Test comparison of two equal dates.
 void testDateEqualsFirstNull()
          Test comparison of null and date.
 void testDateEqualsNullAndNull()
          Test comparison of null and null.
 void testDateEqualsSecondNull()
          Test comparison of date and null.
 void testDateEqualsWithDayDiff()
          Test comparison of two dates which differ in day.
 void testDateEqualsWithEraDiff()
          Test comparison of two dates which differ in era.
 void testDateEqualsWithHourDiff()
          Test comparison of two dates which differ in hour.
 void testDateEqualsWithMilliDiff()
          Test comparison of two dates which differ in milliseconds.
 void testDateEqualsWithMinuteDiff()
          Test comparison of two dates which differ in minutes.
 void testDateEqualsWithMonthDiff()
          Test comparison of two dates which differ in month.
 void testDateEqualsWithSecondDiff()
          Test comparison of two dates which differ in seconds.
 void testDateEqualsWithTheSameObject()
          Test comparison of the same date object.
 void testDateEqualsWithYearDiff()
          Test comparison of two dates which differ in year.
 void testTimeEquals()
          Test comparison of two equal times.
 void testTimeEqualsFirstNull()
          Test comparison of null and time.
 void testTimeEqualsNullAndNull()
          Test comparison of null and null.
 void testTimeEqualsSecondNull()
          Test comparison of time and null.
 void testTimeEqualsWithDayDiff()
          Test comparison of two times which differ in day.
 void testTimeEqualsWithEraDiff()
          Test comparison of two dates which differ in era.
 void testTimeEqualsWithHourDiff()
          Test comparison of two times which differ in hours.
 void testTimeEqualsWithMilliDiff()
          Test comparison of two times which differ in milliseconds.
 void testTimeEqualsWithMilliDiffIgnored()
          Test comparison of two times which differ in milliseconds and ignoring the milliseconds.
 void testTimeEqualsWithMinuteDiff()
          Test comparison of two times which differ in minutes.
 void testTimeEqualsWithMonthDiff()
          Test comparison of two dates which differ in month.
 void testTimeEqualsWithSecondDiff()
          Test comparison of two dates which differ in seconds.
 void testTimeEqualsWithTheSameObject()
          Test comparison of the same time object.
 void testTimeEqualsWithYearDiff()
          Test comparison of two dates which differ in year.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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

m_dateTimeFormat

protected java.text.DateFormat m_dateTimeFormat
Formatter to format dates and times;

Constructor Detail

DateUtilsTest

public DateUtilsTest(java.lang.String arg0)
Constructor for DateUtilsTest.

Parameters:
arg0 - - name of the test
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Set up environment for the test case.

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception - - an error has occured during setting up test

tearDown

protected void tearDown()
                 throws java.lang.Exception
Restore original environment after the test case.

Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception - - an error has occured during tearing down up test

testDateEquals

public void testDateEquals()
Test comparison of two equal dates.


testDateEqualsFirstNull

public void testDateEqualsFirstNull()
Test comparison of null and date.


testDateEqualsSecondNull

public void testDateEqualsSecondNull()
Test comparison of date and null.


testDateEqualsNullAndNull

public void testDateEqualsNullAndNull()
Test comparison of null and null.


testDateEqualsWithTheSameObject

public void testDateEqualsWithTheSameObject()
Test comparison of the same date object.


testDateEqualsWithMilliDiff

public void testDateEqualsWithMilliDiff()
Test comparison of two dates which differ in milliseconds.


testDateEqualsWithSecondDiff

public void testDateEqualsWithSecondDiff()
Test comparison of two dates which differ in seconds.


testDateEqualsWithMinuteDiff

public void testDateEqualsWithMinuteDiff()
Test comparison of two dates which differ in minutes.


testDateEqualsWithHourDiff

public void testDateEqualsWithHourDiff()
Test comparison of two dates which differ in hour.


testDateEqualsWithDayDiff

public void testDateEqualsWithDayDiff()
Test comparison of two dates which differ in day.


testDateEqualsWithMonthDiff

public void testDateEqualsWithMonthDiff()
Test comparison of two dates which differ in month.


testDateEqualsWithYearDiff

public void testDateEqualsWithYearDiff()
Test comparison of two dates which differ in year.


testDateEqualsWithEraDiff

public void testDateEqualsWithEraDiff()
Test comparison of two dates which differ in era.


testDateAndTimeEquals

public void testDateAndTimeEquals()
Test comparison of two equal date times.


testDateAndTimeEqualsFirstNull

public void testDateAndTimeEqualsFirstNull()
Test comparison of null and date time.


testDateAndTimeEqualsSecondNull

public void testDateAndTimeEqualsSecondNull()
Test comparison of date time and null.


testDateAndTimeEqualsNullAndNull

public void testDateAndTimeEqualsNullAndNull()
Test comparison of null and null.


testDateAndTimeEqualsWithTheSameObject

public void testDateAndTimeEqualsWithTheSameObject()
Test comparison of the same date time object.


testDateAndTimeEqualsWithMilliDiff

public void testDateAndTimeEqualsWithMilliDiff()
Test comparison of two date times which differ in milliseconds.


testDateAndTimeEqualsWithSecondDiff

public void testDateAndTimeEqualsWithSecondDiff()
Test comparison of two date times which differ in seconds.


testDateAndTimeEqualsWithMinuteDiff

public void testDateAndTimeEqualsWithMinuteDiff()
Test comparison of two date times which differ in minutes.


testDateAndTimeEqualsWithHourDiff

public void testDateAndTimeEqualsWithHourDiff()
Test comparison of two date times which differ in hour.


testDateAndTimeEqualsWithDayDiff

public void testDateAndTimeEqualsWithDayDiff()
Test comparison of two date times which differ in day.


testDateAndTimeEqualsWithMonthDiff

public void testDateAndTimeEqualsWithMonthDiff()
Test comparison of two date times which differ in month.


testDateAndTimeEqualsWithYearDiff

public void testDateAndTimeEqualsWithYearDiff()
Test comparison of two date times which differ in year.


testDateAndTimeEqualsWithEraDiff

public void testDateAndTimeEqualsWithEraDiff()
Test comparison of two date times which differ in era.


testTimeEquals

public void testTimeEquals()
Test comparison of two equal times.


testTimeEqualsFirstNull

public void testTimeEqualsFirstNull()
Test comparison of null and time.


testTimeEqualsSecondNull

public void testTimeEqualsSecondNull()
Test comparison of time and null.


testTimeEqualsNullAndNull

public void testTimeEqualsNullAndNull()
Test comparison of null and null.


testTimeEqualsWithTheSameObject

public void testTimeEqualsWithTheSameObject()
Test comparison of the same time object.


testTimeEqualsWithMilliDiff

public void testTimeEqualsWithMilliDiff()
Test comparison of two times which differ in milliseconds.


testTimeEqualsWithMilliDiffIgnored

public void testTimeEqualsWithMilliDiffIgnored()
Test comparison of two times which differ in milliseconds and ignoring the milliseconds.


testTimeEqualsWithSecondDiff

public void testTimeEqualsWithSecondDiff()
Test comparison of two dates which differ in seconds.


testTimeEqualsWithMinuteDiff

public void testTimeEqualsWithMinuteDiff()
Test comparison of two times which differ in minutes.


testTimeEqualsWithHourDiff

public void testTimeEqualsWithHourDiff()
Test comparison of two times which differ in hours.


testTimeEqualsWithDayDiff

public void testTimeEqualsWithDayDiff()
Test comparison of two times which differ in day.


testTimeEqualsWithMonthDiff

public void testTimeEqualsWithMonthDiff()
Test comparison of two dates which differ in month.


testTimeEqualsWithYearDiff

public void testTimeEqualsWithYearDiff()
Test comparison of two dates which differ in year.


testTimeEqualsWithEraDiff

public void testTimeEqualsWithEraDiff()
Test comparison of two dates which differ in era.



Copyright © 2003 - 2006 OpenSubsystems s.r.o.