Search in sources :

Example 6 with CacheEntryView

use of com.hazelcast.cache.CacheEntryView in project hazelcast by hazelcast.

the class PassThroughCacheMergePolicyTest method merge_mergingNotNull.

@Test
public void merge_mergingNotNull() {
    CacheEntryView existing = entryWithGivenValue(EXISTING);
    CacheEntryView merging = entryWithGivenValue(MERGING);
    assertEquals(MERGING, policy.merge("cache", merging, existing));
}
Also used : CacheEntryView(com.hazelcast.cache.CacheEntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 7 with CacheEntryView

use of com.hazelcast.cache.CacheEntryView in project hazelcast by hazelcast.

the class PassThroughCacheMergePolicyTest method merge_mergingNull.

@Test
public void merge_mergingNull() {
    CacheEntryView existing = entryWithGivenValue(EXISTING);
    CacheEntryView merging = null;
    assertEquals(EXISTING, policy.merge("cache", merging, existing));
}
Also used : CacheEntryView(com.hazelcast.cache.CacheEntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 8 with CacheEntryView

use of com.hazelcast.cache.CacheEntryView in project hazelcast by hazelcast.

the class PutIfAbsentCacheMergePolicyTest method merge_existingValueAbsent.

@Test
public void merge_existingValueAbsent() {
    CacheEntryView existing = null;
    CacheEntryView merging = entryWithGivenValue(MERGING);
    assertEquals(MERGING, policy.merge("map", merging, existing));
}
Also used : CacheEntryView(com.hazelcast.cache.CacheEntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 9 with CacheEntryView

use of com.hazelcast.cache.CacheEntryView in project hazelcast by hazelcast.

the class PutIfAbsentCacheMergePolicyTest method merge_existingValuePresent.

@Test
public void merge_existingValuePresent() {
    CacheEntryView existing = entryWithGivenValue(EXISTING);
    CacheEntryView merging = entryWithGivenValue(MERGING);
    assertEquals(EXISTING, policy.merge("map", merging, existing));
}
Also used : CacheEntryView(com.hazelcast.cache.CacheEntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 10 with CacheEntryView

use of com.hazelcast.cache.CacheEntryView in project hazelcast by hazelcast.

the class PutIfAbsentCacheMergePolicyTest method merge_bothValuesNull.

@Test
public void merge_bothValuesNull() {
    CacheEntryView existing = entryWithGivenValue(null);
    CacheEntryView merging = entryWithGivenValue(null);
    assertNull(policy.merge("map", merging, existing));
}
Also used : CacheEntryView(com.hazelcast.cache.CacheEntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

CacheEntryView (com.hazelcast.cache.CacheEntryView)10 Test (org.junit.Test)9 ParallelTest (com.hazelcast.test.annotation.ParallelTest)5 QuickTest (com.hazelcast.test.annotation.QuickTest)5 JsonObject (com.eclipsesource.json.JsonObject)1 HazelcastInstanceCacheManager (com.hazelcast.instance.HazelcastInstanceCacheManager)1 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)1