Exemplo n.º 1
0
 /** Test more general constructor. */
 @Test
 public void testLeafNodeBigIntegerParentNode() {
   assertEquals("Leaf bucket should have prefix one", BigInteger.ONE, leaf.getPrefix());
   assertEquals("Parent should be pseudoRoot", pseudoRoot, leaf.getParent());
   assertNotNull("Bucket map should have been initialised", leaf.kBucket);
   assertNotNull("Cache map should have been initialised", leaf.getReplacementCache());
 }
Exemplo n.º 2
0
 /** Test root-bucket constructor. */
 @Test
 public void testLeafNodeParentNode() {
   assertEquals("Root bucket should have prefix zero", BigInteger.ZERO, root.getPrefix());
   assertEquals("Parent should be pseudoRoot", pseudoRoot, root.getParent());
   assertNotNull("Bucket map should have been initialised", root.kBucket);
   assertNotNull("Cache map should have been initialised", root.getReplacementCache());
 }
Exemplo n.º 3
0
 /** Test accept. */
 @Test
 public void testAccept() {
   VisitorStub visitor = new VisitorStub();
   leaf.accept(visitor);
   assertTrue("LeafNode-visit-method should have been called in visitor", visitor.called);
 }