    1   package baseCode.dataFilter;
    2
    3   import baseCode.dataFilter.RowAffyNameFilter;
    4   import baseCode.dataStructure.matrix.DenseDoubleMatrix2DNamed;
    5   import baseCode.dataStructure.matrix.StringMatrix2DNamed;
    6
    7   /***
    8    * @author Pavlidis
    9    * @version $Id: TestAffymetrixProbeNameFilter.java,v 1.5 2004/06/23 22:13:21
    10   *          pavlidis Exp $
    11   *
    12   */
    13  public class TestRowAffyNameFilter extends AbstractTestFilter {
    14
    15     protected void setUp() throws Exception {
    16        super.setUp();
    17     }
    18
    19     protected void tearDown() throws Exception {
    20        super.tearDown();
    21     }
    22
    23     public void testFilter() {
    24        RowAffyNameFilter fi = new RowAffyNameFilter( new int[] {
    25              RowAffyNameFilter.AFFX, RowAffyNameFilter.X, RowAffyNameFilter.ST,
    26              RowAffyNameFilter.F } );
    27        DenseDoubleMatrix2DNamed filtered = ( DenseDoubleMatrix2DNamed ) fi
    28              .filter( testdata );
    29        int expectedReturn = teststringdata.rows() - 5; // file contains on AFFX,
    30        // and two _f_ tags.
    31        int actualReturn = filtered.rows();
    32        assertEquals( "return value", expectedReturn, actualReturn );
    33     }
    34
    35     public void testStringFilter() {
    36        RowAffyNameFilter fi = new RowAffyNameFilter( new int[] {
    37              RowAffyNameFilter.AFFX, RowAffyNameFilter.X, RowAffyNameFilter.ST,
    38              RowAffyNameFilter.F } );
    39        StringMatrix2DNamed filtered = ( StringMatrix2DNamed ) fi
    40              .filter( teststringdata );
    41        int expectedReturn = teststringdata.rows() - 5; // file contains on AFFX,
    42        // and two _f_ tags.
    43        int actualReturn = filtered.rows();
    44        assertEquals( "return value", expectedReturn, actualReturn );
    45     }
    46
    47  }