import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+ import java.util.regex.Matcher;
+ import java.util.regex.Pattern;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
+import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
+import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
+
/**
* A file parse for T-Coffee score ascii format. This file contains the
* alignment consensus for each resude in any sequence.
import jalview.io.TCoffeeScoreFile.Block;
import jalview.io.TCoffeeScoreFile.Header;
- import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
- import java.io.FileReader;
import java.io.IOException;
- import java.io.StringReader;
import java.util.List;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
+import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
+import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
public class TCoffeeScoreFileTest {
final static File SCORE_FILE = new File("test/jalview/io/tcoffee.score_ascii");
- final static File ALIGN_FILE = new File("test/jalview/io/tcoffee.fasta_aln");
+ final static File ALIGN_FILE = new File("test/jalview/io/tcoffee.fasta_aln");
@Test
- public void testReadHeader() throws IOException, FileNotFoundException {
+ public void testReadHeader() throws IOException, FileNotFoundException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
- TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),AppletFormatAdapter.FILE);
- assertTrue(scoreFile.getWarningMessage(),scoreFile.isValid());
- Header header = scoreFile.header;
+ TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),AppletFormatAdapter.FILE);
+ assertTrue(scoreFile.getWarningMessage(),scoreFile.isValid());
+
+ Header header = scoreFile.header;
assertNotNull(header);
assertEquals( "T-COFFEE, Version_9.02.r1228 (2012-02-16 18:15:12 - Revision 1228 - Build 336)", header.head );
assertEquals( 90, header.score );
@Test
- public void testWrongFile() {
+ public void testWrongFile() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
try {
- TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(), FormatAdapter.FILE);
- assertFalse(result.isValid());
- } catch (IOException x)
+ TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(), FormatAdapter.FILE);
+ assertFalse(result.isValid());
+ }
+ catch (IOException x)
{
assertTrue("File not found exception thrown",x instanceof FileNotFoundException);
}