Created test class for Archaeopteryx tree viewing
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 12 Oct 2017 08:52:50 +0000 (09:52 +0100)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 12 Oct 2017 09:38:21 +0000 (10:38 +0100)
src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java
test/jalview/ext/archaeopteryx/AptxTreeCreationTest.java [new file with mode: 0644]

index 82cabcd..82f215a 100644 (file)
@@ -57,8 +57,8 @@ public class ArchaeopteryxTreeBuilder // cannot inherit
 
 
 
-    // final Phylogeny phy = nj.execute(JalviewMatrixToForesterMatrix
-    // .convertJalviewToForester(distances));
+    final Phylogeny phy = nj.execute(JalviewMatrixToForesterMatrix
+            .convertJalviewToForester(distances));
 
     return buildAptxTree(sequences);
 
diff --git a/test/jalview/ext/archaeopteryx/AptxTreeCreationTest.java b/test/jalview/ext/archaeopteryx/AptxTreeCreationTest.java
new file mode 100644 (file)
index 0000000..d390997
--- /dev/null
@@ -0,0 +1,59 @@
+package jalview.ext.archaeopteryx;
+
+import jalview.gui.JvOptionPane;
+
+import org.forester.phylogeny.Phylogeny;
+import org.forester.phylogeny.PhylogenyNode;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class AptxTreeCreationTest
+{
+  final Phylogeny phy = new Phylogeny();
+
+  final PhylogenyNode rootNode = new PhylogenyNode("root");
+
+  final PhylogenyNode ancestor1Node = new PhylogenyNode("ancestor 1");
+
+  final PhylogenyNode leaf2Node = new PhylogenyNode("leaf 2");
+
+  final PhylogenyNode leaf1aNode = new PhylogenyNode("leaf 1a");
+
+  final PhylogenyNode leaf1bNode = new PhylogenyNode("leaf 1b");
+
+  final PhylogenyNode leaf1cNode = new PhylogenyNode("leaf 1c");
+
+  {
+    ancestor1Node.addAsChild(leaf1aNode);
+    ancestor1Node.addAsChild(leaf1bNode);
+    ancestor1Node.addAsChild(leaf1cNode);
+
+    rootNode.addAsChild(ancestor1Node);
+    rootNode.addAsChild(leaf2Node);
+
+    leaf1aNode.setDistanceToParent(2);
+    leaf1bNode.setDistanceToParent(3);
+    leaf1cNode.setDistanceToParent(4);
+
+    ancestor1Node.setDistanceToParent(36);
+    leaf2Node.setDistanceToParent(42);
+
+    phy.setRoot(rootNode);
+    phy.setRooted(true);
+
+  }
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
+  @Test(groups = "Functional")
+  public void testShowingTree()
+  {
+
+  }
+
+}