ConvertResult testPhaseResult = convert(originalFileData, testConverters, testData);
Data[][] allDataFromTestPhase = testPhaseResult.getAllData();
if (!testPhaseResult.succeeded()) {
FilePassFailure failure = createFailResult(
originalFileData,
PassPhase.TEST_CONV_PHASE,
testPhaseResult.getFailInfo(),
allDataFromTestPhase,
null,
null);
testResults.add(failure);
continue;
}
Data[] resultFileData = testPhaseResult.getResult();
// comparison conversion (for original file) phase
ConvertResult comparePhaseOrigResult = convert(originalFileData,
comparisonConverters, testData);
Data[][] allDataFromOrigComparePhase = comparePhaseOrigResult.getAllData();
if (!comparePhaseOrigResult.succeeded()) {
FilePassFailure failure = createFailResult(originalFileData,
PassPhase.COMPARE_CONV_ORIG_PHASE,
comparePhaseOrigResult.getFailInfo(),
allDataFromTestPhase,
allDataFromOrigComparePhase,
null);
testResults.add(failure);
continue;
}
Data[] originalInMemory = comparePhaseOrigResult.getResult();
//comparison conversion (for result file) phase
ConvertResult comparePhaseResultResult = convert(resultFileData,
comparisonConverters, testData);
Data[][] allDataFromResultComparePhase = comparePhaseResultResult.getAllData();
if (!comparePhaseResultResult.succeeded()) {
FilePassFailure failure = createFailResult(originalFileData,
PassPhase.COMPARE_CONV_RESULT_PHASE,
comparePhaseResultResult.getFailInfo(),
allDataFromTestPhase,
allDataFromOrigComparePhase,
allDataFromResultComparePhase);
testResults.add(failure);
continue;
}
Data[] resultInMemory = comparePhaseResultResult.getResult();
// graph comparison phase
Graph resultGraph = (Graph) originalInMemory[0].getData();
Graph origGraph = (Graph) resultInMemory[0].getData();
NewGraphComparer comparer = testData.getComparer();
ComparisonResult graphComparisonPhaseResult = comparer.compare(
origGraph, resultGraph);
if (!graphComparisonPhaseResult.comparisonSucceeded()) {
String explanation =
graphComparisonPhaseResult.getLog();
FilePassFailure failure = createFailResult(originalFileData,
explanation, PassPhase.GRAPH_COMPARE_PHASE,
null,
allDataFromTestPhase,
allDataFromOrigComparePhase,
allDataFromResultComparePhase);