Exemple #1
0
  @Test
  public void batch_insert() {

    for (int i = 0; i < 1000; i++) {
      m.put(i * 10, i * 10 + 1);
    }

    for (int i = 0; i < 10000; i++) {
      assertEquals(i % 10 == 0 ? i + 1 : null, m.get(i));
    }
  }
Exemple #2
0
  @Test
  public void simple_root_get() {

    if (valsOutside) return;

    BTreeMap.LeafNode l =
        new BTreeMap.LeafNode(
            new Object[] {10, 20, 30}, true, true, false, new Object[] {10, 20, 30}, 0);
    long rootRecid = engine.put(l, m.nodeSerializer);
    engine.update(m.rootRecidRef, rootRecid, Serializer.RECID);

    assertEquals(null, m.get(1));
    assertEquals(null, m.get(9));
    assertEquals(10, m.get(10));
    assertEquals(null, m.get(11));
    assertEquals(null, m.get(19));
    assertEquals(20, m.get(20));
    assertEquals(null, m.get(21));
    assertEquals(null, m.get(29));
    assertEquals(30, m.get(30));
    assertEquals(null, m.get(31));
  }