git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-4235 JAL-3599 Try and report Eclipse Product Version for jalviewjsTranspile....
[jalview.git]
/
test
/
jalview
/
io
/
TCoffeeScoreFileTest.java
diff --git
a/test/jalview/io/TCoffeeScoreFileTest.java
b/test/jalview/io/TCoffeeScoreFileTest.java
index
7911188
..
278dd66
100644
(file)
--- a/
test/jalview/io/TCoffeeScoreFileTest.java
+++ b/
test/jalview/io/TCoffeeScoreFileTest.java
@@
-20,6
+20,7
@@
*/
package jalview.io;
*/
package jalview.io;
+import jalview.gui.JvOptionPane;
import jalview.io.TCoffeeScoreFile.Block;
import jalview.io.TCoffeeScoreFile.Header;
import jalview.io.TCoffeeScoreFile.Block;
import jalview.io.TCoffeeScoreFile.Header;
@@
-29,24
+30,33
@@
import java.io.IOException;
import java.util.List;
import org.testng.AssertJUnit;
import java.util.List;
import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class TCoffeeScoreFileTest
{
import org.testng.annotations.Test;
public class TCoffeeScoreFileTest
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
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 SCORE_FILE = new File(
"test/jalview/io/tcoffee.score_ascii");
final static File ALIGN_FILE = new File(
"test/jalview/io/tcoffee.fasta_aln");
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testReadHeader() throws IOException
{
TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),
public void testReadHeader() throws IOException
{
TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- AppletFormatAdapter.FILE);
- AssertJUnit.assertTrue(scoreFile.getWarningMessage(), scoreFile.isValid());
+ DataSourceType.FILE);
+ AssertJUnit.assertTrue(scoreFile.getWarningMessage(),
+ scoreFile.isValid());
Header header = scoreFile.header;
AssertJUnit.assertNotNull(header);
Header header = scoreFile.header;
AssertJUnit.assertNotNull(header);
@@
-65,13
+75,13
@@
public class TCoffeeScoreFileTest
AssertJUnit.assertEquals(90, header.getScoreFor("cons"));
}
AssertJUnit.assertEquals(90, header.getScoreFor("cons"));
}
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testWrongFile()
{
try
{
TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(),
public void testWrongFile()
{
try
{
TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(),
- FormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit.assertFalse(result.isValid());
} catch (IOException x)
{
AssertJUnit.assertFalse(result.isValid());
} catch (IOException x)
{
@@
-80,17
+90,17
@@
public class TCoffeeScoreFileTest
}
}
}
}
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testHeightAndWidth() throws IOException
{
TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(),
public void testHeightAndWidth() throws IOException
{
TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- FormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit.assertTrue(result.isValid());
AssertJUnit.assertEquals(8, result.getHeight());
AssertJUnit.assertEquals(83, result.getWidth());
}
AssertJUnit.assertTrue(result.isValid());
AssertJUnit.assertEquals(8, result.getHeight());
AssertJUnit.assertEquals(83, result.getWidth());
}
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testReadBlock() throws IOException
{
public void testReadBlock() throws IOException
{
@@
-105,36
+115,45
@@
public class TCoffeeScoreFileTest
+ "1QCF 99999999999999999999999999974-------2---------24\n"
+ "cons 999999999999999999999999999851000110321100001134\n"
+ "\n" + "\n";
+ "1QCF 99999999999999999999999999974-------2---------24\n"
+ "cons 999999999999999999999999999851000110321100001134\n"
+ "\n" + "\n";
- FileParse source = new FileParse(BLOCK, FormatAdapter.PASTE);
+ FileParse source = new FileParse(BLOCK, DataSourceType.PASTE);
Block block = TCoffeeScoreFile.readBlock(source, 0);
AssertJUnit.assertNotNull(block);
Block block = TCoffeeScoreFile.readBlock(source, 0);
AssertJUnit.assertNotNull(block);
- AssertJUnit.assertEquals("999999999999999999999999998762112222543211112134",
+ AssertJUnit.assertEquals(
+ "999999999999999999999999998762112222543211112134",
block.getScoresFor("1PHT"));
block.getScoresFor("1PHT"));
- AssertJUnit.assertEquals("99999999999999999999999999987-------4322----2234",
+ AssertJUnit.assertEquals(
+ "99999999999999999999999999987-------4322----2234",
block.getScoresFor("1BB9"));
block.getScoresFor("1BB9"));
- AssertJUnit.assertEquals("99999999999999999999999999987-------5321----2246",
+ AssertJUnit.assertEquals(
+ "99999999999999999999999999987-------5321----2246",
block.getScoresFor("1UHC"));
block.getScoresFor("1UHC"));
- AssertJUnit.assertEquals("99999999999999999999999999986-------4321----1-35",
+ AssertJUnit.assertEquals(
+ "99999999999999999999999999986-------4321----1-35",
block.getScoresFor("1YCS"));
block.getScoresFor("1YCS"));
- AssertJUnit.assertEquals("999999999999999999999999999861-------3------1135",
+ AssertJUnit.assertEquals(
+ "999999999999999999999999999861-------3------1135",
block.getScoresFor("1OOT"));
block.getScoresFor("1OOT"));
- AssertJUnit.assertEquals("99999999999999999999999999986-------422-------34",
+ AssertJUnit.assertEquals(
+ "99999999999999999999999999986-------422-------34",
block.getScoresFor("1ABO"));
block.getScoresFor("1ABO"));
- AssertJUnit.assertEquals("99999999999999999999999999985-------32--------35",
+ AssertJUnit.assertEquals(
+ "99999999999999999999999999985-------32--------35",
block.getScoresFor("1FYN"));
block.getScoresFor("1FYN"));
- AssertJUnit.assertEquals("99999999999999999999999999974-------2---------24",
+ AssertJUnit.assertEquals(
+ "99999999999999999999999999974-------2---------24",
block.getScoresFor("1QCF"));
block.getScoresFor("1QCF"));
- AssertJUnit.assertEquals("999999999999999999999999999851000110321100001134",
+ AssertJUnit.assertEquals(
+ "999999999999999999999999999851000110321100001134",
block.getConsensus());
}
block.getConsensus());
}
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testParse() throws IOException
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
public void testParse() throws IOException
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- FormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit.assertEquals(
"999999999999999999999999998762112222543211112134----------5666642367889999999999889",
AssertJUnit.assertEquals(
"999999999999999999999999998762112222543211112134----------5666642367889999999999889",
@@
-165,12
+184,12
@@
public class TCoffeeScoreFileTest
parser.getScoresFor("cons"));
}
parser.getScoresFor("cons"));
}
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testGetAsList() throws IOException
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
public void testGetAsList() throws IOException
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- FormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
List<String> scores = parser.getScoresList();
AssertJUnit.assertEquals(
AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
List<String> scores = parser.getScoresList();
AssertJUnit.assertEquals(
@@
-203,12
+222,12
@@
public class TCoffeeScoreFileTest
}
}
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testGetAsArray() throws IOException
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
public void testGetAsArray() throws IOException
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- FormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
byte[][] scores = parser.getScoresArray();
AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
byte[][] scores = parser.getScoresArray();
@@
-234,11
+253,12
@@
public class TCoffeeScoreFileTest
}
}
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testHeightAndWidthWithResidueNumbers() throws Exception
{
String file = "test/jalview/io/tcoffee.score_ascii_with_residue_numbers";
public void testHeightAndWidthWithResidueNumbers() throws Exception
{
String file = "test/jalview/io/tcoffee.score_ascii_with_residue_numbers";
- TCoffeeScoreFile result = new TCoffeeScoreFile(file, FormatAdapter.FILE);
+ TCoffeeScoreFile result = new TCoffeeScoreFile(file,
+ DataSourceType.FILE);
AssertJUnit.assertTrue(result.isValid());
AssertJUnit.assertEquals(5, result.getHeight());
AssertJUnit.assertEquals(84, result.getWidth());
AssertJUnit.assertTrue(result.isValid());
AssertJUnit.assertEquals(5, result.getHeight());
AssertJUnit.assertEquals(84, result.getWidth());