Skip to content

Commit

Permalink
remove non-working jar test and add toString back in
Browse files Browse the repository at this point in the history
  • Loading branch information
lacinoire committed Oct 20, 2023
1 parent 21a7f11 commit 205d954
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,24 @@ public int hashCode() {
return Objects.hash(classCoverageMaps);
}

@Override
public String toString() {
StringBuilder explanation = new StringBuilder("Project coverage map\n");
classCoverageMaps.forEach((className, classCoverageMap) -> {
explanation.append(className).append(":\n");
classCoverageMap.methodCoverageMap.forEach((methodName, methodCoverage) -> {
explanation.append(methodName).append("\n");
int index = -1;
for (Integer instructionImprovement : methodCoverage.lineCoverage) {
index++;
explanation.append("L. ").append(index + 1)
.append(" ").append(instructionImprovement)
.append(" instr.").append("\n");
}
});
});
explanation.replace(explanation.length() - 1, explanation.length(), "");
return explanation.toString();
}

}
18 changes: 0 additions & 18 deletions dspot/src/test/java/eu/stamp_project/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,22 +387,4 @@ public void testOverrideExistingResults() throws Exception {
assertEquals(11, testClass3.getMethods().size());
assertEquals(7, testClass4.getMethods().size());
}

@Test
public void testExampleFromJar() throws Exception {
try {
FileUtils.moveDirectory(new File("src/main/resources/test-projects"),
new File("src/main/resources/test-projects2"));
//FileUtils.deleteDirectory(new File("src/main/resources/test-projects"));
} catch (IOException ignored) {

}
testExample();
try {
FileUtils.moveDirectory(new File("src/main/resources/test-projects2"),
new File("src/main/resources/test-projects"));
} catch (IOException ignored) {

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.junit.Test;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ExtendedCoverageTest {
Expand Down

0 comments on commit 205d954

Please sign in to comment.