示例#1
0
  /** Test scanning for keys with begin and end. */
  public void testScanKeysBeginEnd() throws StorageException {
    store.put(new byte[] {1}, new byte[] {1});
    store.put(new byte[] {2}, new byte[] {2});
    store.put(new byte[] {3}, new byte[] {3});
    store.put(new byte[] {4}, new byte[] {1});

    store.scanKeys(new byte[] {2}, new byte[] {4}, callback);
    assertEquals(2, callback.keys.size());
  }
示例#2
0
 /** Test scanning for keys with prefix. */
 public void testScanKeysPrefix() throws StorageException {
   store.put(new byte[] {1}, new byte[] {1});
   store.scanKeys(new byte[] {1}, callback);
   assertEquals(1, callback.keys.size());
 }