This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
Re: FYI: new tests for addImpl
- From: Lillian Angel <langel at redhat dot com>
- To: mauve-patches <mauve-patches at sources dot redhat dot com>
- Date: Wed, 15 Mar 2006 10:23:08 -0500
- Subject: Re: FYI: new tests for addImpl
- References: <1142434529.2422.54.camel@tow.toronto.redhat.com>
Added more checks for the Container.addImpl patch and the Component.show
patch.
2006-03-15 Lillian Angel <langel@redhat.com>
* gnu/testlet/java/awt/Container/addImpl.java
(test1): Removed repaint function. Only need one. Also,
added repaint functions to all the components.
(test2): Added a lightweight container to the panel to
show that repaint is not called on it. Also, added a check
to show that repaint is not called on the frame when it is
shown.
On Wed, 2006-03-15 at 09:55 -0500, Lillian Angel wrote:
> Added more tests to show that my Container.addImpl patch is correct.
> repaint is not called on Sun when a component is added to a showing or
> non-showing container. Right now, with my patch, it works the same.
>
> 2006-03-15 Lillian Angel <langel@redhat.com>
>
> * gnu/testlet/java/awt/Container/addImpl.java
> (test): Changed to call new functions.
> (test1): Moved old test to new function.
> (test2): New function to test if repaint is called when a
> component is added to a showing component.
>
Index: gnu/testlet/java/awt/Container/addImpl.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Container/addImpl.java,v
retrieving revision 1.4
diff -u -r1.4 addImpl.java
--- gnu/testlet/java/awt/Container/addImpl.java 15 Mar 2006 14:54:20 -0000 1.4
+++ gnu/testlet/java/awt/Container/addImpl.java 15 Mar 2006 15:18:48 -0000
@@ -102,12 +104,7 @@
Container c = new Container()
{
TestHarness harness = transfer;
-
- public void repaint()
- {
- harness.fail("repaint has been called.");
- }
-
+
public void repaint(long tm, int x, int y, int w, int h)
{
harness.fail("repaint has been called.");
@@ -120,10 +117,22 @@
Component a = new Component()
{
+ TestHarness harness = transfer;
+
+ public void repaint(long tm, int x, int y, int w, int h)
+ {
+ harness.fail("repaint has been called.");
+ }
};
Component b = new Component()
{
+ TestHarness harness = transfer;
+
+ public void repaint(long tm, int x, int y, int w, int h)
+ {
+ harness.fail("repaint has been called.");
+ }
};
c.add(a);
@@ -134,12 +143,7 @@
Container two = new Container()
{
TestHarness harness = transfer;
-
- public void repaint()
- {
- harness.fail("repaint has been called.");
- }
-
+
public void repaint(long tm, int x, int y, int w, int h)
{
harness.fail("repaint has been called.");
@@ -185,27 +189,59 @@
public void test2(TestHarness harness)
{
- Frame f = new Frame();
final TestHarness transfer = harness;
+ Frame f = new Frame()
+ {
+ TestHarness harness = transfer;
+
+ public void repaint(long tm, int x, int y, int w, int h)
+ {
+ harness.fail("repaint has been called.");
+ }
+ };
+
Panel a = new Panel()
{
TestHarness harness = transfer;
-
- public void repaint()
+
+ public void repaint(long tm, int x, int y, int w, int h)
{
harness.fail("repaint has been called.");
}
-
+ };
+
+ Label l = new Label("!!!!!")
+ {
+ TestHarness harness = transfer;
+
public void repaint(long tm, int x, int y, int w, int h)
{
harness.fail("repaint has been called.");
}
};
- f.add(a);
- f.show();
+ Container c = new Container()
+ {
+ TestHarness harness = transfer;
+
+ public void repaint(long tm, int x, int y, int w, int h)
+ {
+ harness.fail("repaint has been called.");
+ }
+ };
- a.add(new Label("AAA"));
+ a.add(c);
+ a.add(l);
+ c.setSize(100,100);
+ f.add(a);
+ f.pack();
+ f.show();
harness.check(a.isShowing(), true);
+ harness.check(c.isShowing(), true);
+ harness.check(l.isShowing(), true);
+ harness.check(f.isShowing(), true);
+ harness.check(c.isLightweight(), true);
+ harness.check(a.isLightweight(), false);
+ harness.check(l.isLightweight(), false);
}
}