Package com.tinkerpop.rexster.extension

Examples of com.tinkerpop.rexster.extension.ExtensionResponse


        final UriInfo uri = mockTheUri(true, "person");

        // can do a slimmed down RexsterResourceContext
        this.ctx = new RexsterResourceContext(this.rag, uri, null, null, null, null, null, null);

        ExtensionResponse extResp = this.framesExtension.doFramesWorkOnVertex(this.ctx, this.graph, this.graph.getVertex(1));

        Assert.assertNotNull(extResp);
        Assert.assertNotNull(extResp.getJerseyResponse());

        Response response = extResp.getJerseyResponse();
        Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());

        JSONObject jsonObject = (JSONObject) response.getEntity();
        Assert.assertNotNull(jsonObject);
        Assert.assertTrue(jsonObject.has("name"));
View Full Code Here


        final UriInfo uri = mockTheUri(false, "");

        // can do a slimmed down RexsterResourceContext
        this.ctx = new RexsterResourceContext(this.rag, uri, null, null, null, null, null, null);

        ExtensionResponse extResp = this.framesExtension.doFramesWorkOnEdge(this.ctx, this.graph, this.graph.getEdge(11), "in");

        Assert.assertNotNull(extResp);
        Assert.assertNotNull(extResp.getJerseyResponse());

        Response response = extResp.getJerseyResponse();
        Assert.assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatus());

        JSONObject jsonObject = (JSONObject) response.getEntity();
        Assert.assertNotNull(jsonObject);
        Assert.assertTrue(jsonObject.has("success"));
View Full Code Here

        final UriInfo uri = mockTheUri(true, "not-a-frame-in-config");

        // can do a slimmed down RexsterResourceContext
        this.ctx = new RexsterResourceContext(this.rag, uri, null, null, null, null, null, null);

        ExtensionResponse extResp = this.framesExtension.doFramesWorkOnEdge(this.ctx, this.graph, this.graph.getEdge(11), "in");

        Assert.assertNotNull(extResp);
        Assert.assertNotNull(extResp.getJerseyResponse());

        Response response = extResp.getJerseyResponse();
        Assert.assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatus());

        JSONObject jsonObject = (JSONObject) response.getEntity();
        Assert.assertNotNull(jsonObject);
        Assert.assertTrue(jsonObject.has("success"));
View Full Code Here

        final UriInfo uri = mockTheUri(true, "notreal");

        // can do a slimmed down RexsterResourceContext
        this.ctx = new RexsterResourceContext(this.rag, uri, null, null, null, null, null, null);

        ExtensionResponse extResp = this.framesExtension.doFramesWorkOnEdge(this.ctx, this.graph, this.graph.getEdge(11), "in");

        Assert.assertNotNull(extResp);
        Assert.assertNotNull(extResp.getJerseyResponse());

        Response response = extResp.getJerseyResponse();
        Assert.assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatus());

        JSONObject jsonObject = (JSONObject) response.getEntity();
        Assert.assertNotNull(jsonObject);
        Assert.assertTrue(jsonObject.has("success"));
View Full Code Here

        JSONObject requestObject = new JSONObject();

        this.ctx = new RexsterResourceContext(null, null, null, requestObject, null, null, null, null);

        ExtensionResponse response = batchExtension.getVertices(this.ctx, graph);

        Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getJerseyResponse().getStatus());

    }
View Full Code Here

        final UriInfo uri = mockTheUri(true, "created");

        // can do a slimmed down RexsterResourceContext
        this.ctx = new RexsterResourceContext(this.rag, uri, null, null, null, null, null, null);

        ExtensionResponse extResp = this.framesExtension.doFramesWorkOnEdge(this.ctx, this.graph, this.graph.getEdge(11), "in");

        Assert.assertNotNull(extResp);
        Assert.assertNotNull(extResp.getJerseyResponse());

        Response response = extResp.getJerseyResponse();
        Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());

        JSONObject jsonObject = (JSONObject) response.getEntity();
        Assert.assertNotNull(jsonObject);
        Assert.assertTrue(jsonObject.has("weight"));
View Full Code Here

        values.put(100000);
        requestObject.put("values", values);

        this.ctx = new RexsterResourceContext(null, null, null, requestObject, null, null, null, null);

        ExtensionResponse response = batchExtension.getVertices(this.ctx, graph);

        Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getJerseyResponse().getStatus());
        JSONObject entity = (JSONObject) response.getJerseyResponse().getEntity();

        Assert.assertNotNull(entity);
        Assert.assertTrue(entity.has(Tokens.RESULTS));

        JSONArray results = entity.optJSONArray(Tokens.RESULTS);
View Full Code Here

        final UriInfo uri = mockTheUri(true, "created");

        // can do a slimmed down RexsterResourceContext
        this.ctx = new RexsterResourceContext(this.rag, uri, null, null, null, null, null, null);

        ExtensionResponse extResp = this.framesExtension.doFramesWorkOnEdge(this.ctx, this.graph, this.graph.getEdge(11), null);

        Assert.assertNotNull(extResp);
        Assert.assertNotNull(extResp.getJerseyResponse());

        Response response = extResp.getJerseyResponse();
        Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());

        JSONObject jsonObject = (JSONObject) response.getEntity();
        Assert.assertNotNull(jsonObject);
        Assert.assertTrue(jsonObject.has("weight"));
View Full Code Here

        this.graph = TinkerGraphFactory.createTinkerGraph();
    }

    @Test
    public void doSomeWorkOnGraphValid() {
        ExtensionResponse response = this.simplePathExtension.doSomeWorkOnGraph(this.graph);

        doTests(response, "tinkergraph[vertices:6 edges:6]", "some");
    }
View Full Code Here

        doTests(response, "tinkergraph[vertices:6 edges:6]", "some");
    }

    @Test
    public void doWorkOnEdgeValid() {
        ExtensionResponse response = this.simplePathExtension.doOtherWorkOnGraph(this.graph);

        doTests(response, "tinkergraph[vertices:6 edges:6]", "other");
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.rexster.extension.ExtensionResponse

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.