Added abstract class for tree viewer testing, rearranged existing tests
[jalview.git] / test / jalview / ext / archaeopteryx / TreeViewTest.java
1 package jalview.ext.archaeopteryx;
2
3 import static org.testng.Assert.assertTrue;
4
5 import jalview.bin.Jalview;
6 import jalview.gui.Desktop;
7
8 import javax.swing.JInternalFrame;
9
10 import org.testng.annotations.BeforeClass;
11 import org.testng.annotations.Test;
12
13 public abstract class TreeViewTest
14 {
15
16   Jalview jalview;
17
18   JInternalFrame treeView;
19
20   @BeforeClass(alwaysRun = true)
21   public abstract void setUpTree();
22
23   @BeforeClass(alwaysRun = true)
24   public void setUpJalview()
25   {
26     String[] args = new String[0];
27     Jalview.main(args);
28   }
29
30   @Test(groups = "Functional")
31   public void testTreeViewExists()
32   {
33     assertTrue(treeView != null);
34   }
35
36   @Test(groups = "Functional")
37   public void testTreeViewBoundToJalview()
38   {
39     assertTrue(treeView.getTopLevelAncestor() instanceof Desktop);
40   }
41
42   @Test(groups = "Functional")
43   public void testShowingTreeView()
44   {
45     assertTrue(treeView.isShowing());
46   }
47
48   @Test(groups = "Functional")
49   public abstract void testTreeLoaded();
50
51   @Test(groups = "Functional")
52   public abstract void testChildNodesCount();
53
54   @Test(groups = "Functional")
55   public abstract void testChildToParentBranchLength();
56
57   @Test(groups = "Functional")
58   public abstract void testNodeToRootBranchLength();
59
60   @Test(groups = "Functional")
61   public abstract void testDistantNodeToRootBranchLength();
62 }