Package com.tinkerpop.rexster.client

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


    public void executeForTextWithBreaks() throws Exception {
        final RexsterClient client = getClient();

        // note that you have to escape the \r\n for it to be understood as a property value else the script engine
        // assumes it is line breaks in the script itself.
        final List<String> text = client.execute("g=new TinkerGraph();g.addVertex(['text':'''test1\\r\\ntest2\\r\\ntest3''']);g.v(0).text");

        assertEquals(1, text.size());
        assertEquals("test1\r\ntest2\r\ntest3", text.get(0));

    }
View Full Code Here


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

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

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

        final SessionRequestMessage deathMsg = new SessionRequestMessage();
        deathMsg.Session = BitWorks.convertUUIDToByteArray(sessionKey);
        deathMsg.setRequestAsUUID(UUID.randomUUID());
        deathMsg.metaSetKillSession(true);

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

        //try to use the killed session
        final ScriptRequestMessage scriptMessage = new ScriptRequestMessage();
View Full Code Here

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

        inMsg = client.execute(scriptMessage);
        Assert.assertTrue(inMsg instanceof ErrorResponseMessage);
        Assert.assertEquals(((ErrorResponseMessage) inMsg).metaGetFlag(), ErrorResponseMessage.INVALID_SESSION_ERROR);
    }

    /**
 
View Full Code Here

            final SessionRequestMessage outMsg = new SessionRequestMessage();
            outMsg.setRequestAsUUID(UUID.randomUUID());
            outMsg.metaSetGraphName(entry.getKey());
            outMsg.metaSetGraphObjName("graph");

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

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

            scriptMessage.LanguageName = "groovy";
            scriptMessage.metaSetInSession(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

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

        RexProMessage inMsg = client.execute(outMsg);
        Assert.assertNotNull(inMsg.Session);
        Assert.assertTrue(inMsg instanceof ErrorResponseMessage);
        Assert.assertEquals(((ErrorResponseMessage) inMsg).metaGetFlag(), ErrorResponseMessage.GRAPH_CONFIG_ERROR);

    }
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.