1 29 package jegg.btree; 30 31 import jegg.impl.TestBase; 32 33 36 public class BinaryTreeTest extends TestBase 37 { 38 static 39 { 40 setTestClass(BinaryTreeTest.class); 41 } 42 private BinaryTree tree; 43 44 public BinaryTreeTest(String s) { super(s); } 45 48 protected void setup() 49 { 50 tree = new BinaryTree(); 51 } 52 55 protected void teardown() 56 { 57 } 59 60 public void test1() 61 { 62 Object zero = new Object (); 63 Object ten = new Object (); 64 Object twenty = new Object (); 65 66 tree.insert(20,twenty); 67 tree.insert(0,zero); 68 tree.insert(10,ten); 69 70 Object o = tree.get(0); 71 assertNotNull(o); 72 assertEquals(o,zero); 73 o = tree.get(10); 74 assertNotNull(o); 75 assertEquals(o,ten); 76 o = tree.get(20); 77 assertNotNull(o); 78 assertEquals(o,twenty); 79 } 80 81 } 82 | Popular Tags |