RFR: 8306067: Open source AWT Graphics, GridBagLayout related tests

Sergey Bylokhov serb at openjdk.org
Mon Apr 24 18:46:11 UTC 2023


On Mon, 24 Apr 2023 03:10:38 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> test/jdk/java/awt/Graphics/GetGraphicsTest.java line 35:
>> 
>>> 33: import java.awt.Graphics;
>>> 34: 
>>> 35: public class GetGraphicsTest {
>> 
>> What this test is expected to test? the getBackground/getForeground/getFont seems to be all unused.
>
> As the test summary mentioned, it supposed to "Check getGraphics doesn't throw NullPointerExcepton for invalid colors and font"...the closed test was also like it...was applet based which is just converted to use BufferedImage.getGraphics to be a headless test..
> Seems [4746122](https://bugs.openjdk.org/browse/JDK-4746122):Failed to load applet fix is about applet,
> Once comment in the bug says 
> 
> The problem is applet overrides Component.getBackground()/getForeground() to
> return null. So SunGraphics2D is created with null params
> 
> 
>  so I guess this test is redundant now and we can remove..please suggest..

Probably we may try to extend the Frame by the GetGraphicsTest, and then get a graphics from it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13570#discussion_r1175660660



More information about the client-libs-dev mailing list