Implemented distance tests
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 25 Oct 2017 18:15:53 +0000 (19:15 +0100)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 25 Oct 2017 18:15:53 +0000 (19:15 +0100)
test/jalview/ext/archaeopteryx/AptxJalviewTreeTest.java

index 5c0059d..51bfeeb 100644 (file)
@@ -1,5 +1,6 @@
 package jalview.ext.archaeopteryx;
 
+import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
 import jalview.analysis.NJTree;
@@ -68,22 +69,36 @@ public class AptxJalviewTreeTest extends TreeViewTest
   }
 
   @Override
+  public void testTreeLoaded()
+  {
+    assertTrue(tree != null);
+
+  }
+
+  @Override
   public void testTreeTitle()
   {
     assertTrue(tree.getName().contains("Neighbour Joining Using BLOSUM62"));
 
   }
+
   @Override
   public void testChildNodesCount()
   {
-    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void testExistingBranchName()
+  {
+    tree.getNode("Seq4");
 
   }
 
   @Override
   public void testChildToParentBranchLength()
   {
-    // TODO Auto-generated method stub
+    assertEquals(tree.getNode("Seq1").getDistanceToParent(), 5.25);
 
   }
 
@@ -99,32 +114,19 @@ public class AptxJalviewTreeTest extends TreeViewTest
   @Override
   public void testNodeToRootBranchLength()
   {
-    // TODO Auto-generated method stub
+    assertEquals(tree.getNode("Seq3").calculateDistanceToRoot(), 19.13);
 
   }
 
   @Override
   public void testDistantNodeToRootBranchLength()
   {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void testTreeLoaded()
-  {
-    // TODO Auto-generated method stub
+    assertEquals(tree.getNode("Seq2").calculateDistanceToRoot(),
+            3.75 + 35.75 + 19.13);
 
   }
 
 
 
 
-  @Override
-  public void testExistingBranchName()
-  {
-    // TODO Auto-generated method stub
-
-  }
-
 }