Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONObject.optJSONArray()


                Assert.assertEquals(ClientResponse.Status.OK, indexGetResponse.getClientResponseStatus());

                JSONObject result = indexGetResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(result);

                JSONArray results = result.optJSONArray("results");
                Assert.assertNotNull(results);
                Assert.assertEquals(1, results.length());

                JSONObject marko = results.optJSONObject(0);
                Assert.assertEquals(mappedId, marko.optString("_id"));
View Full Code Here


                Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

                JSONObject vertexJson = graphResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(vertexJson);

                Assert.assertEquals(6, vertexJson.optJSONArray(Tokens.RESULTS).length());
            }
        }
    }

    @Test
View Full Code Here

                Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

                JSONObject vertexJson = graphResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(vertexJson);

                Assert.assertEquals(1, vertexJson.optJSONArray(Tokens.RESULTS).length());
            }
        }
    }

    @Test
View Full Code Here

                Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

                JSONObject vertexJson = graphResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(vertexJson);

                JSONArray results = vertexJson.optJSONArray(Tokens.RESULTS);
                Assert.assertEquals(2, results.length());

                uniqueIds.add(results.optJSONObject(0).optString(Tokens._ID));

                Assert.assertFalse(uniqueIds.contains(results.optJSONObject(1).optString(Tokens._ID)));
View Full Code Here

                Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

                vertexJson = graphResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(vertexJson);

                results = vertexJson.optJSONArray(Tokens.RESULTS);
                Assert.assertEquals(2, results.length());

                Assert.assertFalse(uniqueIds.contains(results.optJSONObject(1).optString(Tokens._ID)));
                uniqueIds.add(results.optJSONObject(0).optString(Tokens._ID));
View Full Code Here

                Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

                vertexJson = graphResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(vertexJson);

                results = vertexJson.optJSONArray(Tokens.RESULTS);
                Assert.assertEquals(2, results.length());

                Assert.assertFalse(uniqueIds.contains(results.optJSONObject(1).optString(Tokens._ID)));
                uniqueIds.add(results.optJSONObject(0).optString(Tokens._ID));
View Full Code Here

                Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

                vertexJson = graphResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(vertexJson);

                results = vertexJson.optJSONArray(Tokens.RESULTS);
                Assert.assertEquals(2, results.length());

                Assert.assertEquals(uniqueIds.get(4), results.optJSONObject(0).optString(Tokens._ID));
                Assert.assertEquals(uniqueIds.get(5), results.optJSONObject(1).optString(Tokens._ID));
View Full Code Here

                Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

                vertexJson = graphResponse.getEntity(JSONObject.class);
                Assert.assertNotNull(vertexJson);

                results = vertexJson.optJSONArray(Tokens.RESULTS);
                Assert.assertEquals(2, results.length());

                Assert.assertEquals(uniqueIds.get(0), results.optJSONObject(0).optString(Tokens._ID));
                Assert.assertEquals(uniqueIds.get(1), results.optJSONObject(1).optString(Tokens._ID));
            }
View Full Code Here

            Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

            JSONObject json = graphResponse.getEntity(JSONObject.class);
            Assert.assertNotNull(json);

            Assert.assertEquals(3, json.optJSONArray(Tokens.RESULTS).length());

            // get out edges
            graphResponse = doGraphGet(testGraph, "vertices/" + encode(id) + "/outE");
            Assert.assertEquals(Tokens.VERTEX, json.optJSONArray(Tokens.RESULTS).optJSONObject(0).optString(Tokens._TYPE));
View Full Code Here

            Assert.assertEquals(3, json.optJSONArray(Tokens.RESULTS).length());

            // get out edges
            graphResponse = doGraphGet(testGraph, "vertices/" + encode(id) + "/outE");
            Assert.assertEquals(Tokens.VERTEX, json.optJSONArray(Tokens.RESULTS).optJSONObject(0).optString(Tokens._TYPE));

            Assert.assertNotNull(graphResponse);
            Assert.assertEquals(ClientResponse.Status.OK, graphResponse.getClientResponseStatus());

            json = graphResponse.getEntity(JSONObject.class);
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.