public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lillian Angel <langel@redhat.com>
To: Thomas Fitzsimmons <fitzsim@redhat.com>
Cc: David Gilbert <david.gilbert@object-refinery.com>,
	        mauve-patches <mauve-patches@sources.redhat.com>
Subject: Re: FYI: New Lightweight tests
Date: Fri, 24 Feb 2006 15:17:00 -0000	[thread overview]
Message-ID: <1140794264.3312.47.camel@tow.toronto.redhat.com> (raw)
In-Reply-To: <1140792545.3312.42.camel@tow.toronto.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

> > Also, I think this test should be simplified.  The test is:
> > 
> > A Frame containing a lighweight container.  The lightweight container
> > contains a heavyweight child.  The lightweight container is moved but
> > not resized (so that the heavyweight's position changes relative to the
> > frame but not relative to its parent).  So the test should be:
> > 
> > - show a Frame with a null layout and a green background, with
> > lightweight child at a given size and location.  inside that lightweight
> > child, add a blue heavyweight panel
> > 
> > - wait for a second
> > 
> > - call Component.move on the lightweight child
> > 
> > - check for the blue heavyweight panel's position relative to the frame
> > 
> > Without our patch, the panel will not move and so will end up in the
> > wrong location relative to the frame.  With our patch it will move along
> > with the lightweight container and end up in the right position.
> 

 Fixed. But it appears that our patch is not correct still!


2006-02-24  Lillian Angel  <langel@redhat.com>

        * gnu/testlet/java/awt/Container/LightweightContainer.java
        (testLoc2): Simplified test.


[-- Attachment #2: patch2.diff --]
[-- Type: text/x-patch, Size: 2975 bytes --]

Index: gnu/testlet/java/awt/Container/LightweightContainer.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Container/LightweightContainer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- gnu/testlet/java/awt/Container/LightweightContainer.java	23 Feb 2006 20:39:48 -0000	1.6
+++ gnu/testlet/java/awt/Container/LightweightContainer.java	24 Feb 2006 15:16:14 -0000	1.7
@@ -140,61 +140,32 @@
   {
     Robot r = harness.createRobot();
     Frame f = new Frame();
-    f.setLayout(new BorderLayout());
-
-    Panel HW = new Panel();
-    HW.setLayout (new BorderLayout());
-    HW.add (new testPanel(Color.green), BorderLayout.CENTER);
-    f.add(HW, BorderLayout.CENTER);
-    
-    testContainer LW = new testContainer();
-    GridBagLayout gridbag = new GridBagLayout();
-    GridBagConstraints c = new GridBagConstraints();
-    LW.setLayout(gridbag);
-    
-    Button b1 = new Button("Button1");
-    Button b2 = new Button("Button2");
-    Button b3 = new Button("Button3");
-    Label l = new Label("Label");
-    Panel pan = new Panel(new GridLayout(3, 2, 2, 2));
-    Label l2 = new Label("", Label.CENTER);
-
-    pan.add(l);
-    pan.add(b1);
-    pan.add(b2);
-    pan.add(b3);
-    
-    c.fill = GridBagConstraints.HORIZONTAL;
-    c.weightx = 0.0;    c.weighty = 0.0;
-    c.insets = new Insets(4, 4, 1, 1);
-    c.gridwidth = GridBagConstraints.REMAINDER;
-    c.gridwidth = 1;
-    c.gridwidth = GridBagConstraints.REMAINDER;
-    c.weightx = 1.0;    c.weighty = 1.0;
-    gridbag.setConstraints(l2, c);
-    LW.add(l2);
-    c.weightx = 1.0;    c.weighty = 0.0;
-    gridbag.setConstraints(pan, c);
-    LW.add(pan);
-    f.add(LW, BorderLayout.EAST);
-        
+    f.setLayout(null);
+    f.setBackground(Color.green);
+    testContainer tc = new testContainer();
+    f.add(tc);
     f.setSize(500, 500);
+    tc.setBounds(100, 0, 200, 200);
+    testPanel p = new testPanel(Color.yellow);
+    tc.add(p);
+    p.setBounds(10, 10, 50, 50);
     f.show();
     
-    // Wait for delay to avoid race conditions
+    // There is a delay to avoid any race conditions.
     r.waitForIdle();
-    r.delay(2000);   
+    r.delay(1000);    
+
+    Point pt = p.getLocationOnScreen();
+    tc.move(150, 50);
     
-    Point p = f.getLocationOnScreen();
-    int x = LW.getX() + f.getInsets().left + p.x - 1;
-    int y = pan.getY() + f.getInsets().top + p.y;
-    Color d = r.getPixelColor(x, y);
-    LocationTests.checkColor(harness, d, Color.blue, false);
-    Color e = r.getPixelColor(x - 2, y);
-    LocationTests.checkColor(harness, e, Color.blue, true);
+    r.delay(1000);
     
+    Point pt2 = p.getLocationOnScreen();
+    harness.check(pt2.x, (pt.x + 50));
+    harness.check(pt2.y, (pt.y + 50));
+    	    
     // There is a delay so the tester can see the result.
-    r.delay(2000);
+    r.delay(3000);
   }
   
   class testPanel extends Panel

      reply	other threads:[~2006-02-24 15:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-21 23:52 Patch: " Lillian Angel
2006-02-21 23:55 ` Lillian Angel
2006-02-22 10:04   ` David Gilbert
2006-02-22 14:48     ` Lillian Angel
2006-02-22 17:12     ` Thomas Fitzsimmons
2006-02-22  8:12 ` Roman Kennke
2006-02-22 14:49   ` Lillian Angel
2006-02-22 10:28 ` David Gilbert
2006-02-22 14:51   ` Lillian Angel
2006-02-22 15:09     ` Michael Koch
2006-02-22 15:12       ` Lillian Angel
2006-02-22 15:55         ` FYI: " Lillian Angel
2006-02-22 17:25   ` Patch: " Thomas Fitzsimmons
2006-02-22 17:47     ` FYI: " Lillian Angel
2006-02-22 18:18       ` Lillian Angel
2006-02-24  2:02         ` Thomas Fitzsimmons
2006-02-24 14:49           ` Lillian Angel
2006-02-24 15:17             ` Lillian Angel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1140794264.3312.47.camel@tow.toronto.redhat.com \
    --to=langel@redhat.com \
    --cc=david.gilbert@object-refinery.com \
    --cc=fitzsim@redhat.com \
    --cc=mauve-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).