8196213: sun/security/tools/jarsigner/warnings/NoTimestampTest.java test fails on ar_SA locale.
authorxiaofeya
Mon, 25 Jun 2018 20:03:46 -0700
changeset 50779 7284ce754713
parent 50778 bba1deda9216
child 50780 c9f193a8b671
8196213: sun/security/tools/jarsigner/warnings/NoTimestampTest.java test fails on ar_SA locale. Reviewed-by: naoto Contributed-by: dan.z.zhou@oracle.com
test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java
--- a/test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java	Tue Jun 26 10:43:50 2018 +0800
+++ b/test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java	Mon Jun 25 20:03:46 2018 -0700
@@ -22,12 +22,13 @@
  */
 
 import java.util.Date;
+import java.util.Locale;
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.test.lib.util.JarUtils;
 
 /**
  * @test
- * @bug 8024302 8026037
+ * @bug 8024302 8026037 8196213
  * @summary Checks warnings if -tsa and -tsacert options are not specified
  * @library /lib/testlibrary /test/lib ../
  * @build jdk.test.lib.util.JarUtils
@@ -40,8 +41,16 @@
      * and checks that proper warnings are shown.
      */
     public static void main(String[] args) throws Throwable {
-        NoTimestampTest test = new NoTimestampTest();
-        test.start();
+        Locale reservedLocale = Locale.getDefault();
+        Locale.setDefault(Locale.US);
+
+        try {
+            NoTimestampTest test = new NoTimestampTest();
+            test.start();
+        } finally {
+            // Restore the reserved locale
+            Locale.setDefault(reservedLocale);
+        }
     }
 
     private void start() throws Throwable {