use of com.google.common.eventbus.Subscribe in project buck by facebook.
the class SuperConsoleEventBusListener method testRunFinished.
@Subscribe
public void testRunFinished(TestRunEvent.Finished finished) {
boolean set = testRunFinished.compareAndSet(null, finished);
Preconditions.checkState(set, "Test run should not finish after test run already finished");
ImmutableList.Builder<String> builder = ImmutableList.builder();
for (TestResults results : finished.getResults()) {
testFormatter.reportResult(builder, results);
}
ImmutableList<TestStatusMessage> testStatusMessages;
synchronized (testStatusMessageBuilder) {
testStatusMessages = testStatusMessageBuilder.build();
}
testFormatter.runComplete(builder, finished.getResults(), testStatusMessages);
String testOutput;
synchronized (testReportBuilder) {
testReportBuilder.addAll(builder.build());
testOutput = Joiner.on('\n').join(testReportBuilder.build());
}
// We're about to write to stdout, so make sure we render the final frame before we do.
render();
synchronized (console.getStdOut()) {
console.getStdOut().println(testOutput);
}
}
use of com.google.common.eventbus.Subscribe in project buck by facebook.
the class JavaUtilsLoggingBuildListener method buildStarted.
@Subscribe
public void buildStarted(BuildEvent.Started started) {
LogRecord record = new LogRecord(LEVEL, "Build started");
record.setMillis(started.getTimestamp());
LOG.log(record);
}
use of com.google.common.eventbus.Subscribe in project buck by facebook.
the class JavaUtilsLoggingBuildListener method ruleStarted.
@Subscribe
public void ruleStarted(BuildRuleEvent.Started started) {
LogRecord record = new LogRecord(LEVEL, started.toString());
record.setMillis(started.getTimestamp());
LOG.log(record);
}
use of com.google.common.eventbus.Subscribe in project buck by facebook.
the class JavaUtilsLoggingBuildListener method ruleFinished.
@Subscribe
public void ruleFinished(BuildRuleEvent.Finished finished) {
LogRecord record = new LogRecord(LEVEL, finished.toLogMessage());
record.setMillis(finished.getTimestamp());
LOG.log(record);
}
use of com.google.common.eventbus.Subscribe in project buck by facebook.
the class JavaUtilsLoggingBuildListener method ruleSuspended.
@Subscribe
public void ruleSuspended(BuildRuleEvent.Suspended suspended) {
LogRecord record = new LogRecord(LEVEL, suspended.toString());
record.setMillis(suspended.getTimestamp());
LOG.log(record);
}
Aggregations