On Tue, 31 May 2022 09:57:36 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> Ok, then will try with the _bufferedImage paint_ logic, If I'm able to get >> the exception without it been handled by internal code then it'll be really >> helpful to make it automatic. > >> > _Actually if the current test executes then its a pass right......?_ >> This means, if there is no NPE raised then its a pass case right.......? > > Yes, no NPE means the test passes successfully. If NPE is thrown, the test > fails. > >> Yeah to some extent it is automatic, I actually didn't get how to handle the >> caught NPE, so just left it so that the Test case will be failed by NPE. > > In the majority of cases, you don't want to catch exceptions in tests. No > exceptions are usually expected. An exception thrown from main makes the test > fail. > > Yet I can't see how it gets thrown from main in this particular case. It's > not important, however. Its not thrown from main I guess, its from internal code when JTable.update is called....... As I can see, painting the table to `BufferedImage` might not raise an exception in this case...... So I think its better to handle it by not handling or re-catching the NPE. I'll just remove the passFailFrame and the test case would be fine with that I guess......? ------------- PR: https://git.openjdk.java.net/jdk/pull/8830