Index: src/test/api/java/common/java/awt/Graphics2DTest.java =================================================================== --- src/test/api/java/common/java/awt/Graphics2DTest.java (revision 0) +++ src/test/api/java/common/java/awt/Graphics2DTest.java (revision 0) @@ -0,0 +1,43 @@ +package java.awt; + +import java.awt.image.BufferedImage; + +import junit.framework.TestCase; + +public class Graphics2DTest extends TestCase { + private Frame frame; + + protected void setUp() throws Exception { + super.setUp(); + frame = new Frame(); + frame.addNotify(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + if (frame != null) { + frame.dispose(); + } + } + + public void testSetPaintScreen() { + // regression test for HARMONY-1448 + Graphics2D g2d = (Graphics2D) frame.getGraphics(); + Paint paint = g2d.getPaint(); + assertNotNull(paint); + g2d.setPaint(null); + assertNotNull(g2d.getPaint()); + } + + public void testSetPaintImage() { + // regression test for HARMONY-1448 + int imgType = BufferedImage.TYPE_INT_ARGB; + BufferedImage img = new BufferedImage(100, 100, imgType); + Graphics2D g2d = (Graphics2D) img.getGraphics(); + Paint paint = g2d.getPaint(); + assertNotNull(paint); + g2d.setPaint(null); + assertNotNull(g2d.getPaint()); + } + +}