Path: blob/master/test/jdk/tools/launcher/DefaultLocaleTestRun.java
41144 views
/*1* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 4958170 4891531 498953426* @summary Test to see if default java locale settings are identical27when launch jvm from java and javaw respectively. Test28should be run on Windows with different user locale and29system locale setting in ControlPanel's RegionSetting.30Following 2 testing scenarios are recommended31(1)systemLocale=Japanese, userLocale=English32(2)systemLocale=English, userLocale=Japanese33* @compile -XDignore.symbol.file DefaultLocaleTest.java34* @run main DefaultLocaleTestRun35*/3637public class DefaultLocaleTestRun extends TestHelper {38public static void main(String... args) {39if (!isWindows) {40System.out.println("Test passes vacuously on non-windows");41return;42}43TestResult tr;44tr = doExec(javaCmd,45"-cp", TEST_CLASSES_DIR.getAbsolutePath(),46"DefaultLocaleTest", "-w", "x.out");47System.out.println(tr.testOutput);48tr = doExec(javawCmd,49"-cp", TEST_CLASSES_DIR.getAbsolutePath(),50"DefaultLocaleTest", "-r", "x.out");51System.out.println(tr.testOutput);52if (!tr.isOK()) {53throw new RuntimeException("Test failed");54}55}56}575859