Package com.tinkerpop.rexster.client

Examples of com.tinkerpop.rexster.client.RexsterClient.execute()


        //create a session
        final SessionRequestMessage outMsg = new SessionRequestMessage();
        outMsg.setRequestAsUUID(UUID.randomUUID());

        inMsg = client.execute(outMsg);
        Assert.assertNotNull(inMsg.Session);
        Assert.assertTrue(inMsg instanceof SessionResponseMessage);

        UUID sessionKey = BitWorks.convertByteArrayToUUID(inMsg.Session);
View Full Code Here


        scriptMessage.metaSetInSession(true);
        scriptMessage.metaSetIsolate(false);
        scriptMessage.setRequestAsUUID(UUID.randomUUID());
        scriptMessage.Session = BitWorks.convertUUIDToByteArray(sessionKey);

        inMsg = client.execute(scriptMessage);
        Assert.assertTrue(inMsg instanceof ScriptResponseMessage);
        Assert.assertTrue(((ScriptResponseMessage) inMsg).Results.get() != null);

        final ScriptRequestMessage scriptMessage2 = new ScriptRequestMessage();
        scriptMessage2.Script = "m = n + 1";
View Full Code Here

        scriptMessage2.LanguageName = "groovy";
        scriptMessage2.metaSetInSession(true);
        scriptMessage2.setRequestAsUUID(UUID.randomUUID());
        scriptMessage2.Session = BitWorks.convertUUIDToByteArray(sessionKey);

        inMsg = client.execute(scriptMessage2);
        Assert.assertTrue(inMsg instanceof ScriptResponseMessage);
        Assert.assertTrue(((ScriptResponseMessage) inMsg).Results.get() != null);
    }

    @Test
View Full Code Here

        //create a session
        final SessionRequestMessage outMsg = new SessionRequestMessage();
        outMsg.setRequestAsUUID(UUID.randomUUID());

        inMsg = client.execute(outMsg);
        Assert.assertNotNull(inMsg.Session);
        Assert.assertTrue(inMsg instanceof SessionResponseMessage);

        UUID sessionKey = BitWorks.convertByteArrayToUUID(inMsg.Session);
View Full Code Here

        scriptMessage.metaSetInSession(true);
        scriptMessage.metaSetIsolate(false);
        scriptMessage.setRequestAsUUID(UUID.randomUUID());
        scriptMessage.Session = BitWorks.convertUUIDToByteArray(sessionKey);

        inMsg = client.execute(scriptMessage);
        Assert.assertTrue(inMsg instanceof ScriptResponseMessage);
        Assert.assertTrue(((ScriptResponseMessage) inMsg).Results.get() != null);

        // test that 'n' is available if the isolate meta flag is set to false
        final ScriptRequestMessage scriptMessage2 = new ScriptRequestMessage();
View Full Code Here

        scriptMessage2.Bindings.put("o", 5);
        scriptMessage2.metaSetInSession(true);
        scriptMessage2.setRequestAsUUID(UUID.randomUUID());
        scriptMessage2.Session = BitWorks.convertUUIDToByteArray(sessionKey);

        inMsg = client.execute(scriptMessage2);
        Assert.assertTrue(inMsg instanceof ScriptResponseMessage);
        Assert.assertTrue(((ScriptResponseMessage) inMsg).Results.get() != null);
    }

    @Test
View Full Code Here

        //create a session
        final SessionRequestMessage outMsg = new SessionRequestMessage();
        outMsg.setRequestAsUUID(UUID.randomUUID());

        inMsg = client.execute(outMsg);
        Assert.assertNotNull(inMsg.Session);
        Assert.assertTrue(inMsg instanceof SessionResponseMessage);

        UUID sessionKey = BitWorks.convertByteArrayToUUID(inMsg.Session);
View Full Code Here

        scriptMessage.metaSetInSession(true);
        scriptMessage.metaSetTransaction(true);
        scriptMessage.setRequestAsUUID(UUID.randomUUID());
        scriptMessage.Session = BitWorks.convertUUIDToByteArray(sessionKey);

        inMsg = client.execute(scriptMessage);
        Assert.assertTrue(inMsg instanceof ScriptResponseMessage);
        Assert.assertTrue(((ScriptResponseMessage) inMsg).Results.get() != null);

    }
View Full Code Here

            scriptMessage.metaSetGraphObjName("graph");
            scriptMessage.metaSetTransaction(true);
            scriptMessage.setRequestAsUUID(UUID.randomUUID());
            scriptMessage.Session = null;

            RexProMessage inMsg = client.execute(scriptMessage);
            Assert.assertTrue(inMsg instanceof ScriptResponseMessage);
            Assert.assertTrue(((ScriptResponseMessage) inMsg).Results.get() != null);
        }
    }
View Full Code Here

    public void shouldOpenAndCloseLotsOfClients() throws Exception {
        final int numberOfClientsToOpen = 100;
        for (int ix = 0; ix < numberOfClientsToOpen; ix++) {
            final RexsterClient client = getClient();
            // have to send a script to open a connection
            assertEquals(2l, client.execute("1+1").get(0));
            client.close();
        }
    }

    @Test
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.