On Fri, 8 May 2026 23:13:54 GMT, Brent Christian <[email protected]> wrote:

>> test/jdk/sun/security/smartcardio/TestCleaner.java line 54:
>> 
>>> 52:  * CardImpl from becoming unreachable and being collected/cleaned.
>>> 53:  */
>>> 54: public class TestCleaner extends Utils {
>> 
>> Since this is a manual test have you considered using a ui for instructions? 
>> I think the go-to method now is `UIBuilder`. e.g. : 
>> 
>>     final JDialog dialog = new UIBuilder.DialogBuilder()
>>                 .setTitle("Title")
>>                 .setInstruction(instruction)
>>                 .setMessage(message)
>>                 .setPassAction(e -> pass())
>>                 .setFailAction(e -> fail())
>>                 .setCloseAction(this::abort)
>>                 .build();
>> 
>> https://github.com/openjdk/jdk/blob/master/test/jdk/com/sun/security/auth/callback/TextCallbackHandler/Password.java#L85
>
> Hi, Mikhail
> 
> I've made `TestCleaner.java` similar to the other `@run main/manual` tests in 
> `test/jdk/sun/security/smartcardio/`, which don't create a GUI explicitly. I 
> admit that I don't know the specifics of how these tests are run, but AFAIK 
> one can still bring up the gui using `jtreg -gui ...`.
> 
> As with the other tests, `TestCleaner` "requires special hardware" (a real or 
> simulated JavaCard).
> As long as a `CardTerminal.connect()` can be performed, `TestCleaner` runs on 
> its own, and doesn't require manual intervention (or, IMO, instructions).

My worry was the request to insert the card if it is not inserted. Could it be 
a fail case instead? Then the test won't need any user interaction at all. 
Alternatively, a popup would work better than the message since it is very 
likely to be missed from my experience

What do you think ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30683#discussion_r3218640978

Reply via email to