use of com.dexels.navajo.article.test.TestRuntimeImpl in project navajo by Dexels.
the class TestRuntime method testVerjaardag.
@Test
public void testVerjaardag() throws IOException, NoJSONOutputException, APIException {
File art = context.resolveArticle("/verjaardagen");
TestRuntimeImpl tr = new TestRuntimeImpl("verjaardagen", art, null);
context.interpretArticle(art, tr);
String out = tr.getOutput();
System.err.println(out);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readValue(out, JsonNode.class);
ObjectWriter writer = mapper.writer().withDefaultPrettyPrinter();
System.out.println(writer.writeValueAsString(rootNode));
Assert.assertEquals(11, rootNode.size());
}
use of com.dexels.navajo.article.test.TestRuntimeImpl in project navajo by Dexels.
the class TestRuntime method testSearchClub.
@Test
public void testSearchClub() throws IOException, NoJSONOutputException, APIException {
// this test is a bit outdated
File art = context.resolveArticle("/searchclub");
TestRuntimeImpl tr = new TestRuntimeImpl("searchclub", art, null);
context.interpretArticle(art, tr);
String out = tr.getOutput();
System.err.println(out);
ObjectMapper mapper = new ObjectMapper();
// (note: can also use more specific type, like ArrayNode or ObjectNode!)
mapper.readValue(out, JsonNode.class);
// Assert.assertEquals(8, rootNode.get("result").get("Club").size());
}
use of com.dexels.navajo.article.test.TestRuntimeImpl in project navajo by Dexels.
the class TestRuntime method testTeams.
@Test
public void testTeams() throws IOException, NoJSONOutputException, APIException {
File art = context.resolveArticle("/teams");
TestRuntimeImpl tr = new TestRuntimeImpl("teams", art, null);
context.interpretArticle(art, tr);
String out = tr.getOutput();
System.err.println(out);
ObjectMapper mapper = new ObjectMapper();
// (note: can also use more specific type, like ArrayNode or ObjectNode!)
JsonNode rootNode = mapper.readValue(out, JsonNode.class);
ObjectWriter writer = mapper.writer().withDefaultPrettyPrinter();
System.out.println(writer.writeValueAsString(rootNode));
// Assert.assertEquals(24, rootNode.get("data").get("verjaardagen").size());
}
Aggregations