use of org.infinispan.server.hotrod.test.TestResponseWithPrevious in project infinispan by infinispan.
the class HotRodFunctionalTest method testRemoveIfUmodifiedWithPreviousValue.
public void testRemoveIfUmodifiedWithPreviousValue(Method m) {
TestResponse resp = client().removeIfUnmodified(k(m), 999, 0);
assertStatus(resp, KeyDoesNotExist);
client().assertPut(m);
TestGetWithVersionResponse getResp = client().getWithVersion(k(m), 0);
assertSuccess(getResp, v(m), 0);
TestResponseWithPrevious resp2 = (TestResponseWithPrevious) client().removeIfUnmodified(k(m), 888, 1);
assertNotExecutedPrevious(resp2, v(m));
TestResponseWithPrevious resp3 = (TestResponseWithPrevious) client().removeIfUnmodified(k(m), getResp.dataVersion, 1);
assertSuccessPrevious(resp3, v(m));
}
use of org.infinispan.server.hotrod.test.TestResponseWithPrevious in project infinispan by infinispan.
the class HotRodFunctionalTest method testReplaceWithPreviousValue.
public void testReplaceWithPreviousValue(Method m) {
TestResponse resp = client().replace(k(m), 0, 0, v(m), 0);
assertStatus(resp, OperationNotExecuted);
TestResponseWithPrevious resp2 = (TestResponseWithPrevious) client().put(k(m), 0, 0, v(m, "v2-"), 1);
assertSuccessPrevious(resp2, null);
TestResponseWithPrevious resp3 = (TestResponseWithPrevious) client().replace(k(m), 0, 0, v(m, "v3-"), 1);
assertSuccessPrevious(resp3, v(m, "v2-"));
}
use of org.infinispan.server.hotrod.test.TestResponseWithPrevious in project infinispan by infinispan.
the class HotRodFunctionalTest method testPutWithPreviousValue.
public void testPutWithPreviousValue(Method m) {
TestResponseWithPrevious resp = ((TestResponseWithPrevious) client().put(k(m), 0, 0, v(m), 1));
assertSuccessPrevious(resp, null);
resp = (TestResponseWithPrevious) client().put(k(m), 0, 0, v(m, "v2-"), 1);
assertSuccessPrevious(resp, v(m));
}
use of org.infinispan.server.hotrod.test.TestResponseWithPrevious in project infinispan by infinispan.
the class HotRodFunctionalTest method testReplaceIfUnmodifiedWithPreviousValue.
public void testReplaceIfUnmodifiedWithPreviousValue(Method m) {
TestResponse resp = client().replaceIfUnmodified(k(m), 0, 0, v(m), 999, 0);
assertStatus(resp, KeyDoesNotExist);
client().assertPut(m);
TestGetWithVersionResponse getResp = client().getWithVersion(k(m), 0);
assertSuccess(getResp, v(m), 0);
TestResponseWithPrevious resp2 = (TestResponseWithPrevious) client().replaceIfUnmodified(k(m), 0, 0, v(m, "v2-"), 888, 1);
assertNotExecutedPrevious(resp2, v(m));
TestResponseWithPrevious resp3 = (TestResponseWithPrevious) client().replaceIfUnmodified(k(m), 0, 0, v(m, "v3-"), getResp.dataVersion, 1);
assertSuccessPrevious(resp3, v(m));
}
use of org.infinispan.server.hotrod.test.TestResponseWithPrevious in project infinispan by infinispan.
the class HotRodFunctionalTest method testPutIfAbsentWithPreviousValue.
public void testPutIfAbsentWithPreviousValue(Method m) {
TestResponse resp1 = client().putIfAbsent(k(m), 0, 0, v(m), 0);
assertStatus(resp1, Success);
TestResponseWithPrevious resp2 = (TestResponseWithPrevious) client().putIfAbsent(k(m), 0, 0, v(m, "v2-"), 1);
assertNotExecutedPrevious(resp2, v(m));
}
Aggregations