org.jcoderz.commons.types
Class DateTest

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

public class DateTest
extends TestCase

Test class to test the Date class.


Constructor Summary
DateTest()
           
 
Method Summary
 void testAfter()
          Tests the after method.
 void testAfterOrEqual()
          Tests the after or equal method.
 void testBefore()
          Tests the before method.
 void testBeforeOrEqual()
          Tests the after method.
 void testCompareTo()
          Successful test for "compareTo".
 void testDateString()
          Successful test for "toString".
 void testEarliest()
          Tests the earliest method.
 void testElapsed()
          Tests the method Date.elapsedMillis().
 void testElapsedDate()
          Tests the method Date.elapsedMillis(Date).
 void testEquals()
          Successful test for "equals".
 void testFromSqlDate()
          Successful test for "fromSqlDate".
 void testFromSqlTimestamp()
          Successful test for "fromSqlTimestamp".
 void testFromString()
          Successful test for "fromString (String date, String pattern)".
 void testGetDaysSinceEpoch()
          Tests the Date.getDaysSinceEpoch() method.
 void testGetDaysSinceEpochDate()
          Tests the Date.getDaysSinceEpoch(Date) method.
 void testHashCode()
          Method to test for Date.hashCode().
 void testLatest()
          Tests the latest method.
 void testMinus()
          Tests the method Date.minus(long).
 void testNow()
          Successful test for "now".
 void testNowPlus()
          Successful test for "nowPlus".
 void testPlus()
          Tests the method Date.plus(long).
 void testSerialize()
          Simple test method to check basic serialization.
 void testSqlTimestamp()
          Tests the sql timestamp handling.
 void testSqlTimestampWithNanos()
          Tests the sql timestamp handling.
 void testToSqlDate()
          Successful test for "toSqlDate".
 void testToSqlTimestamp()
          Successful test for "toSqlTimestamp".
 void testToString()
          Successful test for "toString".
 void testToStringWithMillies()
          Successful test for "toString".
 void testToUtilDate()
          Successful test for "toUtilDate".
 
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
 

Constructor Detail

DateTest

public DateTest()
Method Detail

testFromSqlDate

public void testFromSqlDate()
Successful test for "fromSqlDate".


testFromSqlTimestamp

public void testFromSqlTimestamp()
Successful test for "fromSqlTimestamp".


testNow

public void testNow()
Successful test for "now".


testNowPlus

public void testNowPlus()
Successful test for "nowPlus".


testPlus

public void testPlus()
Tests the method Date.plus(long).


testMinus

public void testMinus()
Tests the method Date.minus(long).


testFromString

public void testFromString()
                    throws ParseException
Successful test for "fromString (String date, String pattern)".

Throws:
ParseException - if the test case fails.

testToString

public void testToString()
Successful test for "toString".


testToStringWithMillies

public void testToStringWithMillies()
Successful test for "toString".


testDateString

public void testDateString()
Successful test for "toString".


testToUtilDate

public void testToUtilDate()
Successful test for "toUtilDate".


testToSqlDate

public void testToSqlDate()
Successful test for "toSqlDate".


testToSqlTimestamp

public void testToSqlTimestamp()
Successful test for "toSqlTimestamp".


testEquals

public void testEquals()
Successful test for "equals".


testCompareTo

public void testCompareTo()
Successful test for "compareTo".


testSerialize

public void testSerialize()
                   throws IOException,
                          ClassNotFoundException
Simple test method to check basic serialization.

Throws:
ClassNotFoundException - in case of an test case error
IOException - in case of an test case error

testSqlTimestamp

public void testSqlTimestamp()
Tests the sql timestamp handling.


testSqlTimestampWithNanos

public void testSqlTimestampWithNanos()
Tests the sql timestamp handling.


testGetDaysSinceEpoch

public void testGetDaysSinceEpoch()
Tests the Date.getDaysSinceEpoch() method.


testGetDaysSinceEpochDate

public void testGetDaysSinceEpochDate()
Tests the Date.getDaysSinceEpoch(Date) method.


testHashCode

public void testHashCode()
Method to test for Date.hashCode().


testElapsed

public void testElapsed()
Tests the method Date.elapsedMillis().


testElapsedDate

public void testElapsedDate()
Tests the method Date.elapsedMillis(Date).


testAfter

public void testAfter()
Tests the after method.


testAfterOrEqual

public void testAfterOrEqual()
Tests the after or equal method.


testBefore

public void testBefore()
Tests the before method.


testBeforeOrEqual

public void testBeforeOrEqual()
Tests the after method.


testEarliest

public void testEarliest()
Tests the earliest method.


testLatest

public void testLatest()
Tests the latest method.



Copyright 2007 The jCoderZ Project.