- // @Test(groups = "Functional")
- // public void testCorrectBranchLengths()
- //
- // {
- // aptx.getMainPanel().getTabbedPane().setSelectedIndex(0); // select the
- // // first
- // // (and only) tree
- // // panel
- // treePanel = aptx.getMainPanel().getCurrentTreePanel();
- //
- // System.out.println(treePanel);
- //
- //
- //
- // }
+ @Test(groups = "Functional")
+ public void testMainPanelExists()
+ {
+ assertTrue(aptx.getMainPanel() != null);
+ }
+
+ @Test(groups = "Functional")
+ public void testTreePanelExists()
+ {
+ assertTrue(aptx.getMainPanel().getCurrentTreePanel() != null);
+ }
+
+ @Test(groups = "Functional")
+ public void testTreeLoaded()
+ {
+ assertTrue(aptx.getMainPanel().getCurrentTreePanel() != null);
+ }
+
+ @Test(groups = "Functional")
+ public void testChildNodesCount()
+ {
+ assertEquals(tree.getNode("ancestor 1").getNumberOfExternalNodes(), 3);
+
+ }
+
+ @Test(groups = "Functional")
+ public void testCorrectLeafToParentBranchLength()
+ {
+ assertEquals(tree.getNode("leaf 1a").getDistanceToParent(), 2.0);
+
+ }
+
+ @Test(groups = "Functional")
+ public void testCorrectAncestorLeafToRootBranchLength()
+ {
+ assertEquals(tree.getNode("ancestor 2").getDistanceToParent(), 42.0);
+
+ }
+
+ @Test(groups = "Functional")
+ public void testCorrectLeafToRootBranchLength()
+ {
+ assertEquals(tree.getNode("leaf 1c").calculateDistanceToRoot(),
+ 4.0 + 36.0);
+
+ }
+
+