public static void tearDownAfterClass() throws Exception
{
}
+ // 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");
- private void assertValidFasta(String src, FileParse fp)
+ private void assertValidFormat(String fmt, String src, FileParse fp)
{
assertTrue("Couldn't resolve "+src+" as a valid file",fp.isValid());
String type = new IdentifyFile().Identify(fp);
- assertTrue("Gzipped data from '"+src+"' identified as '"+type+"'",type.equalsIgnoreCase("FASTA"));
+ assertTrue("Data from '"+src+"' Expected to be '"+fmt+"' identified as '"+type+"'",type.equalsIgnoreCase(fmt));
}
@Test
public void testGzipIo() throws IOException
{
String uri;
FileParse fp = new FileParse(uri=ALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
- assertValidFasta(uri, fp);
+ assertValidFormat("FASTA", uri, fp);
}
@Test
{
String filepath;
FileParse fp = new FileParse(filepath=ALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
- assertValidFasta(filepath, fp);
+ assertValidFormat("FASTA",filepath, fp);
}
@Test
public void testNonGzipURLIO() throws IOException
{
String uri;
FileParse fp = new FileParse(uri=NOTGZALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
- assertValidFasta(uri, fp);
+ assertValidFormat("FASTA",uri, fp);
}
@Test
public void testNonGziplocalFileIO() throws IOException
{
String filepath;
FileParse fp = new FileParse(filepath=NOTGZALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
- assertValidFasta(filepath, fp);
+ assertValidFormat("FASTA",filepath, fp);
}
}