예제 #1
0
  @Test
  public void test_dir_node_serialization() throws IOException {

    BTreeMap.DirNode n =
        new BTreeMap.DirNode(new Object[] {1, 2, 3}, false, true, false, mkchild(4, 5, 6, 0));
    BTreeMap.DirNode n2 = (BTreeMap.DirNode) TT.clone(n, m.nodeSerializer);

    assertTrue(Arrays.equals(nodeKeysToArray(n), nodeKeysToArray(n2)));
    assertTrue(Arrays.equals((int[]) n.child, (int[]) n2.child));
  }
예제 #2
0
  @Test
  public void test_leaf_node_serialization() throws IOException {

    if (valsOutside) return;

    BTreeMap.LeafNode n =
        new BTreeMap.LeafNode(new Object[] {1, 2, 3}, true, true, false, new Object[] {1, 2, 3}, 0);
    BTreeMap.LeafNode n2 = (BTreeMap.LeafNode) TT.clone(n, m.nodeSerializer);
    assertTrue(Arrays.equals(nodeKeysToArray(n), nodeKeysToArray(n2)));
    assertEquals(n.next, n2.next);
  }