use of org.corfudb.runtime.exceptions.DataOutrankedException in project CorfuDB by CorfuDB.
the class StreamLogWithRankedAddressSpaceTest method testLowerRank.
@Test
public void testLowerRank() {
StreamLogFiles log = new StreamLogFiles(getContext(), false);
long address = 0;
writeToLog(log, address, DataType.DATA, "v-1", 2);
LogData value1 = log.read(address);
assertTrue(new String(value1.getData()).contains("v-1"));
try {
writeToLog(log, address, DataType.DATA, "v-2", 1);
fail();
} catch (DataOutrankedException e) {
// expected
}
LogData value2 = log.read(address);
assertTrue(new String(value2.getData()).contains("v-1"));
log.close();
}
Aggregations