use of net.spy.memcached.CASResponse in project geode by apache.
the class GemcachedDevelopmentJUnitTest method testCas.
@Test
public void testCas() throws Exception {
MemcachedClient client = bootstrapClient();
client.add("caskey", 10, "casValue").get();
CASValue<Object> val = client.gets("caskey");
assertEquals("casValue", val.getValue());
CASResponse r = client.cas("caskey", val.getCas(), "newValue");
assertEquals(CASResponse.OK, r);
r = client.cas("caskey", val.getCas(), "newValue2");
assertEquals(CASResponse.EXISTS, r);
}
Aggregations