<i18n dev> RFR: 8295239: Refactor java/util/Formatter/Basic script into a Java native test launcher

Naoto Sato naoto at openjdk.org
Mon Oct 17 22:09:45 UTC 2022


On Fri, 14 Oct 2022 20:38:32 GMT, Justin Lu <duke at openjdk.org> wrote:

> Issue: Formatter unit tests are launched via basic.sh
> 
> Fix: Replace basic.sh with a Java test launcher
> 
> Note: Java.internal.math was included in the original configuration of Basic, but I removed it as it was not used within the Basic unit tests 
> 
> 
> Original output on success
> <img src="https://user-images.githubusercontent.com/67398801/195936541-bc90db50-8d03-47be-9c4f-95176b19a6a7.png" width="350" height="350">
> 
> 
> New output on success
> <img src="https://user-images.githubusercontent.com/67398801/195936558-f85f4d48-dae2-4c38-aa50-46ef47db3d89.png" width="350" height="450">

test/jdk/java/util/Formatter/Basic.java line 24:

> 22:  */
> 23: 
> 24: import static java.lang.System.out;

It's not your change, but probably this does not seem necessary, as `out` appears only once.

test/jdk/java/util/Formatter/BasicTestLauncher.java line 36:

> 34:  *      8059175 8204229
> 35:  *
> 36:  * @run main/othervm BasicTestLauncher

It does not seem to require `othervm` mode.

test/jdk/java/util/Formatter/BasicTestLauncher.java line 48:

> 46:         runFormatterTests(TZ_UP);
> 47:         runFormatterTests(TZ_AN);
> 48:     }

Could use testng/junit, instead of normal main. This way both timezones are guaranteed to be tested. Currently, if an error occurs with `US/Pacific`, `Asia/Novosibirsk` will not run.

test/jdk/java/util/Formatter/BasicTestLauncher.java line 74:

> 72:             throw new RuntimeException(String.format("$$$ Error(s) found within %s subprocess: " +
> 73:                     "%s%n", timeZone, err.getMessage()));
> 74:         }

I'd prefer not to catch an exception (and turn it into `RuntimeException`) here, as the exception type will be lost.

-------------

PR: https://git.openjdk.org/jdk/pull/10715


More information about the i18n-dev mailing list