net.sourceforge.openforecast.tests
Class DataSetTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- net.sourceforge.openforecast.tests.OpenForecastTestCase
-
- net.sourceforge.openforecast.tests.DataSetTest
-
- All Implemented Interfaces:
- junit.framework.Test
public class DataSetTest extends OpenForecastTestCase
Implements a variety of tests of the DataSet class.
-
-
Constructor Summary
Constructors Constructor and Description DataSetTest(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidsetUp()Creates four simple DataSet for use by the tests.voidtearDown()Resets all DataSets between tests.voidtestContains()Implements a test of the DataSet contains and containsAll methods.voidtestDataSet()Tests the correct initialization of a DataSet.voidtestDataSetEqualsMethod()Tests the equals method of the DataSet class.voidtestDataSetSorting()Tests the correct sorting of a DataSet.voidtestHashCode()Validates the hash code contract.voidtestRemove()Implements a test of the DataSet remove and removeAll methods.voidtestRetainAll()Implements a test of the DataSet retainAll method.-
Methods inherited from class junit.framework.TestCase
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, countTestCases, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toString
-
-
-
-
Method Detail
-
setUp
public void setUp()
Creates four simple DataSet for use by the tests. The first three DataSets are created to contain the same data (though different DataPoint objects), whereas the fourth DataSet is the same size but contains different data as the others.- Overrides:
setUpin classjunit.framework.TestCase
-
tearDown
public void tearDown()
Resets all DataSets between tests.- Overrides:
tearDownin classjunit.framework.TestCase
-
testDataSet
public void testDataSet()
Tests the correct initialization of a DataSet.
-
testDataSetEqualsMethod
public void testDataSetEqualsMethod()
Tests the equals method of the DataSet class. Checks that the DataSet equals method is reflexive, symmetric, transitive, and consistent.
-
testContains
public void testContains()
Implements a test of the DataSet contains and containsAll methods.
-
testHashCode
public void testHashCode()
Validates the hash code contract. In the java.lang.Object javadocs, it states that the general contract is:- Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
- It is not required that if two objects are unequal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results.
This test case tests each of these.
-
testRemove
public void testRemove()
Implements a test of the DataSet remove and removeAll methods.
-
testRetainAll
public void testRetainAll()
Implements a test of the DataSet retainAll method.
-
testDataSetSorting
public void testDataSetSorting()
Tests the correct sorting of a DataSet.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG