use of org.kanonizo.framework.objects.ClassUnderTest in project kanonizo by kanonizo.
the class ScytheInstrumenter method collectBranches.
private Set<org.kanonizo.framework.objects.Branch> collectBranches(TestCase testCase) {
Set<org.kanonizo.framework.objects.Branch> covered = new HashSet<>();
List<Class<?>> changedClasses = ClassAnalyzer.getChangedClasses();
for (Class<?> cl : changedClasses) {
if (ClassStore.get(cl.getName()) != null) {
ClassUnderTest parent = ClassStore.get(cl.getName());
List<com.scythe.instrumenter.instrumentation.objectrepresentation.Branch> branches = ClassAnalyzer.getCoverableBranches(cl.getName());
Set<com.scythe.instrumenter.instrumentation.objectrepresentation.Branch> branchesCovered = branches.stream().filter(branch -> branch.getHits() > 0).collect(Collectors.toSet());
Set<Branch> kanBranches = branchesCovered.stream().map(branch -> BranchStore.with(parent, branch.getLineNumber(), branch.getGoalId())).collect(Collectors.toSet());
covered.addAll(kanBranches);
}
}
return covered;
}
Aggregations