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-2795 added error catching for invalid identifier
[jalview.git]
/
test
/
jalview
/
io
/
TCoffeeScoreFileTest.java
diff --git
a/test/jalview/io/TCoffeeScoreFileTest.java
b/test/jalview/io/TCoffeeScoreFileTest.java
index
181aabd
..
38c9a89
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,11
+30,19
@@
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 SCORE_FILE = new File(
"test/jalview/io/tcoffee.score_ascii");
@@
-45,7
+54,7
@@
public class TCoffeeScoreFileTest
{
TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),
{
TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- AppletFormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit.assertTrue(scoreFile.getWarningMessage(),
scoreFile.isValid());
AssertJUnit.assertTrue(scoreFile.getWarningMessage(),
scoreFile.isValid());
@@
-73,7
+82,7
@@
public class TCoffeeScoreFileTest
try
{
TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(),
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)
{
@@
-86,7
+95,7
@@
public class TCoffeeScoreFileTest
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());
@@
-107,7
+116,7
@@
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);
@@
-145,7
+154,7
@@
public class TCoffeeScoreFileTest
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- FormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit
.assertEquals(
AssertJUnit
.assertEquals(
@@
-190,7
+199,7
@@
public class TCoffeeScoreFileTest
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
- FormatAdapter.FILE);
+ DataSourceType.FILE);
AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
List<String> scores = parser.getScoresList();
AssertJUnit
AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
List<String> scores = parser.getScoresList();
AssertJUnit
@@
-237,7
+246,7
@@
public class TCoffeeScoreFileTest
{
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
{
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();
@@
-267,7
+276,7
@@
public class TCoffeeScoreFileTest
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());