use of com.facebook.buck.event.external.elements.TestResultSummaryExternalInterface in project buck by facebook.
the class BuckEventsHandlerTest method testResultSummaryExternalInterfaceKnowsResultType.
@Test
public void testResultSummaryExternalInterfaceKnowsResultType() throws Exception {
final String json = "{\n" + " \"testCaseName\": \"ok.api.ApiTest\",\n" + " \"type\": \"FAILURE\",\n" + " \"time\": 3348,\n" + " \"message\": null,\n" + " \"stacktrace\": null,\n" + " \"stdOut\": \"sup from test stdout\",\n" + " \"stdErr\": null,\n" + " \"testName\": \"logoutAll\"\n" + "}";
final ObjectMapper objectMapper = BuckEventsHandler.createObjectMapper();
final TestResultSummaryExternalInterface res = objectMapper.readValue(json, TestResultSummaryExternalInterface.class);
// because it is @JsonIgnore'd
assertFalse(res.isSuccess());
assertEquals(ResultType.FAILURE, res.getType());
}
use of com.facebook.buck.event.external.elements.TestResultSummaryExternalInterface in project buck by facebook.
the class BuckEventsHandlerTest method testResultsSummaryKnowsResultType.
@Test
public void testResultsSummaryKnowsResultType() throws Exception {
final String json = "{\n" + " \"testCaseName\": \"ok.api.ApiTest\",\n" + " \"type\": \"SUCCESS\",\n" + " \"time\": 3348,\n" + " \"message\": null,\n" + " \"stacktrace\": null,\n" + " \"stdOut\": \"sup from test stdout\",\n" + " \"stdErr\": null,\n" + " \"testName\": \"logoutAll\"\n" + "}";
final ObjectMapper objectMapper = BuckEventsHandler.createObjectMapper();
final TestResultSummaryExternalInterface res = objectMapper.readValue(json, TestResultsSummary.class);
// because it is @JsonIgnore'd
assertFalse(res.isSuccess());
assertEquals(ResultType.SUCCESS, res.getType());
}
Aggregations