com.jrefinery.data.junit
Class QuarterTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.jrefinery.data.junit.QuarterTests
All Implemented Interfaces:
junit.framework.Test

public class QuarterTests
extends junit.framework.TestCase

Tests for the Quarter class.


Field Summary
protected  Quarter q1_1900
           
protected  Quarter q2_1900
           
protected  Quarter q3_9999
           
protected  Quarter q4_9999
           
 
Constructor Summary
QuarterTests(java.lang.String name)
          Constructs a new set of tests.
 
Method Summary
protected  void setUp()
          Common test setup.
static junit.framework.Test suite()
          Returns the tests as a test suite.
 void testDateConstructor1()
          In GMT, the end of Q1 2002 is java.util.Date(1017619199999L).
 void testDateConstructor2()
          In Istanbul, the end of Q1 2002 is java.util.Date(1017608399999L).
 void testEquals()
           
 void testEqualsSelf()
          Test that a Quarter instance is equal to itself.
 void testParseQuarter()
          Test the string parsing code...
 void testQ1_1900_next()
          Set up a quarter equal to Q1 1900.
 void testQ1_1900_previous()
          Set up a quarter equal to Q1 1900.
 void testQ4_9999_next()
          Set up a quarter equal to Q4 9999.
 void testQ4_9999_previous()
          Set up a quarter equal to Q4 9999.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

q1_1900

protected Quarter q1_1900

q2_1900

protected Quarter q2_1900

q3_9999

protected Quarter q3_9999

q4_9999

protected Quarter q4_9999
Constructor Detail

QuarterTests

public QuarterTests(java.lang.String name)
Constructs a new set of tests.

Parameters:
The - name of the tests.
Method Detail

suite

public static junit.framework.Test suite()
Returns the tests as a test suite.


setUp

protected void setUp()
Common test setup.

Overrides:
setUp in class junit.framework.TestCase

testEqualsSelf

public void testEqualsSelf()
Test that a Quarter instance is equal to itself. SourceForge Bug ID: 558850.


testEquals

public void testEquals()

testDateConstructor1

public void testDateConstructor1()
In GMT, the end of Q1 2002 is java.util.Date(1017619199999L). Use this to check the quarter constructor.


testDateConstructor2

public void testDateConstructor2()
In Istanbul, the end of Q1 2002 is java.util.Date(1017608399999L). Use this to check the quarter constructor.


testQ1_1900_previous

public void testQ1_1900_previous()
Set up a quarter equal to Q1 1900. Request the previous quarter, it should be null.


testQ1_1900_next

public void testQ1_1900_next()
Set up a quarter equal to Q1 1900. Request the next quarter, it should be Q2 1900.


testQ4_9999_previous

public void testQ4_9999_previous()
Set up a quarter equal to Q4 9999. Request the previous quarter, it should be Q3 9999.


testQ4_9999_next

public void testQ4_9999_next()
Set up a quarter equal to Q4 9999. Request the next quarter, it should be null.


testParseQuarter

public void testParseQuarter()
Test the string parsing code...



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.