Package com.hazelcast.client

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


        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());
View Full Code Here


        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());

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

        mm.put("key1", "value2");

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

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

//    @Test
View Full Code Here

        mm.put("key2", "value2");
        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")));
View Full Code Here

        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();
        assertFalse(result);

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

        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();
        assertTrue(result);

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

        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();
        assertFalse(result);

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

        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();
        assertTrue(result);

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

        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();
        assertFalse(result);
    }

//    @Test
View Full Code Here

        mm.put("key4", "value4");

        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"));
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.