Package com.hazelcast.client

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


        client.send(new CompareAndSetRequest(name, toData(null), toData("foo")));
        assertEquals(Boolean.TRUE, client.receive());
        assertEquals("foo", reference.get());

        client.send(new CompareAndSetRequest(name, toData("foo"), toData("foo")));
        assertEquals(Boolean.TRUE, client.receive());
        assertEquals("foo",reference.get());

        client.send(new CompareAndSetRequest(name, toData(null), toData("pipo")));
        assertEquals(Boolean.FALSE, client.receive());
        assertEquals("foo",reference.get());
View Full Code Here


        mm.put("key2", "value3");

        final SimpleClient client = getClient();
        client.send(new ClearRequest(name));
        assertNull(client.receive());
        assertEquals(0, mm.size());
    }

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

        mm.put("key3", "value3");

        //contains key value
        final SimpleClient client = getClient();
        client.send(new KeyBasedContainsRequest(name, ss.toData("key1"), ss.toData("value1")));
        boolean result = (Boolean) client.receive();
        assertTrue(result);

        //not contains key value
        client.send(new KeyBasedContainsRequest(name, ss.toData("key1"), ss.toData("value2")));
        result = (Boolean) client.receive();
View Full Code Here

        boolean result = (Boolean) client.receive();
        assertTrue(result);

        //not contains key value
        client.send(new KeyBasedContainsRequest(name, ss.toData("key1"), ss.toData("value2")));
        result = (Boolean) client.receive();
        assertFalse(result);

        //contains key
        client.send(new KeyBasedContainsRequest(name, ss.toData("key2"), null));
        result = (Boolean) client.receive();
View Full Code Here

        result = (Boolean) client.receive();
        assertFalse(result);

        //contains key
        client.send(new KeyBasedContainsRequest(name, ss.toData("key2"), null));
        result = (Boolean) client.receive();
        assertTrue(result);

        //not contains key
        client.send(new KeyBasedContainsRequest(name, ss.toData("key4"), null));
        result = (Boolean) client.receive();
View Full Code Here

        result = (Boolean) client.receive();
        assertTrue(result);

        //not contains key
        client.send(new KeyBasedContainsRequest(name, ss.toData("key4"), null));
        result = (Boolean) client.receive();
        assertFalse(result);

        //contains value
        client.send(new ContainsRequest(name, ss.toData("value3")));
        result = (Boolean) client.receive();
View Full Code Here

        result = (Boolean) client.receive();
        assertFalse(result);

        //contains value
        client.send(new ContainsRequest(name, ss.toData("value3")));
        result = (Boolean) client.receive();
        assertTrue(result);

        //not contains value
        client.send(new ContainsRequest(name, ss.toData("value0")));
        result = (Boolean) client.receive();
View Full Code Here

        result = (Boolean) client.receive();
        assertTrue(result);

        //not contains value
        client.send(new ContainsRequest(name, ss.toData("value0")));
        result = (Boolean) client.receive();
        assertFalse(result);
    }

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

        mm.put("key5", "value3");

        final SimpleClient client = getClient();
        client.send(new EntrySetRequest(name));
        PortableEntrySetResponse result = (PortableEntrySetResponse) client.receive();
        Set<Map.Entry> entrySet = result.getEntrySet();
        Data value = (Data) entrySet.iterator().next().getValue();
        String s = (String) ss.toObject(value);
        assertTrue(s.startsWith("value"));
        assertEquals(6, entrySet.size());
View Full Code Here

        mm.put("key2", "value1");
        mm.put("key2", "value2");

        final SimpleClient client = getClient();
        client.send(new GetAllRequest(name, ss.toData("key1")));
        PortableCollection result = (PortableCollection) client.receive();
        Collection<Data> coll = result.getCollection();
        assertEquals(1, coll.size());
        assertEquals("value1", ss.toObject(coll.iterator().next()));

        client.send(new GetAllRequest(name, ss.toData("key2")));
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.