From 715f264e5e6d6688cd8cd11a5cc35468df0f8d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Fuch=C3=9F?= Date: Mon, 16 Sep 2024 16:37:50 +0200 Subject: [PATCH] Squashed 'tests/integration-tests/' changes from 2d2daa0..d6720d3 d6720d3 Review comments git-subtree-dir: tests/integration-tests git-subtree-split: d6720d38e1797c6a3f9198b14274b467bb6eb036 --- .../mcse/ardoco/core/tests/eval/CodeProject.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests-base/src/main/java/edu/kit/kastel/mcse/ardoco/core/tests/eval/CodeProject.java b/tests-base/src/main/java/edu/kit/kastel/mcse/ardoco/core/tests/eval/CodeProject.java index 9fdfab9..30fe509 100644 --- a/tests-base/src/main/java/edu/kit/kastel/mcse/ardoco/core/tests/eval/CodeProject.java +++ b/tests-base/src/main/java/edu/kit/kastel/mcse/ardoco/core/tests/eval/CodeProject.java @@ -1,8 +1,6 @@ /* Licensed under MIT 2023-2024. */ package edu.kit.kastel.mcse.ardoco.core.tests.eval; -import static edu.kit.kastel.mcse.ardoco.core.tests.eval.ProjectHelper.loadFileFromResources; - import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -152,8 +150,7 @@ public String getCommitHash() { */ public File getCodeLocation(boolean acmFile) { if (acmFile) { - // If ACM load file from resources - return loadFileFromResources(this.codeModelLocationInResources); + return ProjectHelper.loadFileFromResources(this.codeModelLocationInResources); } return getTemporaryCodeLocation(); @@ -179,7 +176,7 @@ public ExpectedResults getExpectedResultsForSadSamCode() { * @see TraceLinkUtilities#createTraceLinkString(String, String) */ public ImmutableList getSamCodeGoldStandard() { - File samCodeGoldStandardFile = loadFileFromResources(samCodeGoldStandardLocation); + File samCodeGoldStandardFile = ProjectHelper.loadFileFromResources(samCodeGoldStandardLocation); List lines = getLinesFromGoldStandardFile(samCodeGoldStandardFile); MutableList goldStandard = Lists.mutable.empty(); @@ -199,7 +196,7 @@ public ImmutableList getSamCodeGoldStandard() { * {@return all lines from the gold standard in csv format} */ public ImmutableList getSadCodeGoldStandard() { - File sadCodeGoldStandardFile = loadFileFromResources(sadCodeGoldStandardLocation); + File sadCodeGoldStandardFile = ProjectHelper.loadFileFromResources(sadCodeGoldStandardLocation); List lines = getLinesFromGoldStandardFile(sadCodeGoldStandardFile); return Lists.immutable.ofAll(lines); } @@ -212,7 +209,7 @@ private static List getLinesFromGoldStandardFile(File samCodeGoldStandar } catch (IOException e) { logger.error(e.getMessage(), e); } - lines.remove(0); + lines.removeFirst(); lines = lines.stream().filter(Predicate.not(String::isBlank)).toList(); return lines; }