Author: chinmoy
Date: 2009-06-26 10:32:24 -0700 (Fri, 26 Jun 2009)
New Revision: 17110

Modified:
   
csplugins/trunk/soc/chinmoy/phylotree/tests/org/cytoscape/phylotree/parser/PhylipTreeImplTest.java
Log:


Modified: 
csplugins/trunk/soc/chinmoy/phylotree/tests/org/cytoscape/phylotree/parser/PhylipTreeImplTest.java
===================================================================
--- 
csplugins/trunk/soc/chinmoy/phylotree/tests/org/cytoscape/phylotree/parser/PhylipTreeImplTest.java
  2009-06-26 17:32:04 UTC (rev 17109)
+++ 
csplugins/trunk/soc/chinmoy/phylotree/tests/org/cytoscape/phylotree/parser/PhylipTreeImplTest.java
  2009-06-26 17:32:24 UTC (rev 17110)
@@ -12,23 +12,53 @@
        
        public void setUp() {
        
-               String treeStr = "XXXX";
-               PhylipTreeImpl treeParser = new PhylipTreeImpl(treeStr);
+               treeStr = "(B:9,(A:8,C:7,E:6),D:5);";
+               treeParser = new PhylipTreeImpl(treeStr);
        }
        
        public void testGetNodeList() {
-               List nodeList = treeParser.getNodeList();
+               List<PhylotreeNode> nodeList = treeParser.getNodeList();
                
-               assertEquals("","");
+               // Test number of nodes
+               assertEquals(7,nodeList.size());
+               
+               // Test names of first and second to last nodes created
+               assertEquals("E", nodeList.get(0).getName());
+               assertEquals("B",nodeList.get(nodeList.size()-2).getName());
+               
+                
        }
        
        public void testGetEdges() {
+
+               // Test the number of edges the first parent node has
+               List<PhylotreeNode> nodeList = treeParser.getNodeList();
                
+               List<PhylotreeEdge> edgeList = 
treeParser.getEdges(nodeList.get(4));
+               
+               assertEquals(4, edgeList.size());
+               
+       
+               
        }
 
        
        public void testGetEdgeAttribute() {
                
+               List<PhylotreeNode> nodeList = treeParser.getNodeList();
+               List<PhylotreeEdge> edgeList = 
treeParser.getEdges(nodeList.get(0));
+               
+               // Test edge lengths of the first node
+               assertEquals(6.0, 
treeParser.getEdgeAttribute(edgeList.get(0)).get(0));
+               
+               // Test edge lengths of the first parent node
+               edgeList = treeParser.getEdges(nodeList.get(4));
+               
+               assertEquals(6.0, 
treeParser.getEdgeAttribute(edgeList.get(0)).get(0));
+               assertEquals(7.0, 
treeParser.getEdgeAttribute(edgeList.get(1)).get(0));
+               assertEquals(8.0, 
treeParser.getEdgeAttribute(edgeList.get(2)).get(0));
+               assertEquals(0.0, 
treeParser.getEdgeAttribute(edgeList.get(3)).get(0));
+               
        }
 
 }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to