This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
Re: Patch: TestPanelRepaint new class
> Looks good except that this should go in gnu/testlet/java/awt/Panel
> instead.
Moved.
I made the mistake because we were testing to see if Container's
update/paint was called.
2006-03-06 Lillian Angel <langel@redhat.com>
* gnu/testlet/java/awt/Container/TestPanelRepaint.java:
Removed Class.
* gnu/testlet/java/awt/Panel: New Directory.
* gnu/testlet/java/awt/Panel/TestPanelRepaint:
New Class.
Index: gnu/testlet/java/awt/Container/TestPanelRepaint.java
===================================================================
RCS file: gnu/testlet/java/awt/Container/TestPanelRepaint.java
diff -N gnu/testlet/java/awt/Container/TestPanelRepaint.java
--- gnu/testlet/java/awt/Container/TestPanelRepaint.java 6 Mar 2006 21:53:49 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,104 +0,0 @@
-/* TestPanelRepaint.java --
- Copyright (C) 2006 Red Hat
-This file is part of Mauve.
-
-Mauve is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-Mauve is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Mauve; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-*/
-
-
-package gnu.testlet.java.awt.Container;
-
-import gnu.testlet.TestHarness;
-import gnu.testlet.Testlet;
-
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.List;
-import java.awt.Panel;
-import java.awt.Robot;
-import java.awt.event.ComponentEvent;
-
-public class TestPanelRepaint
- implements Testlet
-{
- TestHarness harness;
-
- public void test(TestHarness harness)
- {
- this.harness = harness;
- myPanel p = new myPanel();
- p.add(new List(10));
- Frame f = new Frame();
- f.add(p);
- f.pack();
- f.show();
-
- Robot r = harness.createRobot();
- // There is a delay to avoid any race conditions.
- r.waitForIdle();
- r.delay(1000);
-
- f.move(100, 100);
-
- r.delay(1000);
-
- f.setSize(400, 400);
-
- // There is a delay so the tester can see the result.
- r.delay(3000);
- }
-
- public class myPanel
- extends Panel
- {
- public myPanel()
- {
- super();
- }
-
- public void update(Graphics g)
- {
- harness.fail("Update should not be called!");
- super.update(g);
- }
-
- public void paint(Graphics g)
- {
- super.paint(g);
- }
-
- public void componentResized(ComponentEvent e)
- {
- repaint();
- }
-
- public void componentMoved(ComponentEvent e)
- {
- repaint();
- }
-
- public void componentShown(ComponentEvent e)
- {
- repaint();
- }
-
- public void componentHidden(ComponentEvent e)
- {
- repaint();
- }
- }
-}
Index: gnu/testlet/java/awt/Panel/TestPanelRepaint.java
===================================================================
RCS file: gnu/testlet/java/awt/Panel/TestPanelRepaint.java
diff -N gnu/testlet/java/awt/Panel/TestPanelRepaint.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/awt/Panel/TestPanelRepaint.java 6 Mar 2006 22:27:01 -0000
@@ -0,0 +1,99 @@
+/* TestPanelRepaint.java --
+ Copyright (C) 2006 Red Hat
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+
+package gnu.testlet.java.awt.Panel;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.List;
+import java.awt.Panel;
+import java.awt.Robot;
+import java.awt.event.ComponentEvent;
+
+public class TestPanelRepaint
+ implements Testlet
+{
+ TestHarness harness;
+
+ public void test(TestHarness harness)
+ {
+ this.harness = harness;
+ myPanel p = new myPanel();
+ p.add(new List(10));
+ Frame f = new Frame();
+ f.add(p);
+ f.pack();
+ f.show();
+
+ Robot r = harness.createRobot();
+ // There is a delay to avoid any race conditions.
+ r.waitForIdle();
+ r.delay(1000);
+
+ f.move(100, 100);
+
+ r.delay(1000);
+
+ f.setSize(400, 400);
+
+ // There is a delay so the tester can see the result.
+ r.delay(3000);
+ }
+
+ public class myPanel
+ extends Panel
+ {
+ public myPanel()
+ {
+ super();
+ }
+
+ public void update(Graphics g)
+ {
+ harness.fail("Update should not be called!");
+ super.update(g);
+ }
+
+ public void componentResized(ComponentEvent e)
+ {
+ repaint();
+ }
+
+ public void componentMoved(ComponentEvent e)
+ {
+ repaint();
+ }
+
+ public void componentShown(ComponentEvent e)
+ {
+ repaint();
+ }
+
+ public void componentHidden(ComponentEvent e)
+ {
+ repaint();
+ }
+ }
+}