Search in sources :

Example 66 with ObjectMapper

use of com.fasterxml.jackson.databind.ObjectMapper in project camel by apache.

the class CamelCatalogJsonSchemaTest method testValidateJsonModels.

@Test
public void testValidateJsonModels() throws Exception {
    for (String name : catalog.findModelNames()) {
        String json = catalog.modelJSonSchema(name);
        // validate we can parse the json
        ObjectMapper mapper = new ObjectMapper();
        JsonNode tree = mapper.readTree(json);
        assertNotNull(tree);
        assertTrue(name, tree.has("model"));
        assertTrue(name, tree.has("properties"));
    }
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 67 with ObjectMapper

use of com.fasterxml.jackson.databind.ObjectMapper in project camel by apache.

the class CamelCatalogTest method testAddComponent.

@Test
public void testAddComponent() throws Exception {
    catalog.addComponent("dummy", "org.foo.camel.DummyComponent");
    assertTrue(catalog.findComponentNames().contains("dummy"));
    String json = catalog.componentJSonSchema("dummy");
    assertNotNull(json);
    // validate we can parse the json
    ObjectMapper mapper = new ObjectMapper();
    JsonNode tree = mapper.readTree(json);
    assertNotNull(tree);
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 68 with ObjectMapper

use of com.fasterxml.jackson.databind.ObjectMapper in project camel by apache.

the class CamelCatalogTest method testListComponentsAsJson.

@Test
public void testListComponentsAsJson() throws Exception {
    String json = catalog.listComponentsAsJson();
    assertNotNull(json);
    // validate we can parse the json
    ObjectMapper mapper = new ObjectMapper();
    JsonNode tree = mapper.readTree(json);
    assertNotNull(tree);
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 69 with ObjectMapper

use of com.fasterxml.jackson.databind.ObjectMapper in project camel by apache.

the class CamelCatalogTest method testSummaryAsJson.

@Test
public void testSummaryAsJson() throws Exception {
    String json = catalog.summaryAsJson();
    assertNotNull(json);
    // validate we can parse the json
    ObjectMapper mapper = new ObjectMapper();
    JsonNode tree = mapper.readTree(json);
    assertNotNull(tree);
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 70 with ObjectMapper

use of com.fasterxml.jackson.databind.ObjectMapper in project camel by apache.

the class CamelCatalogTest method testListLanguagesAsJson.

@Test
public void testListLanguagesAsJson() throws Exception {
    String json = catalog.listLanguagesAsJson();
    assertNotNull(json);
    // validate we can parse the json
    ObjectMapper mapper = new ObjectMapper();
    JsonNode tree = mapper.readTree(json);
    assertNotNull(tree);
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1706 Test (org.junit.Test)641 JsonNode (com.fasterxml.jackson.databind.JsonNode)270 IOException (java.io.IOException)238 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)183 DefaultObjectMapper (io.druid.jackson.DefaultObjectMapper)127 Map (java.util.Map)124 HashMap (java.util.HashMap)119 ArrayList (java.util.ArrayList)81 File (java.io.File)72 InputStream (java.io.InputStream)65 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)55 JCodeModel (com.sun.codemodel.JCodeModel)52 List (java.util.List)49 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)47 JPackage (com.sun.codemodel.JPackage)44 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)41 JsonException (jmri.server.json.JsonException)41 JType (com.sun.codemodel.JType)38 Test (org.testng.annotations.Test)37