public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* Patch: Container addImpl additional checks
@ 2006-03-14 16:58 Lillian Angel
  0 siblings, 0 replies; only message in thread
From: Lillian Angel @ 2006-03-14 16:58 UTC (permalink / raw)
  To: mauve-patches

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

Added checks. Repaint should not be called when a component is added to
a Container.

2006-03-14  Lillian Angel  <langel@redhat.com>

        * gnu/testlet/java/awt/Container/addImpl.java
        (test): Formatted function and added repaint functions
        to override repaint in Container. Added fails to these 
	functions, they should not be called.


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

Index: gnu/testlet/java/awt/Container/addImpl.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Container/addImpl.java,v
retrieving revision 1.2
diff -u -r1.2 addImpl.java
--- gnu/testlet/java/awt/Container/addImpl.java	22 Jan 2006 20:14:40 -0000	1.2
+++ gnu/testlet/java/awt/Container/addImpl.java	14 Mar 2006 16:54:43 -0000
@@ -87,42 +87,68 @@
   {
     // We disable the event queue so we can check if this event is delivered
     // via the event queue or not.
-    Toolkit.getDefaultToolkit().getSystemEventQueue()
-    .push(new DisabledEventQueue());
+    Toolkit.getDefaultToolkit().getSystemEventQueue().push(new DisabledEventQueue());
 
-    Container c = new Container();
+    final TestHarness transfer = harness;
+    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.");
+      }
+    };
     c.addContainerListener(new TestContainerListener());
     // Pre-condition check.
     harness.check(c.isShowing(), false);
     componentAddedCalled = false;
-    c.add(new Component(){});
+    c.add(new Component()
+    {
+    });
     harness.check(componentAddedCalled, true);
 
     // check that LayoutManager.addLayoutComponent() is called
     // with non-null name.
     Container two = new Container();
-    final TestHarness transfer = harness;
     two.setLayout(new LayoutManager()
+    {
+      TestHarness harness = transfer;
+
+      Dimension size = new Dimension();
+
+      public void removeLayoutComponent(Component comp)
+      {
+      }
+
+      public java.awt.Dimension preferredLayoutSize(Container cont)
+      {
+        return size;
+      }
+
+      public Dimension minimumLayoutSize(Container cont)
+      {
+        return size;
+      }
+
+      public void layoutContainer(Container container)
+      {
+      }
+
+      public void addLayoutComponent(String name, Component comp)
       {
-	TestHarness harness = transfer;
-	Dimension size = new Dimension();
-	public void removeLayoutComponent(Component comp) {}
-	public java.awt.Dimension preferredLayoutSize(Container cont)
-	{
-	  return size;
-	}
-	public Dimension minimumLayoutSize(Container cont)
-	{
-	  return size;
-	}
-	public void layoutContainer(Container container) {}
-	public void addLayoutComponent(String name, Component comp)
-	{
-	  boolean pass = (name != null);
-	  harness.check(pass, true);
-	}
-      });
-    two.add(new Component() {});
+        boolean pass = (name != null);
+        harness.check(pass, true);
+      }
+    });
+    two.add(new Component()
+    {
+    });
   }
 
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-14 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-14 16:58 Patch: Container addImpl additional checks Lillian Angel

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).