X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FFileIOTester.java;h=e9165e263991ada7485247e8bb8d5c1ab522f5bf;hb=ad15cff29620f960119f80176f1fd443da9f6763;hp=5d10c35670a27bcedda3cd17766ab320cff981d3;hpb=ea7d610e641753af7bf54fc778a4c3564ae51014;p=jalview.git
diff --git a/test/jalview/io/FileIOTester.java b/test/jalview/io/FileIOTester.java
index 5d10c35..e9165e2 100644
--- a/test/jalview/io/FileIOTester.java
+++ b/test/jalview/io/FileIOTester.java
@@ -1,19 +1,21 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.io;
@@ -29,7 +31,7 @@ import org.junit.Test;
/**
* @author jimp
- *
+ *
*/
public class FileIOTester
{
@@ -49,38 +51,53 @@ public class FileIOTester
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");
- 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");
+
+ 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(String fmt, String src, FileParse fp)
{
- assertTrue("Couldn't resolve "+src+" as a valid file",fp.isValid());
+ assertTrue("Couldn't resolve " + src + " as a valid file", fp.isValid());
String type = new IdentifyFile().Identify(fp);
- assertTrue("Data from '"+src+"' Expected to be '"+fmt+"' identified as '"+type+"'",type.equalsIgnoreCase(fmt));
+ assertTrue("Data from '" + src + "' Expected to be '" + fmt
+ + "' identified as '" + type + "'", type.equalsIgnoreCase(fmt));
}
+
@Test
public void testStarsInFasta1() throws IOException
{
String uri;
- FileParse fp = new FileParse(uri=STARS_FA_FILE1.getAbsoluteFile().toString(),AppletFormatAdapter.FILE);
+ FileParse fp = new FileParse(uri = STARS_FA_FILE1.getAbsoluteFile()
+ .toString(), AppletFormatAdapter.FILE);
assertValidFormat("FASTA", uri, fp);
}
+
@Test
public void testStarsInFasta2() throws IOException
{
String uri;
- FileParse fp = new FileParse(uri=STARS_FA_FILE2.getAbsoluteFile().toString(),AppletFormatAdapter.FILE);
+ FileParse fp = new FileParse(uri = STARS_FA_FILE2.getAbsoluteFile()
+ .toString(), AppletFormatAdapter.FILE);
assertValidFormat("FASTA", uri, fp);
}
+
@Test
public void testGzipIo() throws IOException
- {
+ {
String uri;
- FileParse fp = new FileParse(uri=ALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
+ FileParse fp = new FileParse(uri = ALIGN_FILE.getAbsoluteFile().toURI()
+ .toString(), AppletFormatAdapter.URL);
assertValidFormat("FASTA", uri, fp);
}
@@ -88,21 +105,26 @@ public class FileIOTester
public void testGziplocalFileIO() throws IOException
{
String filepath;
- FileParse fp = new FileParse(filepath=ALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
- assertValidFormat("FASTA",filepath, fp);
+ FileParse fp = new FileParse(filepath = ALIGN_FILE.getAbsoluteFile()
+ .toString(), AppletFormatAdapter.FILE);
+ assertValidFormat("FASTA", filepath, fp);
}
+
@Test
public void testNonGzipURLIO() throws IOException
{
String uri;
- FileParse fp = new FileParse(uri=NOTGZALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
- assertValidFormat("FASTA",uri, fp);
+ FileParse fp = new FileParse(uri = NOTGZALIGN_FILE.getAbsoluteFile()
+ .toURI().toString(), AppletFormatAdapter.URL);
+ assertValidFormat("FASTA", uri, fp);
}
+
@Test
public void testNonGziplocalFileIO() throws IOException
{
String filepath;
- FileParse fp = new FileParse(filepath=NOTGZALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
- assertValidFormat("FASTA",filepath, fp);
+ FileParse fp = new FileParse(filepath = NOTGZALIGN_FILE
+ .getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
+ assertValidFormat("FASTA", filepath, fp);
}
}