Search in sources :

Example 1 with StringPrintStream

use of ch.hsr.ifs.iltis.core.data.StringPrintStream in project ch.hsr.ifs.cdttesting by IFS-HSR.

the class NodeComparisonVisitor method compare.

public ComparisonResult compare() {
    leftCollector.schedule();
    rightCollector.schedule();
    ComparisonResult result;
    try {
        result = compareNodes();
        leftCollector.join();
        rightCollector.join();
        if (result.isUnequal()) {
            return result;
        } else if (compareComments) {
            return commentsEqual();
        } else {
            return new ComparisonResult(ComparisonState.EQUAL);
        }
    } catch (InterruptedException e) {
        StringPrintStream stream = StringPrintStream.createNew();
        e.printStackTrace();
        e.printStackTrace(stream);
        return new ComparisonResult(ComparisonState.INTERRUPTED, new ComparisonAttribute(ComparisonAttrID.ACTUAL, e.getClass().getSimpleName(), stream.toString()));
    }
}
Also used : ComparisonAttribute(ch.hsr.ifs.cdttesting.cdttest.comparison.ASTComparison.ComparisonAttribute) StringPrintStream(ch.hsr.ifs.iltis.core.data.StringPrintStream) ComparisonResult(ch.hsr.ifs.cdttesting.cdttest.comparison.ASTComparison.ComparisonResult)

Aggregations

ComparisonAttribute (ch.hsr.ifs.cdttesting.cdttest.comparison.ASTComparison.ComparisonAttribute)1 ComparisonResult (ch.hsr.ifs.cdttesting.cdttest.comparison.ASTComparison.ComparisonResult)1 StringPrintStream (ch.hsr.ifs.iltis.core.data.StringPrintStream)1