Search in sources :

Example 11 with CheckAndSetRequest

use of com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest in project atlasdb by palantir.

the class AbstractKeyValueServiceTest method testCheckAndSetAndBackAgain.

@Test
public void testCheckAndSetAndBackAgain() {
    testCheckAndSetFromOtherValue();
    CheckAndSetRequest thirdRequest = CheckAndSetRequest.singleCell(TEST_TABLE, TEST_CELL, value01, value00);
    keyValueService.checkAndSet(thirdRequest);
    verifyCheckAndSet(TEST_CELL, value00);
}
Also used : CheckAndSetRequest(com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest) Test(org.junit.Test)

Example 12 with CheckAndSetRequest

use of com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest in project atlasdb by palantir.

the class AbstractKeyValueServiceTest method testCheckAndSetFromNoValueWhenValueIsPresent.

@Test(expected = CheckAndSetException.class)
public void testCheckAndSetFromNoValueWhenValueIsPresent() {
    Assume.assumeTrue(checkAndSetSupported());
    CheckAndSetRequest request = CheckAndSetRequest.newCell(TEST_TABLE, TEST_CELL, value00);
    keyValueService.checkAndSet(request);
    keyValueService.checkAndSet(request);
}
Also used : CheckAndSetRequest(com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest) Test(org.junit.Test)

Aggregations

CheckAndSetRequest (com.palantir.atlasdb.keyvalue.api.CheckAndSetRequest)12 Test (org.junit.Test)7 CheckAndSetException (com.palantir.atlasdb.keyvalue.api.CheckAndSetException)3 Cell (com.palantir.atlasdb.keyvalue.api.Cell)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableMultimap (com.google.common.collect.ImmutableMultimap)1 Iterables (com.google.common.collect.Iterables)1 AsyncInitializer (com.palantir.async.initializer.AsyncInitializer)1 AtlasDbConstants (com.palantir.atlasdb.AtlasDbConstants)1 PtBytes (com.palantir.atlasdb.encoding.PtBytes)1 ImmutableCheckAndSetRequest (com.palantir.atlasdb.keyvalue.api.ImmutableCheckAndSetRequest)1 InsufficientConsistencyException (com.palantir.atlasdb.keyvalue.api.InsufficientConsistencyException)1 KeyAlreadyExistsException (com.palantir.atlasdb.keyvalue.api.KeyAlreadyExistsException)1 KeyValueService (com.palantir.atlasdb.keyvalue.api.KeyValueService)1 RangeRequest (com.palantir.atlasdb.keyvalue.api.RangeRequest)1 Value (com.palantir.atlasdb.keyvalue.api.Value)1 SchemaMetadata (com.palantir.atlasdb.schema.SchemaMetadata)1 FunctionCheckedException (com.palantir.common.base.FunctionCheckedException)1 PalantirRuntimeException (com.palantir.common.exception.PalantirRuntimeException)1