You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2019/05/06 16:49:21 UTC

[groovy] branch GROOVY_2_4_X updated: GROOVY-9107: Make groovy build locale independent

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_2_4_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_2_4_X by this push:
     new 108c23e  GROOVY-9107: Make groovy build locale independent
108c23e is described below

commit 108c23e253f8f82e21fe75daec5b608b456513b1
Author: Daniel Sun <su...@apache.org>
AuthorDate: Tue May 7 00:46:28 2019 +0800

    GROOVY-9107: Make groovy build locale independent
---
 gradle/test.gradle                                                    | 4 ++--
 .../src/spec/test/MarkupTemplateEngineSpecTest.groovy                 | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gradle/test.gradle b/gradle/test.gradle
index 637d495..b250a31 100644
--- a/gradle/test.gradle
+++ b/gradle/test.gradle
@@ -21,9 +21,9 @@ import org.apache.tools.ant.taskdefs.condition.Os
 allprojects {
     test {
         if (JavaVersion.current().isJava8Compatible()) {
-            jvmArgs '-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}"
+            jvmArgs '-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}", '-Duser.language=en'
         } else {
-            jvmArgs '-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}", "-XX:PermSize=${groovyJUnit_permSize}", "-XX:MaxPermSize=${groovyJUnit_maxPermSize}"
+            jvmArgs '-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}", "-XX:PermSize=${groovyJUnit_permSize}", "-XX:MaxPermSize=${groovyJUnit_maxPermSize}", '-Duser.language=en'
         }
         def headless = System.properties['java.awt.headless']
         if (headless == 'true') {
diff --git a/subprojects/groovy-templates/src/spec/test/MarkupTemplateEngineSpecTest.groovy b/subprojects/groovy-templates/src/spec/test/MarkupTemplateEngineSpecTest.groovy
index 0b1c3d4..959aed0 100644
--- a/subprojects/groovy-templates/src/spec/test/MarkupTemplateEngineSpecTest.groovy
+++ b/subprojects/groovy-templates/src/spec/test/MarkupTemplateEngineSpecTest.groovy
@@ -491,7 +491,7 @@ html {
 
     void testLocale() {
         // TODO shouldn't this (or a better) test pass in all environments??
-        if (!Charset.defaultCharset().displayName().contains("windows")) {
+        if (!System.getProperty("os.name").toLowerCase().contains("windows")) {
             config.locale = Locale.ENGLISH
             templateContents = '''
 // tag::locale_explicit_import[]