Search in sources :

Example 11 with EntryView

use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.

the class ClientMapBasicTest method testGetEntryView_whenKeyAbsent.

@Test
public void testGetEntryView_whenKeyAbsent() {
    IMap<String, String> map = client.getMap(randomString());
    EntryView view = map.getEntryView("NOT_THERE");
    assertEquals(null, view);
}
Also used : EntryView(com.hazelcast.core.EntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 12 with EntryView

use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.

the class SimpleEntryViewTest method test_toString.

@Test
public void test_toString() throws Exception {
    HazelcastInstance instance = createHazelcastInstance();
    IMap map = instance.getMap("test");
    map.put(1, 1);
    EntryView entryView = map.getEntryView(1);
    assertEquals(stringify(entryView), entryView.toString());
}
Also used : IMap(com.hazelcast.core.IMap) HazelcastInstance(com.hazelcast.core.HazelcastInstance) EntryView(com.hazelcast.core.EntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 13 with EntryView

use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.

the class LazyEntryViewFromRecordTest method test_equals.

@Test
public void test_equals() throws Exception {
    EntryView entryView = createDefaultEntryView();
    assertTrue(view.equals(entryView) && entryView.equals(view));
}
Also used : EntryView(com.hazelcast.core.EntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 14 with EntryView

use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.

the class LazyEntryViewFromRecordTest method test_hashCode.

@Test
public void test_hashCode() throws Exception {
    EntryView entryView = createDefaultEntryView();
    assertEquals(entryView.hashCode(), view.hashCode());
}
Also used : EntryView(com.hazelcast.core.EntryView) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 15 with EntryView

use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.

the class MapProxySupport method getEntryViewInternal.

protected EntryView getEntryViewInternal(Data key) {
    int partitionId = partitionService.getPartitionId(key);
    MapOperation operation = operationProvider.createGetEntryViewOperation(name, key);
    operation.setThreadId(ThreadUtil.getThreadId());
    operation.setServiceName(SERVICE_NAME);
    try {
        Future future = operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
        return (EntryView) toObject(future.get());
    } catch (Throwable t) {
        throw rethrow(t);
    }
}
Also used : EntryView(com.hazelcast.core.EntryView) Future(java.util.concurrent.Future) InternalCompletableFuture(com.hazelcast.spi.InternalCompletableFuture) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Aggregations

EntryView (com.hazelcast.core.EntryView)30 Test (org.junit.Test)14 ParallelTest (com.hazelcast.test.annotation.ParallelTest)11 QuickTest (com.hazelcast.test.annotation.QuickTest)11 Record (com.hazelcast.map.impl.record.Record)10 Data (com.hazelcast.nio.serialization.Data)9 EntryViews.createSimpleEntryView (com.hazelcast.map.impl.EntryViews.createSimpleEntryView)6 IMap (com.hazelcast.core.IMap)2 MapContainer (com.hazelcast.map.impl.MapContainer)2 MapEventPublisher (com.hazelcast.map.impl.event.MapEventPublisher)2 MapOperation (com.hazelcast.map.impl.operation.MapOperation)2 Future (java.util.concurrent.Future)2 JsonObject (com.eclipsesource.json.JsonObject)1 EntryEventType (com.hazelcast.core.EntryEventType)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 Node (com.hazelcast.instance.Node)1 MapOperationProvider (com.hazelcast.map.impl.operation.MapOperationProvider)1 MergeOperation (com.hazelcast.map.impl.operation.MergeOperation)1 RecordInfo (com.hazelcast.map.impl.record.RecordInfo)1 Records.buildRecordInfo (com.hazelcast.map.impl.record.Records.buildRecordInfo)1