Package co.paralleluniverse.galaxy.core.Message

Examples of co.paralleluniverse.galaxy.core.Message.MSG


        testSerialize(Message.ALLOCED_REF(m, rand.nextLong(), rand.nextInt()));
    }

    @Test
    public void testMSGSer() {
        final MSG msg1 = Message.MSG((short) rand.nextInt(), rand.nextLong(), rand.nextBoolean(), randomArray(50));
        testSerialize(Message.MSG(msg1, randomArray(80)));

        testSerialize(Message.MSG((short) rand.nextInt(), rand.nextLong(), rand.nextBoolean(), randomArray(80)));

        testSerialize(Message.MSG(randomShortArray(2), rand.nextLong(), rand.nextBoolean(), randomArray(80)));
View Full Code Here


        testSerialize(Message.MSG(randomShortArray(2), rand.nextLong(), rand.nextBoolean(), randomArray(80)));
    }

    @Test
    public void testMSGACKSer() {
        final MSG msg1 = Message.MSG((short) rand.nextInt(), rand.nextLong(), rand.nextBoolean(), randomArray(50));
        testSerialize(Message.MSGACK(msg1));
    }
View Full Code Here

        setCommMsgCounter();
        PUT(1234L, sh(10), 1L, "xxx");
        INV(1234L, sh(10));
        verify(comm).send(argThat(equalTo(Message.INVACK(Message.INV(sh(10), 1234L, sh(-1))).setMessageId(2))));

        MSG msg = Message.MSG(sh(-1), 1234L, true, serialize("foo"));
        Op send = new Op(SEND, 1234, msg, null);
        Object res = cache.runOp(send);

        assertThat(res, is(PENDING));
        verify(comm).send(argThat(equalTo(Message.MSG(sh(10), 1234L, true, serialize("foo")).setMessageId(3))));
View Full Code Here

        pending();
    }

    @Test
    public void testSend() throws Exception {
        MSG msg = Message.MSG(sh(15), -1L, true, serialize("hello"));
        cache.send(msg);

        verify(comm).send(argThat(equalTo(msg)));
    }
View Full Code Here

     * When line not found then broadcast message
     */
    @Test
    public void testSendToOwner2() throws Exception {
        setCommMsgCounter();
        MSG msg = Message.MSG(sh(-1), 1234L, true, serialize("foo"));
        Op send = new Op(SEND, 1234, msg, null);
        Object res = cache.runOp(send);

        assertThat(res, is(PENDING));
        verify(comm).send(argThat(equalTo(Message.MSG(sh(-1), 1234L, true, serialize("foo")).setMessageId(1))));
View Full Code Here

    @Test
    public void testSendToOwner3() throws Exception {
        setCommMsgCounter();
        PUT(1234L, sh(10), 1L, "xxx");

        MSG msg = Message.MSG(sh(-1), 1234L, true, serialize("foo"));
        Op send = new Op(SEND, 1234, msg, null);
        Object res = cache.runOp(send);

        assertThat(res, is(PENDING));
        verify(comm).send(argThat(equalTo(Message.MSG(sh(10), 1234L, true, serialize("foo")).setMessageId(2))));
View Full Code Here

        setCommMsgCounter();
        PUT(1234L, sh(10), 1L, "xxx");
        INV(1234L, sh(10));
        verify(comm).send(argThat(equalTo(Message.INVACK(Message.INV(sh(10), 1234L, sh(-1))).setMessageId(2))));

        MSG msg = Message.MSG(sh(-1), 1234L, true, serialize("foo"));
        Op send = new Op(SEND, 1234, msg, null);
        Object res = cache.runOp(send);

        assertThat(res, is(PENDING));
        verify(comm).send(argThat(equalTo(Message.MSG(sh(10), 1234L, true, serialize("foo")).setMessageId(3))));
View Full Code Here

        doOp(LSTN, 1234L, listener);

        PUTX(1234L, sh(10), 1L, "xxx");

        MSG msg = Message.MSG(sh(-1), 1234L, false, serialize("foo"));
        Op send = new Op(SEND, 1234, msg, null);
        Object res = cache.runOp(send);

        assertThat(res, is(not(PENDING)));
View Full Code Here

    public void testSend2() throws Exception {
        CacheListener listener = mock(CacheListener.class);

        PUTX(1234L, sh(10), 1L, "xxx");

        MSG msg = Message.MSG(sh(-1), 1234L, false, serialize("foo"));
        Op send = new Op(SEND, 1234, msg, null);
        Object res = cache.runOp(send);

        assertThat(res, is(not(PENDING)));
View Full Code Here

        doOp(LSTN, 1234L, listener);

        PUT(1234L, sh(10), 1L, "xxx");

        MSG msg = Message.MSG(sh(-1), 1234L, false, serialize("foo"));
        Op send = new Op(SEND, 1234, msg, null);
        Object res = cache.runOp(send);

        assertThat(res, is(PENDING));
View Full Code Here

TOP

Related Classes of co.paralleluniverse.galaxy.core.Message.MSG

Copyright © 2018 www.massapicom. 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.