1 package compbio.stat.collector;
\r
4 import java.io.IOException;
\r
6 import org.testng.Assert;
\r
7 import org.testng.annotations.Test;
\r
9 import compbio.metadata.AllTestSuit;
\r
11 public class TestInputFilter {
\r
13 final static String FASTA_INPUT = AllTestSuit.TEST_DATA_PATH_ABSOLUTE
\r
15 final static String ALN_INPUT = AllTestSuit.TEST_DATA_PATH_ABSOLUTE
\r
17 final static String TEST_FASTA_INPUT = AllTestSuit.TEST_DATA_PATH_ABSOLUTE
\r
18 + "test_input.fasta";
\r
19 final static String TEST_ALIGNMENT_INPUT = AllTestSuit.TEST_DATA_PATH_ABSOLUTE
\r
22 public void TestInputFilter() {
\r
23 InputFilter ifilter = new InputFilter();
\r
25 // Makes sure real files are accepted
\r
26 Assert.assertTrue(ifilter.accept(new File(FASTA_INPUT)));
\r
27 Assert.assertTrue(ifilter.accept(new File(ALN_INPUT)));
\r
29 // .. and test files are not
\r
30 Assert.assertFalse(ifilter.accept(new File(TEST_ALIGNMENT_INPUT)));
\r
31 Assert.assertFalse(ifilter.accept(new File(TEST_FASTA_INPUT)));
\r
32 // does not matter if the file is empty, it is still not a test
\r
34 Assert.assertTrue(ifilter.accept(File.createTempFile("aaa", "bbb")));
\r
35 } catch (IOException e) {
\r
36 e.printStackTrace();
\r
37 Assert.fail(e.getMessage());
\r