Search in sources :

Example 1 with AutoSparseStateEvents

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));
}
Also used : AutoSparseStateEvents(com.facebook.buck.util.autosparse.AutoSparseStateEvents) Test(org.junit.Test)

Aggregations

AutoSparseStateEvents (com.facebook.buck.util.autosparse.AutoSparseStateEvents)1 Test (org.junit.Test)1