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-1189 JAL-3130 patch broken tests
[jalview.git]
/
test
/
jalview
/
io
/
NewickFileTests.java
diff --git
a/test/jalview/io/NewickFileTests.java
b/test/jalview/io/NewickFileTests.java
index
4de36f2
..
a92f5fb
100644
(file)
--- a/
test/jalview/io/NewickFileTests.java
+++ b/
test/jalview/io/NewickFileTests.java
@@
-22,10
+22,11
@@
package jalview.io;
import static org.testng.ConversionUtils.wrapDataProvider;
import static org.testng.ConversionUtils.wrapDataProvider;
-import jalview.analysis.NJTree;
import jalview.analysis.SequenceIdMatcher;
import jalview.analysis.SequenceIdMatcher;
+import jalview.analysis.TreeModel;
import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceNode;
import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceNode;
+import jalview.gui.JvOptionPane;
import java.util.Arrays;
import java.util.Collection;
import java.util.Arrays;
import java.util.Collection;
@@
-46,6
+47,13
@@
import org.testng.annotations.Test;
public class NewickFileTests
{
public class NewickFileTests
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
@Factory
public static Object[] factoryData()
{
@Factory
public static Object[] factoryData()
{
@@
-93,7
+101,7
@@
public class NewickFileTests
{
stage = "Parsing testTree " + treename;
System.out.println(treename + "\n" + testTree);
{
stage = "Parsing testTree " + treename;
System.out.println(treename + "\n" + testTree);
- NewickFile nf = new NewickFile(testTree, FormatAdapter.PASTE);
+ NewickFile nf = new NewickFile(testTree, DataSourceType.PASTE);
nf.parse();
AssertJUnit.assertTrue(
stage + "Invalid Tree '" + nf.getWarningMessage() + "'",
nf.parse();
AssertJUnit.assertTrue(
stage + "Invalid Tree '" + nf.getWarningMessage() + "'",
@@
-106,7
+114,7
@@
public class NewickFileTests
AssertJUnit.assertTrue(stage + "Empty string generated",
gentree != null && gentree.trim().length() > 0);
stage = "Parsing regenerated testTree " + treename;
AssertJUnit.assertTrue(stage + "Empty string generated",
gentree != null && gentree.trim().length() > 0);
stage = "Parsing regenerated testTree " + treename;
- NewickFile nf_regen = new NewickFile(gentree, FormatAdapter.PASTE);
+ NewickFile nf_regen = new NewickFile(gentree, DataSourceType.PASTE);
nf_regen.parse();
AssertJUnit.assertTrue(
stage + "Newick file is invalid ('"
nf_regen.parse();
AssertJUnit.assertTrue(
stage + "Newick file is invalid ('"
@@
-117,7
+125,8
@@
public class NewickFileTests
stage = "Compare original and generated tree" + treename;
Vector<SequenceNode> oseqs, nseqs;
stage = "Compare original and generated tree" + treename;
Vector<SequenceNode> oseqs, nseqs;
- oseqs = new NJTree(new SequenceI[0], nf).findLeaves(nf.getTree());
+ oseqs = new TreeModel(new SequenceI[0], null, nf).findLeaves(nf
+ .getTree());
AssertJUnit.assertTrue(stage + "No nodes in original tree.",
oseqs.size() > 0);
SequenceI[] olsqs = new SequenceI[oseqs.size()];
AssertJUnit.assertTrue(stage + "No nodes in original tree.",
oseqs.size() > 0);
SequenceI[] olsqs = new SequenceI[oseqs.size()];
@@
-125,7
+134,8
@@
public class NewickFileTests
{
olsqs[i] = (SequenceI) oseqs.get(i).element();
}
{
olsqs[i] = (SequenceI) oseqs.get(i).element();
}
- nseqs = new NJTree(new SequenceI[0], nf_regen).findLeaves(nf_regen
+ nseqs = new TreeModel(new SequenceI[0], null, nf_regen)
+ .findLeaves(nf_regen
.getTree());
AssertJUnit.assertTrue(stage + "No nodes in regerated tree.",
nseqs.size() > 0);
.getTree());
AssertJUnit.assertTrue(stage + "No nodes in regerated tree.",
nseqs.size() > 0);