+ // TODO: make a better/more comprehensive test harness for identify/io
+
+ final static File ALIGN_FILE = new File(
+ "test/jalview/io/test_gz_fasta.gz");
+
+ final static File NOTGZALIGN_FILE = new File(
+ "test/jalview/io/test_gz_fasta_notgz.gz");
+
+ final static File STARS_FA_FILE1 = new File(
+ "test/jalview/io/test_fasta_stars.fa");
+
+ final static File STARS_FA_FILE2 = new File(
+ "test/jalview/io/test_fasta_stars2.fa");
+
+ private void assertValidFormat(FileFormatI fmt, String src, FileParse fp)
+ throws FileFormatException
+ {
+ AssertJUnit.assertTrue("Couldn't resolve " + src + " as a valid file",
+ fp.isValid());
+ FileFormatI type = new IdentifyFile().identify(fp);
+ AssertJUnit.assertSame("Data from '" + src + "' Expected to be '" + fmt
+ + "' identified as '" + type + "'", type, fmt);
+ }
+
+ @Test(groups = { "Functional" })
+ public void testStarsInFasta1() throws IOException
+ {
+ String uri;
+ FileParse fp = new FileParse(uri = STARS_FA_FILE1.getAbsoluteFile()
+ .toString(), DataSourceType.FILE);
+ assertValidFormat(FileFormat.Fasta, uri, fp);
+ }
+
+ @Test(groups = { "Functional" })
+ public void testStarsInFasta2() throws IOException
+ {
+ String uri;
+ FileParse fp = new FileParse(uri = STARS_FA_FILE2.getAbsoluteFile()
+ .toString(), DataSourceType.FILE);
+ assertValidFormat(FileFormat.Fasta, uri, fp);
+ }
+
+ @Test(groups = { "Functional" })