RFR: 8166026: refactor shell tests to java
Roger Riggs
rriggs at openjdk.java.net
Mon Nov 30 18:56:02 UTC 2020
On Fri, 27 Nov 2020 18:50:19 GMT, Ivan Šipka <isipka at openjdk.org> wrote:
> @iignatev could you please review? Thank you.
>
> note to self:
> jtreg test/jdk/java/lang/ProcessBuilder/InheritIO/InheritIoTest.java test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java test/jdk/java/lang/Thread/uncaughtexceptions/UncaughtExceptionsTest.java test/jdk/java/lang/annotation/loaderLeak/LoaderLeakTest.java
test/jdk/java/lang/ProcessBuilder/InheritIO/InheritIo.java line 26:
> 24: import static java.lang.ProcessBuilder.Redirect.*;
> 25:
> 26: class InheritIo {
The rename of the class is unnecessary and less readable.
The function being tested is inheritIO and the test name should match. (As does the directory it is in).
test/jdk/java/lang/ProcessBuilder/InheritIO/InheritIoTest.java line 42:
> 40:
> 41: public class InheritIoTest {
> 42:
Having two classes and files with similar names is confusing. TestInhieritIO and InheritIOTest.
Since InheritIO already has subclasses that are the ones being invoked;
that leaves methods in InheritIO to have the test cases.
test/jdk/java/lang/Thread/uncaughtexceptions/UncaughtExceptionsTest.java line 40:
> 38: */
> 39: public class UncaughtExceptionsTest {
> 40:
As with InheritIO, the nested classes that are invoked can be included in a single .java file.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1484
More information about the core-libs-dev
mailing list