Examples of ExtensionResponse


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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

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

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

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

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

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

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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

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

        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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

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

        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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

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

        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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

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

        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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

        JSONObject requestObject = new JSONObject();

        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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

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

        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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

    private ParametersExtension parametersExtension = new ParametersExtension();

    @Test
    public void evaluateSomeStringValid() {
        String replyToSend = "somestring";
        ExtensionResponse response = parametersExtension.evaluateSomeString(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

Examples of com.tinkerpop.rexster.extension.ExtensionResponse

    }

    @Test
    public void evaluateSomeIntegerValid() {
        Integer replyToSend = 100;
        ExtensionResponse response = parametersExtension.evaluateSomeInteger(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
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.