Package com.hazelcast.client

Examples of com.hazelcast.client.SimpleClient.send()


        assertEquals(3, client.receive());
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(5, client.receive());
        client.send(new MapGetRequest(mapName, TestUtil.toData(7)));
        assertNull(client.receive());
        client.send(new MapSetRequest(mapName, TestUtil.toData(1), TestUtil.toData(7), ThreadUtil.getThreadId()));
        assertFalse((Boolean) client.receive());
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(7, client.receive());
        client.send(new MapPutTransientRequest(mapName, TestUtil.toData(1), TestUtil.toData(9), ThreadUtil.getThreadId()));
        client.receive();
View Full Code Here


        assertEquals(5, client.receive());
        client.send(new MapGetRequest(mapName, TestUtil.toData(7)));
        assertNull(client.receive());
        client.send(new MapSetRequest(mapName, TestUtil.toData(1), TestUtil.toData(7), ThreadUtil.getThreadId()));
        assertFalse((Boolean) client.receive());
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(7, client.receive());
        client.send(new MapPutTransientRequest(mapName, TestUtil.toData(1), TestUtil.toData(9), ThreadUtil.getThreadId()));
        client.receive();
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(9, client.receive());
View Full Code Here

        assertNull(client.receive());
        client.send(new MapSetRequest(mapName, TestUtil.toData(1), TestUtil.toData(7), ThreadUtil.getThreadId()));
        assertFalse((Boolean) client.receive());
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(7, client.receive());
        client.send(new MapPutTransientRequest(mapName, TestUtil.toData(1), TestUtil.toData(9), ThreadUtil.getThreadId()));
        client.receive();
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(9, client.receive());
    }
View Full Code Here

        assertFalse((Boolean) client.receive());
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(7, client.receive());
        client.send(new MapPutTransientRequest(mapName, TestUtil.toData(1), TestUtil.toData(9), ThreadUtil.getThreadId()));
        client.receive();
        client.send(new MapGetRequest(mapName, TestUtil.toData(1)));
        assertEquals(9, client.receive());
    }

    @Test
    public void testMapSize() throws IOException {
View Full Code Here

        final IMap map = getMap();
        for (int i = 0; i < size; i++) {
            map.put("-" + i, "-" + i);
        }
        final SimpleClient client = getClient();
        client.send(new MapSizeRequest(mapName));
        assertEquals(size, client.receive());
    }

    @Test
    public void testMapKeyset() throws IOException {
View Full Code Here

        for (int i = 0; i < size; i++) {
            map.put(i, "v" + i);
            testSet.add(i);
        }
        final SimpleClient client = getClient();
        client.send(new MapKeySetRequest(mapName));
        MapKeySet keyset = (MapKeySet) client.receive();
        for (Data o : keyset.getKeySet()) {
            Object x = TestUtil.toObject(o);
            assertTrue(testSet.remove(x));
        }
View Full Code Here

        for (int i = 0; i < size; i++) {
            map.put(i, "v" + i);
            testSet.add("v" + i);
        }
        final SimpleClient client = getClient();
        client.send(new MapValuesRequest(mapName));
        MapValueCollection values = (MapValueCollection) client.receive();
        for (Data o : values.getValues()) {
            Object x = TestUtil.toObject(o);
            assertTrue(testSet.remove(x));
        }
View Full Code Here

    @Test
    public void testMapContainsKeyValue() throws IOException {
        int size = 100;
        final SimpleClient client = getClient();
        client.send(new MapContainsKeyRequest(mapName, TestUtil.toData("-")));
        assertFalse((Boolean) client.receive());
        for (int i = 0; i < size; i++) {
            getMap().put("-" + i, "-" + i);
        }
        for (int i = 0; i < size; i++) {
View Full Code Here

        assertFalse((Boolean) client.receive());
        for (int i = 0; i < size; i++) {
            getMap().put("-" + i, "-" + i);
        }
        for (int i = 0; i < size; i++) {
            client.send(new MapContainsKeyRequest(mapName, TestUtil.toData("-" + i)));
            assertTrue((Boolean) client.receive());
        }
        client.send(new MapContainsKeyRequest(mapName, TestUtil.toData("-")));
        assertFalse((Boolean) client.receive());
View Full Code Here

        }
        for (int i = 0; i < size; i++) {
            client.send(new MapContainsKeyRequest(mapName, TestUtil.toData("-" + i)));
            assertTrue((Boolean) client.receive());
        }
        client.send(new MapContainsKeyRequest(mapName, TestUtil.toData("-")));
        assertFalse((Boolean) client.receive());


        client.send(new MapContainsValueRequest(mapName, TestUtil.toData("-")));
        assertFalse((Boolean) client.receive());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.