Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.path()


                JsonNode data = result.path("data");
                assertTrue(data.path("integer").isIntegralNumber());
                assertTrue(data.path("double").isDouble());
                assertTrue(data.path("text").isTextual());
                assertTrue(data.path("obj").isObject());
                assertTrue(data.path("ary").isArray());
                assertTrue(data.path("no").isNull());
                assertTrue(data.path("date").asText().startsWith(Year.now().toString()));
                assertEquals("custom", data.path("custom").path("val").asText());

            }catch (Exception e){
View Full Code Here


                assertTrue(data.path("integer").isIntegralNumber());
                assertTrue(data.path("double").isDouble());
                assertTrue(data.path("text").isTextual());
                assertTrue(data.path("obj").isObject());
                assertTrue(data.path("ary").isArray());
                assertTrue(data.path("no").isNull());
                assertTrue(data.path("date").asText().startsWith(Year.now().toString()));
                assertEquals("custom", data.path("custom").path("val").asText());

            }catch (Exception e){
                fail(ExceptionUtils.getStackTrace(e));
View Full Code Here

                assertTrue(data.path("double").isDouble());
                assertTrue(data.path("text").isTextual());
                assertTrue(data.path("obj").isObject());
                assertTrue(data.path("ary").isArray());
                assertTrue(data.path("no").isNull());
                assertTrue(data.path("date").asText().startsWith(Year.now().toString()));
                assertEquals("custom", data.path("custom").path("val").asText());

            }catch (Exception e){
                fail(ExceptionUtils.getStackTrace(e));
            }
View Full Code Here

                assertTrue(data.path("text").isTextual());
                assertTrue(data.path("obj").isObject());
                assertTrue(data.path("ary").isArray());
                assertTrue(data.path("no").isNull());
                assertTrue(data.path("date").asText().startsWith(Year.now().toString()));
                assertEquals("custom", data.path("custom").path("val").asText());

            }catch (Exception e){
                fail(ExceptionUtils.getStackTrace(e));
            }
        });
View Full Code Here

                Result res = routeAndCall(req);
                String s = contentAsString(res);
                JsonNode resp =Json.mapper().readTree(s);

                assertEquals(0,resp.path("data").path("val").asInt());

                req = new FakeRequest(POST,"/plugin/"+SCRIPT);
                req = req.withHeader(TestConfig.KEY_APPCODE,TestConfig.VALUE_APPCODE)
                        .withHeader(TestConfig.KEY_AUTH,TestConfig.AUTH_ADMIN_ENC)
                        .withHeader("Content-Type","application/json")
View Full Code Here

                res = routeAndCall(req);
                s = contentAsString(res);
                resp =Json.mapper().readTree(s);

                assertEquals(1,resp.path("data").path("val").asInt());

                req = new FakeRequest(GET,"/plugin/"+SCRIPT);
                req = req.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE)
                        .withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
View Full Code Here

                res = routeAndCall(req);
                s = contentAsString(res);
                resp =Json.mapper().readTree(s);

                assertEquals(1,resp.path("data").path("val").asInt());

                req = new FakeRequest(GET,"/admin/plugin/"+SCRIPT);
                req = req.withHeader(TestConfig.KEY_APPCODE, TestConfig.VALUE_APPCODE)
                        .withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
View Full Code Here

                res = routeAndCall(req);
                s = contentAsString(res);
                resp =Json.mapper().readTree(s);

                assertEquals(1,resp.path("data").path("_storage").path("val").asInt());

            }catch (Exception e){
                fail(ExceptionUtils.getStackTrace(e));
            }
        });
View Full Code Here

            ObjectMapper objectMapper = new ObjectMapper();
            objectMapper.setNodeFactory(new PlaceholderEnabledJsonNodeFactory());
            JsonNode rootNode = objectMapper.readValue(in, JsonNode.class);
            JsonNode outputWritersNode = rootNode.path("outputWriters");
            JsonNode outputWriterNode = outputWritersNode.get(1);
            assertThat(outputWriterNode.path("@class").asText(), is("org.jmxtrans.embedded.output.GraphiteWriter"));
            JsonNode settingsNode = outputWriterNode.path("settings");
            assertThat(settingsNode.path("host").asText(), is("graphite.www.private.mycompany.com"));
            assertThat(settingsNode.path("port").asInt(), is(2003));
            assertThat(settingsNode.path("namePrefix").asText(), is("servers.tomcat1."));
View Full Code Here

            JsonNode rootNode = objectMapper.readValue(in, JsonNode.class);
            JsonNode outputWritersNode = rootNode.path("outputWriters");
            JsonNode outputWriterNode = outputWritersNode.get(1);
            assertThat(outputWriterNode.path("@class").asText(), is("org.jmxtrans.embedded.output.GraphiteWriter"));
            JsonNode settingsNode = outputWriterNode.path("settings");
            assertThat(settingsNode.path("host").asText(), is("graphite.www.private.mycompany.com"));
            assertThat(settingsNode.path("port").asInt(), is(2003));
            assertThat(settingsNode.path("namePrefix").asText(), is("servers.tomcat1."));

        } finally {
            System.getProperties().remove("graphite.host");
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.