You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/11/15 05:53:02 UTC
[groovy] branch GROOVY_4_0_X updated: GROOVY-10822: Fix DocCommandTest for earlier JDKs
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 acebb8ce6e GROOVY-10822: Fix DocCommandTest for earlier JDKs
acebb8ce6e is described below
commit acebb8ce6e8baaf5c3dc613a3c42633cdb4dbe29
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Nov 15 15:52:54 2022 +1000
GROOVY-10822: Fix DocCommandTest for earlier JDKs
---
.../apache/groovy/groovysh/commands/DocCommandTest.groovy | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/commands/DocCommandTest.groovy b/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/commands/DocCommandTest.groovy
index 1ce13d17c9..464362bb64 100644
--- a/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/commands/DocCommandTest.groovy
+++ b/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/commands/DocCommandTest.groovy
@@ -20,6 +20,8 @@ package org.apache.groovy.groovysh.commands
import org.apache.groovy.groovysh.Groovysh
+import static groovy.test.GroovyAssert.isAtLeastJdk
+
/**
* Tests for the {@link DocCommand} class.
*/
@@ -36,15 +38,17 @@ class DocCommandTest extends CommandTestSupport {
void testUrlsForJavaOnlyClass() {
def command = docCommandWithSendHEADRequestReturnValueOf { !it.host.contains('docs.groovy-lang.org') }
- // no module specified
+ // no module specified for a class not in java.base
def urls = command.urlsFor('org.ietf.jgss.GSSContext')
assert urls ==
[new URL("https://docs.oracle.com/javase/8/docs/api/org/ietf/jgss/GSSContext.html")]
// explicit module given
- urls = command.urlsFor('org.ietf.jgss.GSSContext', 'java.security.jgss')
- assert urls ==
- [new URL("https://docs.oracle.com/en/java/javase/${simpleJavaVersion()}/docs/api/java.security.jgss/org/ietf/jgss/GSSContext.html")]
+ if (isAtLeastJdk('11.0')) {
+ urls = command.urlsFor('org.ietf.jgss.GSSContext', 'java.security.jgss')
+ assert urls ==
+ [new URL("https://docs.oracle.com/en/java/javase/${simpleJavaVersion()}/docs/api/java.security.jgss/org/ietf/jgss/GSSContext.html")]
+ }
}
void testUrlsForJavaClass() {