Пример #1
0
  @Test
  public void writeNewReadExisting() throws IOException {
    io.write("checkpoint.head", 1, 2, 3, 4, 5);

    Checkpoint checkpoint = io.read("checkpoint.head");

    assertThat(checkpoint.getPageNum(), is(equalTo(1)));
    assertThat(checkpoint.getFirstUnackedPageNum(), is(equalTo(2)));
    assertThat(checkpoint.getFirstUnackedSeqNum(), is(equalTo(3L)));
    assertThat(checkpoint.getMinSeqNum(), is(equalTo(4L)));
    assertThat(checkpoint.getElementCount(), is(equalTo(5)));
  }
Пример #2
0
 @Test
 public void readInnexisting() throws IOException {
   Checkpoint checkpoint = io.read("checkpoint.invalid");
   assertThat(checkpoint, is(equalTo(null)));
 }