From: jprocter Date: Sat, 17 Nov 2012 21:59:42 +0000 (+0000) Subject: Merge branch 'develop' into menard X-Git-Tag: Jalview_2_9~265^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ffacb1793ba68710f95b293a45eb4b0868b722a2;p=jalview.git Merge branch 'develop' into menard --- ffacb1793ba68710f95b293a45eb4b0868b722a2 diff --cc src/jalview/io/TCoffeeScoreFile.java index 178caad,ad5f52a..56994ae --- a/src/jalview/io/TCoffeeScoreFile.java +++ b/src/jalview/io/TCoffeeScoreFile.java @@@ -30,16 -30,9 +30,18 @@@ import java.util.HashMap 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. diff --cc test/jalview/io/TCoffeeScoreFileTest.java index 2c09148,3147054..1ee4936 --- a/test/jalview/io/TCoffeeScoreFileTest.java +++ b/test/jalview/io/TCoffeeScoreFileTest.java @@@ -21,35 -21,25 +21,33 @@@ import static org.junit.Assert.* 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 ); @@@ -66,11 -56,12 +64,12 @@@ @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); }