use of com.facebook.buck.util.autosparse.AutoSparseStateEvents in project buck by facebook.
the class MachineReadableLogJsonViewTest method testAutosparseEvents.
@Test
public void testAutosparseEvents() throws Exception {
AutoSparseStateEvents.SparseRefreshStarted startEvent = new AutoSparseStateEvents.SparseRefreshStarted();
AutoSparseStateEvents finishedEvent = new AutoSparseStateEvents.SparseRefreshFinished(startEvent);
AutoSparseStateEvents failedEvent = new AutoSparseStateEvents.SparseRefreshFailed(startEvent, "output string\n");
startEvent.configure(timestamp, nanoTime, threadUserNanoTime, threadId, buildId);
finishedEvent.configure(timestamp, nanoTime, threadUserNanoTime, threadId, buildId);
failedEvent.configure(timestamp, nanoTime, threadUserNanoTime, threadId, buildId);
assertJsonEquals("{%s}", WRITER.writeValueAsString(startEvent));
assertJsonEquals("{%s}", WRITER.writeValueAsString(finishedEvent));
assertJsonEquals("{%s,\"output\":\"output string\\n\"}", WRITER.writeValueAsString(failedEvent));
}
Aggregations