This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_4_0_X by this push:
new 9898e9db52 fix xstream tests
9898e9db52 is described below
commit 9898e9db520b24b03090862005ec03cf57c49ad1
Author: Paul King <[email protected]>
AuthorDate: Wed Apr 16 12:16:24 2025 +1000
fix xstream tests
---
build.gradle | 6 ++++++
src/test/groovy/groovy/util/GroovyScriptEngineTest.groovy | 7 ++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/build.gradle b/build.gradle
index 5a32d6512b..32abfcfd01 100644
--- a/build.gradle
+++ b/build.gradle
@@ -148,6 +148,12 @@ dependencies {
requireCapability 'org.apache.groovy:groovy-grapes'
}
}
+ testRuntimeOnly(project(':')) {
+ because 'GroovyScriptEngineTest uses XStream'
+ capabilities {
+ requireCapability 'org.apache.groovy:groovy-xstream-ast'
+ }
+ }
testRuntimeOnly(project(':')) {
because 'Tests are using GPars'
capabilities {
diff --git a/src/test/groovy/groovy/util/GroovyScriptEngineTest.groovy
b/src/test/groovy/groovy/util/GroovyScriptEngineTest.groovy
index 804a9dd1e9..69c10dd3b0 100644
--- a/src/test/groovy/groovy/util/GroovyScriptEngineTest.groovy
+++ b/src/test/groovy/groovy/util/GroovyScriptEngineTest.groovy
@@ -41,9 +41,6 @@ class GroovyScriptEngineTest extends GroovyTestCase {
@Test
void createASTDumpWhenScriptIsLoadedByName() {
- // current xstream causes illegal access errors on JDK9+ - skip on
those JDK versions, get coverage on older versions
- if (isAtLeastJdk('9.0')) return
-
def scriptFile = temporaryFolder.newFile('Script1.groovy')
scriptFile << "assert 1 + 1 == 2" // the script just has to have
_some_ content
@@ -80,7 +77,7 @@ class GroovyScriptEngineTest extends GroovyTestCase {
def scriptFile = temporaryFolder.newFile('Script1.groovy')
scriptFile << '''
class Foo {}
- assert 1 + 1 == 2
+ assert 1 + 1 == 2
'''
def counts = [:].withDefault { 0 }
@@ -97,4 +94,4 @@ class GroovyScriptEngineTest extends GroovyTestCase {
assert counts['Script1'] == 1
assert counts['Foo'] == 1
}
-}
\ No newline at end of file
+}