@Test
 public void large_record_update() {
   byte[] b = new byte[100000];
   Arrays.fill(b, (byte) 111);
   long recid = engine.recordPut(b, Serializer.BYTE_ARRAY_SERIALIZER);
   Arrays.fill(b, (byte) 222);
   engine.recordUpdate(recid, b, Serializer.BYTE_ARRAY_SERIALIZER);
   byte[] b2 = engine.recordGet(recid, Serializer.BYTE_ARRAY_SERIALIZER);
   assertArrayEquals(b, b2);
 }
 @Test
 public void large_record_delete() {
   byte[] b = new byte[100000];
   Arrays.fill(b, (byte) 111);
   long recid = engine.recordPut(b, Serializer.BYTE_ARRAY_SERIALIZER);
   engine.recordDelete(recid);
 }
Example #3
0
  @Test
  public void test_find_children_2() {
    for (boolean left : new boolean[] {true, false}) {
      for (boolean right : new boolean[] {true, false}) {
        List keys = new ArrayList();
        for (int i = 0; i < 100; i += 10) {
          keys.add(i);
        }

        int[] child = new int[keys.size() + (right ? 1 : 0) + (left ? 1 : 0)];
        Arrays.fill(child, 11);
        if (right) child[child.length - 1] = 0;

        BTreeMap.BNode n = new BTreeMap.DirNode(keys.toArray(), left, right, false, mkchild(child));

        for (int i = -10; i < 110; i++) {
          int pos = BTreeKeySerializer.BASIC.findChildren(n, i);
          int expected = (i + (left ? 19 : 9)) / 10;
          expected = Math.max(left ? 1 : 0, expected);
          expected = Math.min(left ? 11 : 10, expected);
          assertEquals("i:" + i + " - l:" + left + " - r:" + right, expected, pos);
        }
      }
    }
  }