On Wed, 15 Apr 2026 09:11:12 GMT, Mikhail Yankelevich
<[email protected]> wrote:
>> Brent Christian has updated the pull request with a new target base due to a
>> merge or a rebase. The incremental webrev excludes the unrelated changes
>> brought in by the merge/rebase. The pull request contains seven additional
>> commits since the last revision:
>>
>> - Merge branch 'master' into smartcardio
>> - update example code in javax.smartcardio package doc to use try-finally
>> - minor comment update
>> - add missed clean() calls, update comments
>> - fix imports and copyright years
>> - add test case
>> - convert CardImpl finalizer to use Cleaner
>
> 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).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30683#discussion_r3211825113