Documentation of 'net.sourceforge.openforecast.tests.DataSetTest' Java class
DataSetTest
net.sourceforge.openforecast.tests

Class 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
      void setUp()
      Creates four simple DataSet for use by the tests.
      void tearDown()
      Resets all DataSets between tests.
      void testContains()
      Implements a test of the DataSet contains and containsAll methods.
      void testDataSet()
      Tests the correct initialization of a DataSet.
      void testDataSetEqualsMethod()
      Tests the equals method of the DataSet class.
      void testDataSetSorting()
      Tests the correct sorting of a DataSet.
      void testHashCode()
      Validates the hash code contract.
      void testRemove()
      Implements a test of the DataSet remove and removeAll methods.
      void testRetainAll()
      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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DataSetTest

        public DataSetTest(java.lang.String name)
    • 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:
        setUp in class junit.framework.TestCase
      • tearDown

        public void tearDown()
        Resets all DataSets between tests.
        Overrides:
        tearDown in class junit.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

Ads help maintain this website.