From b99d77f23b95c21727fec501d4aee8b84e843064 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Wed, 28 Aug 2024 15:18:18 +0200 Subject: [PATCH] #318 Unify test case setup ; Conflicts: ; htmlSanityCheck-gradle-plugin/src/test/groovy/org/aim42/htmlsanitycheck/gradle/HtmlSanityCheckBaseSpec.groovy ; htmlSanityCheck-gradle-plugin/src/test/groovy/org/aim42/htmlsanitycheck/gradle/HtmlSanityCheckTaskFunctionalSpec.groovy ; htmlSanityCheck-gradle-plugin/src/test/groovy/org/aim42/htmlsanitycheck/gradle/HtmlSanityCheckTaskSpec.groovy --- .../org/aim42/htmlsanitycheck/cli/HscCommandSpec.groovy | 4 ++-- .../org/aim42/htmlsanitycheck/report/HtmlReporterTest.groovy | 4 ++-- htmlSanityCheck-gradle-plugin/src/test/resources | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) create mode 120000 htmlSanityCheck-gradle-plugin/src/test/resources diff --git a/htmlSanityCheck-cli/src/test/groovy/org/aim42/htmlsanitycheck/cli/HscCommandSpec.groovy b/htmlSanityCheck-cli/src/test/groovy/org/aim42/htmlsanitycheck/cli/HscCommandSpec.groovy index d11038ab..3fec1cb1 100644 --- a/htmlSanityCheck-cli/src/test/groovy/org/aim42/htmlsanitycheck/cli/HscCommandSpec.groovy +++ b/htmlSanityCheck-cli/src/test/groovy/org/aim42/htmlsanitycheck/cli/HscCommandSpec.groovy @@ -77,7 +77,7 @@ class HscCommandSpec extends Specification { SecurityManager originalSecurityManager = System.getSecurityManager() SecurityManager mockSecurityManager = new NoExitSecurityMock(originalSecurityManager) System.setSecurityManager(mockSecurityManager) - String[] args = [testProjectDir.getRoot()] + String[] args = [testProjectDir.root] when: HscCommand.main(args) @@ -94,7 +94,7 @@ class HscCommandSpec extends Specification { def "test with valid HTML file"() { given: htmlFile << VALID_HTML - String[] args = [testProjectDir.getRoot()] + String[] args = [testProjectDir.root] when: HscCommand.main(args) diff --git a/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/report/HtmlReporterTest.groovy b/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/report/HtmlReporterTest.groovy index 36274fa0..9893f3d7 100644 --- a/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/report/HtmlReporterTest.groovy +++ b/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/report/HtmlReporterTest.groovy @@ -25,7 +25,7 @@ class HtmlReporterTest { @Before void setUp() { runResults = new PerRunResults() - htmlReporter = new HtmlReporter(runResults, tempDir.getRoot().getAbsolutePath()) + htmlReporter = new HtmlReporter(runResults, tempDir.root.getAbsolutePath()) } @Test @@ -189,7 +189,7 @@ class HtmlReporterTest { private String getResultContents() { htmlReporter.closeReport() - File reportFile = new File(tempDir.getRoot(), "index.html") + File reportFile = new File(tempDir.root, "index.html") try { String content = new String(Files.readAllBytes(reportFile.toPath())) return content diff --git a/htmlSanityCheck-gradle-plugin/src/test/resources b/htmlSanityCheck-gradle-plugin/src/test/resources new file mode 120000 index 00000000..2c7089f1 --- /dev/null +++ b/htmlSanityCheck-gradle-plugin/src/test/resources @@ -0,0 +1 @@ +../../../htmlSanityCheck-core/src/test/resources \ No newline at end of file