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
60c2934
..
a92f5fb
100644
(file)
--- a/
test/jalview/io/NewickFileTests.java
+++ b/
test/jalview/io/NewickFileTests.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-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 ('"
@@
-116,24
+124,25
@@
public class NewickFileTests
AssertJUnit.assertTrue(stage + "Null Tree", tree_regen != null);
stage = "Compare original and generated tree" + treename;
AssertJUnit.assertTrue(stage + "Null Tree", tree_regen != null);
stage = "Compare original and generated tree" + treename;
- Vector oseqs, nseqs;
- oseqs = new NJTree(new SequenceI[0], nf).findLeaves(nf.getTree(),
- new Vector());
+ Vector<SequenceNode> oseqs, nseqs;
+ 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()];
for (int i = 0, iSize = oseqs.size(); i < iSize; i++)
{
AssertJUnit.assertTrue(stage + "No nodes in original tree.",
oseqs.size() > 0);
SequenceI[] olsqs = new SequenceI[oseqs.size()];
for (int i = 0, iSize = oseqs.size(); i < iSize; i++)
{
- olsqs[i] = (SequenceI) ((SequenceNode) oseqs.get(i)).element();
+ olsqs[i] = (SequenceI) oseqs.get(i).element();
}
}
- nseqs = new NJTree(new SequenceI[0], nf_regen).findLeaves(
- nf_regen.getTree(), new Vector());
+ nseqs = new TreeModel(new SequenceI[0], null, nf_regen)
+ .findLeaves(nf_regen
+ .getTree());
AssertJUnit.assertTrue(stage + "No nodes in regerated tree.",
nseqs.size() > 0);
SequenceI[] nsqs = new SequenceI[nseqs.size()];
for (int i = 0, iSize = nseqs.size(); i < iSize; i++)
{
AssertJUnit.assertTrue(stage + "No nodes in regerated tree.",
nseqs.size() > 0);
SequenceI[] nsqs = new SequenceI[nseqs.size()];
for (int i = 0, iSize = nseqs.size(); i < iSize; i++)
{
- nsqs[i] = (SequenceI) ((SequenceNode) nseqs.get(i)).element();
+ nsqs[i] = (SequenceI) nseqs.get(i).element();
}
AssertJUnit.assertTrue(stage
+ " Different number of leaves (original " + olsqs.length
}
AssertJUnit.assertTrue(stage
+ " Different number of leaves (original " + olsqs.length
@@
-172,7
+181,7
@@
public class NewickFileTests
/**
* @throws java.lang.Exception
*/
/**
* @throws java.lang.Exception
*/
- @AfterClass
+ @AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
}
public static void tearDownAfterClass() throws Exception
{
}