RFR: JDK-8325743: test/jdk/java/nio/channels/unixdomain/SocketOptions.java enhance user name output in error case
Alan Bateman
alanb at openjdk.org
Tue Feb 13 14:45:58 UTC 2024
On Tue, 13 Feb 2024 13:54:12 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> In case of a bad running LDAP we got this output from test test/jdk/java/nio/channels/unixdomain/SocketOptions.java
>
> java.lang.RuntimeException: wrong username
> at SocketOptions.testPeerCred(SocketOptions.java:75)
> at SocketOptions.main(SocketOptions.java:52)
> at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
> at java.base/java.lang.reflect.Method.invoke(Method.java:580)
> at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
> at java.base/java.lang.Thread.run(Thread.java:1583)
>
> It would be better to see the compared values (user name data we compare) and get them in the exception output.
test/jdk/java/nio/channels/unixdomain/SocketOptions.java line 76:
> 74: if (!s1.equals(s2)) {
> 75: throw new RuntimeException("wrong username, we got " + s1 + " but property user.name is " + s2);
> 76: }
It might be better to use "expected" and "actual" instead of "we got" :-)
I assume you'll bump the copyright header before integrating.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17829#discussion_r1487987709
More information about the nio-dev
mailing list