Search in sources :

Example 1 with TestResponseWithPrevious

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));
}
Also used : TestResponse(org.infinispan.server.hotrod.test.TestResponse) TestResponseWithPrevious(org.infinispan.server.hotrod.test.TestResponseWithPrevious) TestGetWithVersionResponse(org.infinispan.server.hotrod.test.TestGetWithVersionResponse)

Example 2 with TestResponseWithPrevious

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-"));
}
Also used : TestResponse(org.infinispan.server.hotrod.test.TestResponse) TestResponseWithPrevious(org.infinispan.server.hotrod.test.TestResponseWithPrevious)

Example 3 with TestResponseWithPrevious

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));
}
Also used : TestResponseWithPrevious(org.infinispan.server.hotrod.test.TestResponseWithPrevious)

Example 4 with TestResponseWithPrevious

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));
}
Also used : TestResponse(org.infinispan.server.hotrod.test.TestResponse) TestResponseWithPrevious(org.infinispan.server.hotrod.test.TestResponseWithPrevious) TestGetWithVersionResponse(org.infinispan.server.hotrod.test.TestGetWithVersionResponse)

Example 5 with TestResponseWithPrevious

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));
}
Also used : TestResponse(org.infinispan.server.hotrod.test.TestResponse) TestResponseWithPrevious(org.infinispan.server.hotrod.test.TestResponseWithPrevious)

Aggregations

TestResponseWithPrevious (org.infinispan.server.hotrod.test.TestResponseWithPrevious)6 TestResponse (org.infinispan.server.hotrod.test.TestResponse)5 TestGetWithVersionResponse (org.infinispan.server.hotrod.test.TestGetWithVersionResponse)2