private List<TestCaseResult> getTestCaseResults(List<TestResult> testResults, Statement gzoltarStatement) { List<TestCaseResult> tcresults = new ArrayList<>(); BitSet coverage = gzoltarStatement.getCoverage(); int nextTest = coverage.nextSetBit(0); while (nextTest != -1) { TestResult testResult = testResults.get(nextTest); if (!ConfigurationProperties.getPropertyBool("savecoverbyfailtests") || !testResult.wasSuccessful()) { TestCaseResult tcri = new TestCaseResult(testResult.getName(), testResult.wasSuccessful()); tcresults.add(tcri); } nextTest = coverage.nextSetBit(nextTest + 1); } return tcresults; }
if (!testResult.wasSuccessful()) { output += testResult.getName() + "\n"; output += testResult.getTrace() + "\n";
@Override public Map<SourceLocation, List<fr.inria.lille.localization.TestResult>> getTestListPerStatement() { Map<SourceLocation, List<fr.inria.lille.localization.TestResult>> results = new HashMap<>(); List<TestResult> testResults = this.getTestResults(); for (int j = 0; j < testResults.size(); j++) { TestResult testResult = testResults.get(j); TestResultImpl test = new TestResultImpl(TestCase.from(testResult.getName()), testResult.wasSuccessful()); List<ComponentCount> components = testResult.getCoveredComponents(); for (int i = 0; i < components.size(); i++) { ComponentCount component1 = components.get(i); Statement component = (Statement) component1.getComponent(); String containingClass = component.getMethod().getParent().getLabel(); SourceLocation sourceLocation = new SourceLocation(containingClass, component.getLineNumber()); if (!results.containsKey(sourceLocation)) { results.put(sourceLocation, new ArrayList<fr.inria.lille.localization.TestResult>()); } results.get(sourceLocation).add(test); } } LinkedHashMap<SourceLocation, List<fr.inria.lille.localization.TestResult>> map = new LinkedHashMap<>(); for (StatementSourceLocation source : this.statements) { map.put(source.getLocation(), results.get(source.getLocation())); } results = map; return results; }
for (int i = testResults.size() - 1; i >= 0; i--) { TestResult testResult = testResults.get(i); if (!testResult.wasSuccessful()) { nbFailingTest++; while (nextTest != -1) { TestResult testResult = testResults.get(nextTest); if (testResult.wasSuccessful()) { executedAndPassedCount++; } else {
int[] sum = new int[2]; for (TestResult tr : gz.getTestResults()) { String testName = tr.getName().split("#")[0]; if (testName.startsWith("junit")) { continue; sum[1] += tr.wasSuccessful() ? 0 : 1; if (!tr.wasSuccessful()) { logger.info("Test failt: " + tr.getName());