From 925580424320fc6724fbe203f20874c877994a50 Mon Sep 17 00:00:00 2001 From: bchristi Date: Mon, 25 Feb 2013 14:19:48 -0800 Subject: [PATCH] 8006039: test/tools/launcher/I18NJarTest.java fails on Mac w/ LANG=C, LC_ALL=C Summary: Avoid automated test failure by just exiting when in 'C' locale Reviewed-by: naoto, ksrini --- test/ProblemList.txt | 3 --- test/tools/launcher/I18NJarTest.java | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/test/ProblemList.txt b/test/ProblemList.txt index 7c621e008..7adc6d2c6 100644 --- a/test/ProblemList.txt +++ b/test/ProblemList.txt @@ -327,9 +327,6 @@ tools/pack200/Pack200Test.java solaris-all, mac # 7150569 tools/launcher/UnicodeTest.java macosx-all -# 8006039 -tools/launcher/I18NJarTest.java macosx-all - # 8007410 tools/launcher/FXLauncherTest.java linux-all diff --git a/test/tools/launcher/I18NJarTest.java b/test/tools/launcher/I18NJarTest.java index 9c033b47f..ad94abcce 100644 --- a/test/tools/launcher/I18NJarTest.java +++ b/test/tools/launcher/I18NJarTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,6 +52,8 @@ public class I18NJarTest extends TestHelper { private static final File cwd = new File("."); private static final File dir = new File("\uFF66\uFF67\uFF68\uFF69"); private static final String encoding = System.getProperty("sun.jnu.encoding", ""); + private static final String LANG = System.getenv("LANG"); + private static final String LC_ALL = System.getenv("LC_ALL"); public static void main(String... args) throws Exception { boolean localeAvailable = false; @@ -63,7 +65,16 @@ public class I18NJarTest extends TestHelper { } if (!localeAvailable) { System.out.println("Warning: locale: " + Locale.JAPAN - + " not found, test passes vacuosly"); + + " not found, test passes vacuously"); + return; + } + if ("C".equals(LC_ALL) || "C".equals(LANG)) { + System.out.println("Warning: The LANG and/or LC_ALL env vars are " + + "set to \"C\":\n" + + " LANG=" + LANG + "\n" + + " LC_ALL=" + LC_ALL + "\n" + + "This test requires support for multi-byte filenames.\n" + + "Test passes vacuously."); return; } if (encoding.equals("MS932") || encoding.equals("UTF-8")) { @@ -73,7 +84,7 @@ public class I18NJarTest extends TestHelper { } else { System.out.println("Warning: current encoding is " + encoding + "this test requires MS932 or UTF-8," + - " test passes vacuosly"); + " test passes vacuously"); return; } dir.mkdir(); -- GitLab