This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: TestPanelRepaint fix


Removed the unnecessary stuff from the patch to make it more readable.

On Wed, 2006-03-29 at 18:18 -0500, Lillian Angel wrote:
> Fixed up this test. It was incorrectly testing update.
> 
> 2006-03-29  Lillian Angel  <langel@redhat.com>
> 
>         * gnu/testlet/java/awt/Panel/TestPanelRepaint.java
>         (test): Added check.
>         (myPanel): Added component listener.
> 
Index: gnu/testlet/java/awt/Panel/TestPanelRepaint.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Panel/TestPanelRepaint.java,v
retrieving revision 1.1
diff -u -r1.1 TestPanelRepaint.java
--- gnu/testlet/java/awt/Panel/TestPanelRepaint.java	6 Mar 2006 22:28:34 -0000	1.1
+++ gnu/testlet/java/awt/Panel/TestPanelRepaint.java	29 Mar 2006 23:14:40 -0000
@@ -30,16 +30,19 @@
 import java.awt.List;
 import java.awt.Panel;
 import java.awt.Robot;
-import java.awt.event.ComponentEvent;
+import java.awt.event.*;
 
 public class TestPanelRepaint
     implements Testlet
 {
   TestHarness harness;
-
+  Robot r;
+  boolean updateCalled;
+  
   public void test(TestHarness harness)
   {
     this.harness = harness;
+    r = harness.createRobot();
     myPanel p = new myPanel();
     p.add(new List(10));
     Frame f = new Frame();
@@ -47,32 +50,33 @@
     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);
+    r.delay(3000);
     
     f.setSize(400, 400);
     
     // There is a delay so the tester can see the result.
     r.delay(3000);
+    harness.check(updateCalled);
   }
 
   public class myPanel
-      extends Panel
+      extends Panel implements ComponentListener
   {
     public myPanel()
     {
       super();
+      addComponentListener(this);
     }
 
     public void update(Graphics g)
     {
-      harness.fail("Update should not be called!");
+      updateCalled = true;
       super.update(g);
     }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]