33 |
33 |
34 private static boolean err = false; |
34 private static boolean err = false; |
35 |
35 |
36 private static Locale th = new Locale("th", ""); |
36 private static Locale th = new Locale("th", ""); |
37 private static Locale th_TH = new Locale("th", "TH"); |
37 private static Locale th_TH = new Locale("th", "TH"); |
38 private static Date date = new Date(2008-1900, Calendar.OCTOBER, 1, 0, 0, 0); |
|
39 private static String expected_th[] = { |
38 private static String expected_th[] = { |
40 "\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23\u0e17\u0e35\u0e48 30 \u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19 \u0e04.\u0e28. 2008, 8 \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 0 \u0e19\u0e32\u0e17\u0e35 00 \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35", // 0: FULL |
39 "\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23\u0e17\u0e35\u0e48 30 \u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19 \u0e04.\u0e28. 2008, 8 \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 0 \u0e19\u0e32\u0e17\u0e35 00 \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35", // 0: FULL |
41 "30 \u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19 2008, 8 \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 0 \u0e19\u0e32\u0e17\u0e35", // 1: LONG |
40 "30 \u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19 2008, 8 \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 0 \u0e19\u0e32\u0e17\u0e35", // 1: LONG |
42 "30 \u0e01.\u0e22. 2008, 8:00:00", // 2: MEDIUM |
41 "30 \u0e01.\u0e22. 2008, 8:00:00", // 2: MEDIUM |
43 "30/9/2008, 8:00 \u0e19.", // 3: SHORT |
42 "30/9/2008, 8:00 \u0e19.", // 3: SHORT |
63 System.err.println("Error: Pattern for th locale should be the same as pattern for th_TH locale. (" + stylePattern[style] + ")"); |
62 System.err.println("Error: Pattern for th locale should be the same as pattern for th_TH locale. (" + stylePattern[style] + ")"); |
64 System.err.println("\tth: " + str_th); |
63 System.err.println("\tth: " + str_th); |
65 System.err.println("\tth_TH: " + str_th_TH); |
64 System.err.println("\tth_TH: " + str_th_TH); |
66 } |
65 } |
67 |
66 |
|
67 Date date = new Date(2008-1900, Calendar.SEPTEMBER, 30, 8, 0, 0); |
68 str_th = df_th.format(date); |
68 str_th = df_th.format(date); |
69 if (!expected_th[style].equals(str_th)) { |
69 if (!expected_th[style].equals(str_th)) { |
70 err = true; |
70 err = true; |
71 System.err.println("Error: Formatted date in th locale is incorrect in " + stylePattern[style] + " pattern."); |
71 System.err.println("Error: Formatted date in th locale is incorrect in " + stylePattern[style] + " pattern."); |
72 System.err.println("\tExpected: " + expected_th[style]); |
72 System.err.println("\tExpected: " + expected_th[style]); |