diff --git a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/CpgOptionGroupTest.kt b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/CpgOptionGroupTest.kt index 7ebfdfbea..b893e2ab9 100644 --- a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/CpgOptionGroupTest.kt +++ b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/CpgOptionGroupTest.kt @@ -30,10 +30,7 @@ import org.junit.jupiter.params.provider.MethodSource import java.nio.file.Files import java.nio.file.Path import java.util.stream.Stream -import kotlin.io.path.Path -import kotlin.io.path.absolute -import kotlin.io.path.div -import kotlin.io.path.isRegularFile +import kotlin.io.path.* import kotlin.streams.asSequence import kotlin.test.* @@ -223,19 +220,19 @@ class CpgOptionGroupTest { val topTestDirResource = CpgOptionGroupTest::class.java.classLoader.getResource("cli-test-directory") assertNotNull(topTestDirResource) - topTestDir = Path(topTestDirResource.path) + topTestDir = topTestDirResource.toURI().toPath() assertNotNull(topTestDir) // TODO: why is this necessary val testDir1Resource = CpgOptionGroupTest::class.java.classLoader.getResource("cli-test-directory/dir1") assertNotNull(testDir1Resource) - testDir1 = Path(testDir1Resource.path) + testDir1 = testDir1Resource.toURI().toPath() assertNotNull(testDir1) val testDir2Resource = CpgOptionGroupTest::class.java.classLoader.getResource("cli-test-directory/dir2") assertNotNull(testDir2Resource) - testDir2 = Path(testDir2Resource.path) + testDir2 = testDir2Resource.toURI().toPath() assertNotNull(testDir2) val testFile1Resource = @@ -244,7 +241,7 @@ class CpgOptionGroupTest { .classLoader .getResource("cli-test-directory/file1.java") assertNotNull(testFile1Resource) - testFile1 = Path(testFile1Resource.path) + testFile1 = testFile1Resource.toURI().toPath() assertNotNull(testFile1) allFiles = Files.walk(topTestDir).asSequence().filter { it.isRegularFile() }.toList() diff --git a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/FollowsEvaluationTest.kt b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/FollowsEvaluationTest.kt index e7067bcd3..231f0b736 100644 --- a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/FollowsEvaluationTest.kt +++ b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/FollowsEvaluationTest.kt @@ -117,7 +117,7 @@ class FollowsEvaluationTest { val testFileResource = classLoader.getResource("FollowsEvaluationTest/SimpleFollows.java") assertNotNull(testFileResource) - testFile = Path(testFileResource.path) + testFile = testFileResource.toURI().toPath() val fooInstance = FooModel() val barInstance = BarModel() diff --git a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/ImplementationDslTest.kt b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/ImplementationDslTest.kt index 2085ec80d..0dece26f6 100644 --- a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/ImplementationDslTest.kt +++ b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/ImplementationDslTest.kt @@ -23,7 +23,7 @@ import de.fraunhofer.aisec.codyze.specificationLanguages.coko.core.dsl.op import de.fraunhofer.aisec.codyze.specificationLanguages.coko.core.dsl.signature import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test -import kotlin.io.path.Path +import kotlin.io.path.toPath import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -94,7 +94,7 @@ class ImplementationDslTest { val testFileResource = classLoader.getResource("ImplementationDslTest/SimpleJavaFile.java") assertNotNull(testFileResource) - val testFile = Path(testFileResource.path) + val testFile = testFileResource.toURI().toPath() backend = CokoCpgBackend(config = createCpgConfiguration(testFile)) } } diff --git a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/NeverEvaluationTest.kt b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/NeverEvaluationTest.kt index 3b7e2bcad..615c531df 100644 --- a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/NeverEvaluationTest.kt +++ b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/NeverEvaluationTest.kt @@ -107,11 +107,11 @@ class NeverEvaluationTest { val violationFileResource = classLoader.getResource("NeverEvaluationTest/NeverViolation.java") assertNotNull(violationFileResource) - violationFile = Path(violationFileResource.path) + violationFile = violationFileResource.toURI().toPath() val passFileResource = classLoader.getResource("NeverEvaluationTest/NeverPass.java") assertNotNull(passFileResource) - passFile = Path(passFileResource.path) + passFile = passFileResource.toURI().toPath() } } } diff --git a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/OnlyEvaluationTest.kt b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/OnlyEvaluationTest.kt index 887942276..5b99e2a31 100644 --- a/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/OnlyEvaluationTest.kt +++ b/codyze-backends/cpg/src/test/kotlin/de/fraunhofer/aisec/codyze/backends/cpg/OnlyEvaluationTest.kt @@ -73,7 +73,7 @@ class OnlyEvaluationTest { val testFileResource = classLoader.getResource("OnlyEvaluationTest/SimpleOnly.java") assertNotNull(testFileResource) - testFile = Path(testFileResource.path) + testFile = testFileResource.toURI().toPath() } } } diff --git a/codyze-cli/src/test/kotlin/de/fraunhofer/aisec/codyze/cli/CodyzeCliTest.kt b/codyze-cli/src/test/kotlin/de/fraunhofer/aisec/codyze/cli/CodyzeCliTest.kt index bafee3277..b4f8b913a 100644 --- a/codyze-cli/src/test/kotlin/de/fraunhofer/aisec/codyze/cli/CodyzeCliTest.kt +++ b/codyze-cli/src/test/kotlin/de/fraunhofer/aisec/codyze/cli/CodyzeCliTest.kt @@ -112,7 +112,7 @@ class CodyzeCliTest : KoinTest { val pathConfigFileResource = CodyzeCliTest::class.java.classLoader.getResource("config-files/path-config.json") assertNotNull(pathConfigFileResource) - pathConfigFile = Path(pathConfigFileResource.path) + pathConfigFile = pathConfigFileResource.toURI().toPath() assertTrue(pathConfigFile.exists()) val correctConfigFileResource = @@ -121,19 +121,19 @@ class CodyzeCliTest : KoinTest { .classLoader .getResource("config-files/correct-config.json") assertNotNull(correctConfigFileResource) - correctConfigFile = Path(correctConfigFileResource.path) + correctConfigFile = correctConfigFileResource.toURI().toPath() assertTrue(correctConfigFile.exists()) val specMarkResource = CodyzeCliTest::class.java.classLoader.getResource("config-files/spec/spec.mark") assertNotNull(specMarkResource) - specMark = Path(specMarkResource.path) + specMark = specMarkResource.toURI().toPath() assertTrue(specMark.exists()) val specMark2Resource = CodyzeCliTest::class.java.classLoader.getResource("config-files/spec2.mark") assertNotNull(specMark2Resource) - spec2Mark = Path(specMark2Resource.path) + spec2Mark = specMark2Resource.toURI().toPath() assertTrue(spec2Mark.exists()) } } diff --git a/codyze-specification-languages/coko/coko-dsl/src/test/kotlin/de/fraunhofer/aisec/codyze/specificationLanguages/coko/dsl/CokoCpgIntegrationTest.kt b/codyze-specification-languages/coko/coko-dsl/src/test/kotlin/de/fraunhofer/aisec/codyze/specificationLanguages/coko/dsl/CokoCpgIntegrationTest.kt index 5a4325b19..810b1be18 100644 --- a/codyze-specification-languages/coko/coko-dsl/src/test/kotlin/de/fraunhofer/aisec/codyze/specificationLanguages/coko/dsl/CokoCpgIntegrationTest.kt +++ b/codyze-specification-languages/coko/coko-dsl/src/test/kotlin/de/fraunhofer/aisec/codyze/specificationLanguages/coko/dsl/CokoCpgIntegrationTest.kt @@ -306,7 +306,7 @@ class CokoCpgIntegrationTest { ) val permutations = fileMap.permutate() for (p in permutations) { - val (specFiles, fileNames) = p.map { Path(it.path) }.map { it to it.fileName }.unzip() + val (specFiles, fileNames) = p.map { it.toURI().toPath() }.map { it to it.fileName }.unzip() stream.add( Arguments.of( specFiles,