On Thu, 6 Jun 2024 17:08:45 GMT, Naoto Sato <na...@openjdk.org> wrote:

>> test/jdk/java/io/Console/RestoreEchoTest.java line 72:
>> 
>>> 70:                 "--add-opens=java.base/jdk.internal.io=ALL-UNNAMED",
>>> 71:                 "-Djdk.console=java.base",
>>> 72:                 "-classpath", testClasses,
>> 
>> Consider this. If we remove `-classpath` (and `var testClasses`), not only 
>> will nothing break, but we'll be also able to use JUnit assertions and 
>> assumptions in `main` instead of manual check-then-throw. This will work 
>> because the expect-process will inherit the environment, which captures 
>> `CLASSPATH` ( see 
>> https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/ProcessBuilder.html#start()
>>  ).
>> 
>> Again, the above is just something to consider. For all I know, you might've 
>> considered it already and rejected.
>
> I haven't considered that. Removed.

Turned out that removing the classpath ends up not finding the test class:

Error: Could not find or load main class RestoreEchoTest
Caused by: java.lang.ClassNotFoundException: RestoreEchoTest
];

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19315#discussion_r1629984403

Reply via email to