Skip to content

Commit

Permalink
refactor: update with the new API of test-runner for ChangeDetectorSe…
Browse files Browse the repository at this point in the history
…lector
  • Loading branch information
danglotb committed Oct 4, 2021
1 parent 3e7b5a1 commit 551f6cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import eu.stamp_project.dspot.common.compilation.DSpotCompiler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import spoon.reflect.declaration.CtClass;
import spoon.reflect.declaration.CtMethod;
import spoon.reflect.declaration.CtType;

Expand Down Expand Up @@ -122,7 +123,7 @@ public List<CtMethod<?>> selectToKeep(List<CtMethod<?>> amplifiedTestToBeKept) {
results.getFailingTests()
.forEach(failure -> {
final CtMethod<?> key = amplifiedTestToBeKept.stream()
.filter(ctMethod -> ctMethod.getSimpleName().equals(failure.testCaseName))
.filter(ctMethod -> (ctMethod.getParent(CtClass.class).getQualifiedName() + "#" + ctMethod.getSimpleName()).equals(failure.testCaseName))
.findFirst()
.get();
amplifiedThatWillBeKept.add(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ protected CtMethod<?> getAmplifiedTest() {
@Override
protected String getContentReportFile() {
return "1 amplified test fails on the new versions." + AmplificationHelper.LINE_SEPARATOR +
"test2(example.TestSuiteExample): String index out of range: -1java.lang.StringIndexOutOfBoundsException: String index out of range: -1" + AmplificationHelper.LINE_SEPARATOR;}
"example.TestSuiteExample#test2(example.TestSuiteExample): String index out of range: -1java.lang.StringIndexOutOfBoundsException: String index out of range: -1" + AmplificationHelper.LINE_SEPARATOR;}
}

0 comments on commit 551f6cb

Please sign in to comment.