use of de.tum.in.www1.artemis.service.hestia.behavioral.GroupedFile in project Artemis by ls1intum.
the class ExtractCoveredLinesTest method initBlackboard.
@BeforeEach
public void initBlackboard() {
BehavioralBlackboard blackboard = new BehavioralBlackboard(null, null, null);
var groupedFiles = new ArrayList<GroupedFile>();
blackboard.setGroupedFiles(groupedFiles);
coverageReportEntries = new HashSet<>();
groupedFile = new GroupedFile("test.java", null, null, coverageReportEntries);
groupedFiles.add(groupedFile);
extractCoveredLines = new ExtractCoveredLines(blackboard);
}
use of de.tum.in.www1.artemis.service.hestia.behavioral.GroupedFile in project Artemis by ls1intum.
the class FindCommonLinesTest method initBlackboard.
@BeforeEach
public void initBlackboard() {
BehavioralBlackboard blackboard = new BehavioralBlackboard(null, null, null);
var groupedFiles = new ArrayList<GroupedFile>();
blackboard.setGroupedFiles(groupedFiles);
groupedFile = new GroupedFile("test.java", null, null, null);
groupedFiles.add(groupedFile);
findCommonLines = new FindCommonLines(blackboard);
}
use of de.tum.in.www1.artemis.service.hestia.behavioral.GroupedFile in project Artemis by ls1intum.
the class GroupGitDiffAndCoverageEntriesByFilePathAndTestCaseTest method testGroupTwoFilesSingleTest.
@Test
public void testGroupTwoFilesSingleTest() {
var testCase = new ProgrammingExerciseTestCase();
var gitDiffEntry1 = addGitDiffEntry("test.java", 1, 20);
var gitDiffEntry2 = addGitDiffEntry("test2.java", 1, 20);
var coverageEntry1 = addCoverageEntry("test.java", 5, 5, testCase);
var coverageEntry2 = addCoverageEntry("test2.java", 15, 2, testCase);
assertThat(grouper.executeCondition()).isTrue();
assertThat(grouper.executeAction()).isTrue();
assertThat(blackboard.getGroupedFiles()).isNotNull().hasSize(2).containsExactlyInAnyOrder(new GroupedFile("test.java", testCase, Set.of(gitDiffEntry1), Set.of(coverageEntry1)), new GroupedFile("test2.java", testCase, Set.of(gitDiffEntry2), Set.of(coverageEntry2)));
}
use of de.tum.in.www1.artemis.service.hestia.behavioral.GroupedFile in project Artemis by ls1intum.
the class GroupGitDiffAndCoverageEntriesByFilePathAndTestCaseTest method testGroupSingleFileAndTest.
@Test
public void testGroupSingleFileAndTest() {
var testCase = new ProgrammingExerciseTestCase();
var gitDiffEntry1 = addGitDiffEntry("test.java", 1, 10);
var gitDiffEntry2 = addGitDiffEntry("test.java", 12, 6);
var coverageEntry1 = addCoverageEntry("test.java", 5, 5, testCase);
var coverageEntry2 = addCoverageEntry("test.java", 15, 2, testCase);
assertThat(grouper.executeCondition()).isTrue();
assertThat(grouper.executeAction()).isTrue();
assertThat(blackboard.getGroupedFiles()).isNotNull().hasSize(1).containsExactly(new GroupedFile("test.java", testCase, Set.of(gitDiffEntry1, gitDiffEntry2), Set.of(coverageEntry1, coverageEntry2)));
}
use of de.tum.in.www1.artemis.service.hestia.behavioral.GroupedFile in project Artemis by ls1intum.
the class CombineChangeBlocksTest method initBlackboard.
@BeforeEach
public void initBlackboard() {
BehavioralBlackboard blackboard = new BehavioralBlackboard(null, null, null);
var groupedFiles = new ArrayList<GroupedFile>();
blackboard.setGroupedFiles(groupedFiles);
groupedFile = new GroupedFile("test.java", null, null, null);
groupedFiles.add(groupedFile);
combineChangeBlocks = new CombineChangeBlocks(blackboard);
}
Aggregations