}
if(result == null) {
LOGGER.error("Unable to determine tests for " + core.toString());
return null;
}
TestMatrixVersion tmv = new TestMatrixVersion();
final Map<String, TestDefinition> testDefinitions = Maps.newLinkedHashMap();
start = System.currentTimeMillis();
for (final TestVersionResult.Test testDefFile : result.getTests()) {
final long startForTest = System.currentTimeMillis();
final TestDefinition testDefinition = getTestDefinition(testDefFile.getTestName(), testDefFile.getRevision());
if(LOGGER.isTraceEnabled()) {
final long elapsed = System.currentTimeMillis() - startForTest;
LOGGER.debug(String.format("Took %d ms to load %s (r%s) %s", elapsed, testDefFile.getTestName(), testDefFile.getRevision(), testDefinition == null ? "unsuccessfully" : "successfully"));
}
if(testDefinition == null) {
LOGGER.info("Returning null TestMatrix because " + testDefFile.getTestName() + " returned null test-definition.");
return null;
}
testDefinitions.put(testDefFile.getTestName(), testDefinition);
}
if(LOGGER.isDebugEnabled()) {
final long elapsed = System.currentTimeMillis() - start;
LOGGER.debug(String.format("Took %d ms to load all %d tests", elapsed, testDefinitions.size()));
}
final TestMatrixDefinition tmd = new TestMatrixDefinition();
tmd.setTests(testDefinitions);
tmv.setTestMatrixDefinition(tmd);
tmv.setPublished(result.getPublished());
tmv.setAuthor(result.getAuthor());
tmv.setVersion(result.getVersion());
tmv.setDescription(result.getDescription());
return tmv;
}