final long testStart = System.currentTimeMillis();
int loaded = 0;
while (true) {
StreamMessage message = slaveBrowser.getResponse();
if (message != null) {
final Response response = message.getResponse();
response.setBrowser(slaveBrowser.getBrowserInfo());
switch (response.getResponseType()) {
case TEST_RESULT:
final Collection<TestResult> testResults =
testResultGenerator.getTestResults(response);
boolean failed = false;
for (TestResult result : testResults) {
if (result.getResult() != Result.passed) {
failed = true;
LOGGER.trace("{}: {} {}.{}: \n{}",
new Object[] {runnerId, result.getResult(), result.getTestCaseName(),
result.getTestName(), result.getMessage()});
} else {
LOGGER.trace("{}: passed {}{}",
new Object[] {runnerId, result.getTestCaseName(), result.getTestName()});
}
}
LOGGER.debug("{}: result {} {}s", new Object[] {runnerId, !failed,
((System.currentTimeMillis() - testStart) / 1000)});
break;
case FILE_LOAD_RESULT:
LoadedFiles files =
gson.fromJson(response.getResponse(), response.getGsonType());
for (FileResult result : files.getLoadedFiles()) {
if (result.isSuccess()) {
loaded++;
} else {
LOGGER.debug("{}: failed to load {}",
new Object[] {runnerId, result.getFileSource().getFileSrc()});
}
}
break;
case LOG:
LOGGER.debug("{}: test time {}s {}",
new Object[] {runnerId, ((System.currentTimeMillis() - testStart) / 1000),
response.getResponse()});
break;
}
}
}
}