use of com.twitter.distributedlog.thrift.service.WriteContext in project distributedlog by twitter.
the class TestDistributedLogService method testWriteOpChecksumBadStream.
@Test(timeout = 60000)
public void testWriteOpChecksumBadStream() throws Exception {
DistributedLogServiceImpl localService = createConfiguredLocalService();
WriteContext ctx = new WriteContext().setCrc32(ProtocolUtils.writeOpCRC32("test", getTestDataBuffer().array()));
Future<WriteResponse> result = localService.writeWithContext("test1", getTestDataBuffer(), ctx);
WriteResponse resp = Await.result(result);
assertEquals(StatusCode.CHECKSUM_FAILED, resp.getHeader().getCode());
localService.shutdown();
}
Aggregations