On Fri, 28 Nov 2025 07:26:28 GMT, Alexander Zvegintsev <[email protected]> 
wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Automate test
>
> test/jdk/javax/swing/DefaultTableCellRenderer/DefRendererSerialize.java line 
> 62:
> 
>> 60:     static JFrame createTestUI() {
>> 61:       String[][] rowData = { {"1-1","1-2","1-3"},
>> 62:                              {"2-1","2-2","2-3"},
> 
> I guess the test could be automated.
> 
> e.g. if we leave the central cell blank:
> 
> Suggestion:
> 
>                              {"2-1","","2-3"},
> 
> We can safely retrieve the pixel color from the center of the cell and check 
> it against the white color
> 
> 
> Rectangle tableRect = table.getCellRect(1, 1, true);
> Point tableOnScreen = table.getLocationOnScreen();
> 
> Point p = new Point(
>         tableOnScreen.x + tableRect.x + tableRect.width / 2,
>         tableOnScreen.y + tableRect.y + tableRect.height / 2
> );
> 
> Color pixelColor = robot.getPixelColor(p.x, p.y);
> // ... color check

Thanks for the suggestion.
Test automated and color check before/after serialization/desrialization added

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28549#discussion_r2575810667

Reply via email to