use of com.fasterxml.jackson.databind.ObjectReader in project drill by apache.
the class TestParsePhysicalPlan method parseSimplePlan.
@Test
public void parseSimplePlan() throws Exception {
DrillConfig c = DrillConfig.create();
ScanResult scanResult = ClassPathScanner.fromPrescan(c);
LogicalPlanPersistence lpp = new LogicalPlanPersistence(c, scanResult);
PhysicalPlanReader reader = new PhysicalPlanReader(c, scanResult, lpp, CoordinationProtos.DrillbitEndpoint.getDefaultInstance(), null);
ObjectReader r = lpp.getMapper().reader(PhysicalPlan.class);
ObjectWriter writer = lpp.getMapper().writer();
PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/physical_test1.json"), Charsets.UTF_8));
String unparse = plan.unparse(writer);
// System.out.println(unparse);
}
use of com.fasterxml.jackson.databind.ObjectReader in project logging-log4j2 by apache.
the class LevelMixInTest method testContainer.
@Test
public void testContainer() throws IOException {
final Fixture expected = new Fixture();
final String str = writer.writeValueAsString(expected);
Assert.assertTrue(str.contains("DEBUG"));
final ObjectReader fixtureReader = log4jObjectMapper.readerFor(Fixture.class);
final Fixture actual = fixtureReader.readValue(str);
Assert.assertEquals(expected, actual);
}
Aggregations