com.applitools.eyes.visualgridclient.model.TestResultSummary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eyes-common-java3 Show documentation
Show all versions of eyes-common-java3 Show documentation
Common code for Applitools Eyes Java SDK projects
package com.applitools.eyes.visualgridclient.model;
import com.applitools.eyes.TestResults;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
public class TestResultSummary {
private List allResults;
private int passed = 0;
private int unresolved = 0;
private int failed = 0;
private int exceptions = 0;
private int mismatches = 0;
private int missing = 0;
private int matches = 0;
public TestResultSummary(List allResults) {
this.allResults = allResults;
for (TestResultContainer resultContainer : allResults) {
if (resultContainer.getException() != null){
this.exceptions++;
}
TestResults result = resultContainer.getTestResults();
if (result == null) continue;
if (result.getStatus() != null) {
switch (result.getStatus()) {
case Failed:
this.failed++;
break;
case Passed:
this.passed++;
break;
case Unresolved:
this.unresolved++;
break;
}
}
matches += result.getMatches();
missing += result.getMissing();
mismatches += result.getMismatches();
}
}
public TestResultContainer[] getAllResults() {
return allResults.toArray(new TestResultContainer[0]);
}
@Override
public String toString() {
return "result summary {" +
"\n\tall results=\n\t\t" + StringUtils.join(allResults,"\n\t\t") +
"\n\tpassed=" + passed +
"\n\tunresolved=" + unresolved +
"\n\tfailed=" + failed +
"\n\texceptions=" + exceptions +
"\n\tmismatches=" + mismatches +
"\n\tmissing=" + missing +
"\n\tmatches=" + matches +
"\n}";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy