RFR: 8353138: Screen capture for test TaskbarPositionTest.java, failure case [v3]

Alexey Ivanov aivanov at openjdk.org
Thu Apr 3 13:10:55 UTC 2025


On Thu, 3 Apr 2025 12:38:47 GMT, Renjith Kannath Pariyangad <rkannathpari at openjdk.org> wrote:

>> Hi Reviewers,
>> 
>> Added screen capture in case of test failure using Robot. 
>> 
>> Please review and let me know your suggestion if any.
>
> Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updated based on suggesion

Changes requested by aivanov (Reviewer).

test/jdk/javax/swing/Popup/TaskbarPositionTest.java line 223:

> 221:         } catch (IOException e) {
> 222:             e.printStackTrace();
> 223:         }

It's not quite what I wanted to see…


    private static void saveScreenCapture(Robot robot, GraphicsDevice[] screens) {
        for (int i = 0; i < screens.length; i++) {
            Rectangle bounds = screens[i].getDefaultConfiguration()
                                         .getBounds();
            BufferedImage image = robot.createScreenCapture(bounds);
            try {
                ImageIO.write(image, "png",
                              new File("Screenshot" + i + ".png"));
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

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

PR Review: https://git.openjdk.org/jdk/pull/24286#pullrequestreview-2739774588
PR Review Comment: https://git.openjdk.org/jdk/pull/24286#discussion_r2026955609


More information about the client-libs-dev mailing list