From: kjvdheide Date: Wed, 25 Oct 2017 17:03:14 +0000 (+0100) Subject: Removed redundant annotations X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=43743a3981ff8d68c76a4419e69aa0fd60735405;p=jalview.git Removed redundant annotations --- diff --git a/test/jalview/ext/archaeopteryx/AptxJalviewTreeTest.java b/test/jalview/ext/archaeopteryx/AptxJalviewTreeTest.java index f7ec7d6..91d6b20 100644 --- a/test/jalview/ext/archaeopteryx/AptxJalviewTreeTest.java +++ b/test/jalview/ext/archaeopteryx/AptxJalviewTreeTest.java @@ -17,6 +17,7 @@ import org.forester.archaeopteryx.MainFrame; import org.forester.archaeopteryx.TreePanel; import org.forester.phylogeny.Phylogeny; import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; public class AptxJalviewTreeTest extends TreeViewTest { @@ -99,7 +100,9 @@ public class AptxJalviewTreeTest extends TreeViewTest } - @Override + @Test( + groups = "Functional", + expectedExceptions = IllegalArgumentException.class) public void testInvalidBranchName() { // TODO Auto-generated method stub diff --git a/test/jalview/ext/archaeopteryx/AptxPhylogenyTreeTest.java b/test/jalview/ext/archaeopteryx/AptxPhylogenyTreeTest.java index bc908e2..0e51ea3 100644 --- a/test/jalview/ext/archaeopteryx/AptxPhylogenyTreeTest.java +++ b/test/jalview/ext/archaeopteryx/AptxPhylogenyTreeTest.java @@ -3,8 +3,6 @@ package jalview.ext.archaeopteryx; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; -import jalview.gui.JvOptionPane; - import org.forester.archaeopteryx.MainFrame; import org.forester.archaeopteryx.TreePanel; import org.forester.phylogeny.Phylogeny; @@ -62,7 +60,6 @@ public class AptxPhylogenyTreeTest extends TreeViewTest @BeforeClass(dependsOnMethods = { "setUpJalview", "setUpTree" }) public void createTreeView() { - treeView = ArchaeopteryxInit.createInstance(inputTree); aptx = (MainFrame) treeView; // pretty ugly treePanel = aptx.getMainPanel().getCurrentTreePanel(); @@ -70,12 +67,6 @@ public class AptxPhylogenyTreeTest extends TreeViewTest } - @BeforeClass(alwaysRun = true) - public void setUpJvOptionPane() - { - JvOptionPane.setInteractiveMode(false); - JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); - } @Test(groups = "Functional") public void testMainPanelExists() @@ -86,10 +77,9 @@ public class AptxPhylogenyTreeTest extends TreeViewTest @Test(groups = "Functional") public void testTreePanelExists() { - assertTrue(aptx.getMainPanel().getCurrentTreePanel() != null); + assertTrue(treePanel != null); } - @Override @Test( groups = "Functional", expectedExceptions = IllegalArgumentException.class) @@ -100,7 +90,6 @@ public class AptxPhylogenyTreeTest extends TreeViewTest } @Override - @Test(groups = "Functional") public void testExistingBranchName() { tree.getNode("leaf 2"); @@ -108,15 +97,12 @@ public class AptxPhylogenyTreeTest extends TreeViewTest } @Override - @Test(groups = "Functional") public void testTreeLoaded() { - assertTrue(aptx.getMainPanel().getCurrentTreePanel() - .getPhylogeny() != null); + assertTrue(tree != null); } @Override - @Test(groups = "Functional") public void testChildNodesCount() { assertEquals(tree.getNode("ancestor 1").getNumberOfExternalNodes(), 3); @@ -124,7 +110,6 @@ public class AptxPhylogenyTreeTest extends TreeViewTest } @Override - @Test(groups = "Functional") public void testChildToParentBranchLength() { assertEquals(tree.getNode("leaf 1a").getDistanceToParent(), 2.0); @@ -132,7 +117,6 @@ public class AptxPhylogenyTreeTest extends TreeViewTest } @Override - @Test(groups = "Functional") public void testNodeToRootBranchLength() { assertEquals(tree.getNode("leaf 2").getDistanceToParent(), 42.0); @@ -140,7 +124,6 @@ public class AptxPhylogenyTreeTest extends TreeViewTest } @Override - @Test(groups = "Functional") public void testDistantNodeToRootBranchLength() { assertEquals(tree.getNode("leaf 1c").calculateDistanceToRoot(), diff --git a/test/jalview/ext/archaeopteryx/TreeViewTest.java b/test/jalview/ext/archaeopteryx/TreeViewTest.java index 013663e..fd18886 100644 --- a/test/jalview/ext/archaeopteryx/TreeViewTest.java +++ b/test/jalview/ext/archaeopteryx/TreeViewTest.java @@ -4,6 +4,7 @@ import static org.testng.Assert.assertTrue; import jalview.bin.Jalview; import jalview.gui.Desktop; +import jalview.gui.JvOptionPane; import javax.swing.JInternalFrame; @@ -12,12 +13,17 @@ import org.testng.annotations.Test; public abstract class TreeViewTest { - Jalview jalview; JInternalFrame treeView; @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public abstract void setUpTree(); @BeforeClass(alwaysRun = true) @@ -27,7 +33,6 @@ public abstract class TreeViewTest Jalview.main(args); } - @BeforeClass(dependsOnMethods = { "setUpJalview", "setUpTree" }) public abstract void createTreeView(); @Test(groups = "Functional") @@ -48,11 +53,6 @@ public abstract class TreeViewTest assertTrue(treeView.isShowing()); } - @Test( - groups = "Functional", - expectedExceptions = IllegalArgumentException.class) - public abstract void testInvalidBranchName(); - @Test(groups = "Functional") public abstract void testTreeLoaded();