Package com.tinkerpop.rexster.extension

Examples of com.tinkerpop.rexster.extension.ExtensionResponse


        requestObject.put("values", values);
        requestObject.put("type", "id");

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

        ExtensionResponse response = batchExtension.getEdges(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


            put(1);
            put(2);
            put(3);
        }};

        ExtensionResponse response = parametersExtension.evaluateSomeList(null, null, replyToSend);

        // the response should never be null
        Assert.assertNotNull(response);

        // the ExtensionResponse really just wraps an underlying jersey response and that
        // should not be null
        Response jerseyResponse = response.getJerseyResponse();
        Assert.assertNotNull(jerseyResponse);

        // the services return an OK status code.
        Assert.assertEquals(Response.Status.OK.getStatusCode(), jerseyResponse.getStatus());
View Full Code Here

    @Test
    public void evaluateSomeListRawValid() {
        String replyToSend = "[1,2,3,4]";

        ExtensionResponse response = parametersExtension.evaluateSomeListRaw(null, null, replyToSend);

        // the response should never be null
        Assert.assertNotNull(response);

        // the ExtensionResponse really just wraps an underlying jersey response and that
        // should not be null
        Response jerseyResponse = response.getJerseyResponse();
        Assert.assertNotNull(jerseyResponse);

        // the services return an OK status code.
        Assert.assertEquals(Response.Status.OK.getStatusCode(), jerseyResponse.getStatus());
View Full Code Here

        } catch (Exception ex) {
            Assert.fail();
        }

        ExtensionResponse response = parametersExtension.evaluateSomeObject(null, null, 100, jsonObject, jsonArray);

        // the response should never be null
        Assert.assertNotNull(response);

        // the ExtensionResponse really just wraps an underlying jersey response and that
        // should not be null
        Response jerseyResponse = response.getJerseyResponse();
        Assert.assertNotNull(jerseyResponse);

        // the services return an OK status code.
        Assert.assertEquals(Response.Status.OK.getStatusCode(), jerseyResponse.getStatus());
View Full Code Here

        requestObject.put("values", values);
        requestObject.put("type", "index");

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

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

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

    }
View Full Code Here

        requestObject.put("type", "index");
        requestObject.put("key", "weight");

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

        ExtensionResponse response = batchExtension.getEdges(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

        requestObject.put("values", values);
        requestObject.put("type", "keyindex");

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

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

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

    }
View Full Code Here

        requestObject.put("type", "keyindex");
        requestObject.put("key", "weight");

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

        ExtensionResponse response = batchExtension.getEdges(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

        RexsterApplicationGraph rag = new RexsterApplicationGraph("graph", this.graph);

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

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

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

        Assert.assertNotNull(entity);
        Assert.assertTrue(entity.has("txProcessed"));

        Assert.assertEquals(6, entity.optInt("txProcessed"));
View Full Code Here

    }

    @Test
    public void doVertexToXml() {
        Vertex v = this.graph.getVertex(1);
        ExtensionResponse extensionResponse = this.extension.doVertexToXml(v);

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

        String xml = (String) response.getEntity();
        Assert.assertEquals("<vertex><id>1</id></vertex>", xml);
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.