    1   package baseCode.dataFilter;
    2
    3   import junit.framework.TestCase;
    4   import baseCode.dataStructure.matrix.DenseDoubleMatrix2DNamed;
    5   import baseCode.dataStructure.matrix.StringMatrix2DNamed;
    6   import baseCode.io.reader.DoubleMatrixReader;
    7   import baseCode.io.reader.StringMatrixReader;
    8
    9   /***
    10   * Fixture for testing filtering of matrices.
    11   *
    12   * @author Pavlidis
    13   * @version $Id: AbstractTestFilter.java,v 1.1 2005/03/17 13:58:41 pavlidis Exp $
    14   *
    15   */
    16
    17  public abstract class AbstractTestFilter extends TestCase {
    18
    19     protected DenseDoubleMatrix2DNamed testdata = null;
    20     protected StringMatrix2DNamed teststringdata = null;
    21     protected DenseDoubleMatrix2DNamed testmissingdata = null;
    22     protected StringMatrix2DNamed teststringmissingdata = null;
    23
    24     public AbstractTestFilter() {
    25        super();
    26     }
    27
    28     protected void setUp() throws Exception {
    29        super.setUp();
    30        DoubleMatrixReader f = new DoubleMatrixReader();
    31        StringMatrixReader s = new StringMatrixReader();
    32
    33        testdata = ( DenseDoubleMatrix2DNamed ) f.read( AbstractTestFilter.class
    34              .getResourceAsStream( "/data/testdata.txt" ) );
    35
    36        testmissingdata = ( DenseDoubleMatrix2DNamed ) f
    37              .read( AbstractTestFilter.class
    38                    .getResourceAsStream( "/data/testdatamissing.txt" ) );
    39
    40        teststringdata = ( StringMatrix2DNamed ) s.read( AbstractTestFilter.class
    41              .getResourceAsStream( "/data/testdata.txt" ) );
    42
    43        teststringmissingdata = ( StringMatrix2DNamed ) s
    44              .read( AbstractTestFilter.class
    45                    .getResourceAsStream( "/data/testdatamissing.txt" ) );
    46
    47     }
    48
    49     protected void tearDown() throws Exception {
    50        super.tearDown();
    51        testdata = null;
    52        testmissingdata = null;
    53        teststringdata = null;
    54        teststringmissingdata = null;
    55     }
    56
    57  }