From c6486f64cbd43a940604898f44df244d8a672b92 Mon Sep 17 00:00:00 2001 From: Pratiksha Sawant Date: Fri, 10 Oct 2025 22:39:10 +0530 Subject: [PATCH] Fix for formatter Taiwanese in AIX and Linux Timezone format has been modified from TST to CST Signed-off-by: Pratiksha Sawant --- .../data/expected_AIX_ZH_TW.UTF-8_22.txt | 59 +++++++++++++++++++ .../data/expected_Linux_zh_TW.UTF-8_22.txt | 59 +++++++++++++++++++ functional/MBCS_Tests/formatter/playlist.xml | 18 ------ functional/MBCS_Tests/formatter/test.sh | 18 +++++- 4 files changed, 134 insertions(+), 20 deletions(-) create mode 100644 functional/MBCS_Tests/formatter/data/expected_AIX_ZH_TW.UTF-8_22.txt create mode 100644 functional/MBCS_Tests/formatter/data/expected_Linux_zh_TW.UTF-8_22.txt diff --git a/functional/MBCS_Tests/formatter/data/expected_AIX_ZH_TW.UTF-8_22.txt b/functional/MBCS_Tests/formatter/data/expected_AIX_ZH_TW.UTF-8_22.txt new file mode 100644 index 0000000000..6ffab93e97 --- /dev/null +++ b/functional/MBCS_Tests/formatter/data/expected_AIX_ZH_TW.UTF-8_22.txt @@ -0,0 +1,59 @@ +invoking FormatterTest2 + +numeric format: +123456.789 = 123,456.789 +PI = +3.14159265 +65535(hex) = 0xffff +65535(oct) = 0177777 + +string format: +test string: abc株表噂十豹竹敷~椄*@ABC18921壹捌玖貳壹貳參肆伍陸柒捌玖拾一丁七/\ +upper case : ABC株表噂十豹竹敷~椄*@ABC18921壹捌玖貳壹貳參肆伍陸柒捌玖拾一丁七/\ + +date/time format: +test for 2007/01/01 +current date: 2007/01/01 (週一) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 1月 +month(short): 1月 +day of week : 星期一 + +date/time format: +test for 2007/08/01 +current date: 2007/08/01 (週三) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 8月 +month(short): 8月 +day of week : 星期三 + +date/time format: +test for 2007/02/29 which does not exist +current date: 2007/03/01 (週四) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 3月 +month(short): 3月 +day of week : 星期四 + +date/time format: +test for 2008/02/29 +current date: 2008/02/29 (週五) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 2月 +month(short): 2月 +day of week : 星期五 + +date/time format: +test for 2007/04/31 which does not exist +current date: 2007/05/01 (週二) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 5月 +month(short): 5月 +day of week : 星期二 + +date/time format: +test for 2007/12/32 which does not exist +current date: 2008/01/01 (週二) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 1月 +month(short): 1月 +day of week : 星期二 diff --git a/functional/MBCS_Tests/formatter/data/expected_Linux_zh_TW.UTF-8_22.txt b/functional/MBCS_Tests/formatter/data/expected_Linux_zh_TW.UTF-8_22.txt new file mode 100644 index 0000000000..6ffab93e97 --- /dev/null +++ b/functional/MBCS_Tests/formatter/data/expected_Linux_zh_TW.UTF-8_22.txt @@ -0,0 +1,59 @@ +invoking FormatterTest2 + +numeric format: +123456.789 = 123,456.789 +PI = +3.14159265 +65535(hex) = 0xffff +65535(oct) = 0177777 + +string format: +test string: abc株表噂十豹竹敷~椄*@ABC18921壹捌玖貳壹貳參肆伍陸柒捌玖拾一丁七/\ +upper case : ABC株表噂十豹竹敷~椄*@ABC18921壹捌玖貳壹貳參肆伍陸柒捌玖拾一丁七/\ + +date/time format: +test for 2007/01/01 +current date: 2007/01/01 (週一) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 1月 +month(short): 1月 +day of week : 星期一 + +date/time format: +test for 2007/08/01 +current date: 2007/08/01 (週三) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 8月 +month(short): 8月 +day of week : 星期三 + +date/time format: +test for 2007/02/29 which does not exist +current date: 2007/03/01 (週四) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 3月 +month(short): 3月 +day of week : 星期四 + +date/time format: +test for 2008/02/29 +current date: 2008/02/29 (週五) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 2月 +month(short): 2月 +day of week : 星期五 + +date/time format: +test for 2007/04/31 which does not exist +current date: 2007/05/01 (週二) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 5月 +month(short): 5月 +day of week : 星期二 + +date/time format: +test for 2007/12/32 which does not exist +current date: 2008/01/01 (週二) CST +current time: 上午 12:00:00 GMT+0800 +month(full) : 1月 +month(short): 1月 +day of week : 星期二 diff --git a/functional/MBCS_Tests/formatter/playlist.xml b/functional/MBCS_Tests/formatter/playlist.xml index ec6fe35298..13da7705b7 100644 --- a/functional/MBCS_Tests/formatter/playlist.xml +++ b/functional/MBCS_Tests/formatter/playlist.xml @@ -62,18 +62,6 @@ limitations under the License. MBCS_Tests_formatter_zh_TW_linux LANG=zh_TW.UTF-8 bash $(TEST_RESROOT)$(D)test.sh; \ $(TEST_STATUS) - - - https://github.com/eclipse-openj9/openj9/issues/19083 - 22+ - openj9 - - - https://github.com/adoptium/aqa-tests/issues/5148 - 22+ - hotspot - - os.linux special @@ -249,12 +237,6 @@ limitations under the License. MBCS_Tests_formatter_ZH_TW_aix - - - https://github.com/adoptium/aqa-tests/issues/5148 - 22+ - - LANG=ZH_TW ksh $(TEST_RESROOT)$(D)test.sh; \ $(TEST_STATUS) os.aix diff --git a/functional/MBCS_Tests/formatter/test.sh b/functional/MBCS_Tests/formatter/test.sh index 668d861440..8c50ed87da 100755 --- a/functional/MBCS_Tests/formatter/test.sh +++ b/functional/MBCS_Tests/formatter/test.sh @@ -23,9 +23,23 @@ OUTPUT=output.txt . ${BASE}/check_env_unix.sh CHARMAP=${FULLLANG} -SOURCE="${CHARMAP}.txt" + +# Get Java major version +FULL_VERSION=$(java -version 2>&1 | grep 'version' | cut -d '"' -f2) +JAVA_VERSION=${FULL_VERSION%%.*} + +#_22 file is only applicable for taiwanese in AIX and Linux else it should fall back to default +if { [ "$CHARMAP" = "Linux_zh_TW.UTF-8" ] || [ "$CHARMAP" = "AIX_ZH_TW.UTF-8" ]; } && [ "$JAVA_VERSION" -ge 22 ]; then + SOURCE="${CHARMAP}_22.txt" +else + SOURCE="${CHARMAP}.txt" +fi + +# Create the expected file name +EXP_FILE=expected_${SOURCE} + echo "invoking FormatterTest2" > ${OUTPUT} ${JAVA_BIN}/java FormatterTest2 abc${TEST_STRING} >> ${OUTPUT} -diff ${BASE}/expected_${SOURCE} ${OUTPUT} > /dev/null 2>&1 +diff ${BASE}/${EXP_FILE} ${OUTPUT} > /dev/null 2>&1 RESULT=$? exit ${RESULT}