* FYI: a new JTAbbedPane test
@ 2006-07-26 15:22 Robert Schuster
0 siblings, 0 replies; only message in thread
From: Robert Schuster @ 2006-07-26 15:22 UTC (permalink / raw)
To: mauve-patches
[-- Attachment #1.1: Type: text/plain, Size: 214 bytes --]
Hi,
the attached patch adds a small test for JTabbedPane.remove.
ChangeLog:
2006-07-25 Robert Schuster <robertschuster@fsfe.org>
* gnu/testlet/javax/swing/JTabbedPane/remove.java: New test.
cya
Robert
[-- Attachment #1.2: mauve-jtp-remove.diff --]
[-- Type: text/x-patch, Size: 3449 bytes --]
Index: gnu/testlet/javax/swing/JTabbedPane/remove.java
===================================================================
RCS file: gnu/testlet/javax/swing/JTabbedPane/remove.java
diff -N gnu/testlet/javax/swing/JTabbedPane/remove.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JTabbedPane/remove.java 26 Jul 2006 15:19:17 -0000
@@ -0,0 +1,98 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2006 Robert Schuster <robertschuster@fsfe.org>
+
+// 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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JTabbedPane;
+
+import gnu.testlet.Testlet;
+import gnu.testlet.TestHarness;
+import javax.swing.JTabbedPane;
+import javax.swing.JPanel;
+import javax.swing.plaf.UIResource;
+
+public class remove implements Testlet {
+
+ boolean touched_removeTabAt;
+ boolean touched_remove;
+
+ public void test(TestHarness harness) {
+ JTabbedPane tp = new MyTabbedPane();
+
+ harness.checkPoint("remove");
+
+ // The removal of a component which is an instance of
+ // UIResource *should not* provoke a call to
+ // JTabbedPane.remove(int) (if it is not a tab
+ // component).
+ touched_remove = false;
+ touched_removeTabAt = false;
+ JPanel p = new MyPanel();
+ tp.add(p);
+ tp.remove(p);
+ harness.check(touched_remove, false);
+ harness.check(touched_removeTabAt, false);
+
+ // The removal of a component which is an instance of
+ // UIResource *should* provoke a call to
+ // JTabbedPane.remove(int) if it *is* a tab
+ // component.
+ touched_remove = false;
+ touched_removeTabAt = false;
+ p = new MyPanel();
+ // The next line makes this UIResource implementing object a tab
+ // component although that is normally not done.
+ tp.addTab("foo", p);
+ tp.remove(p);
+ harness.check(touched_remove, false);
+ harness.check(touched_removeTabAt, true);
+
+ // The removal of a component which *is not* an instance of
+ // UIResource *should* provoke a call to JTabbedPane.remove(int).
+ touched_remove = false;
+ touched_removeTabAt = false;
+ p = new JPanel();
+ tp.add(p);
+ tp.remove(p);
+ harness.check(touched_remove, false);
+ harness.check(touched_removeTabAt, true);
+ }
+
+ static class MyPanel extends JPanel implements UIResource
+ {
+ }
+
+ class MyTabbedPane extends JTabbedPane
+ {
+
+ public void remove(int i)
+ {
+ touched_remove = true;
+ super.remove(i);
+ }
+
+ public void removeTabAt(int i)
+ {
+ touched_removeTabAt = true;
+ super.removeTabAt(i);
+ }
+
+ }
+
+}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 253 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-26 15:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-26 15:22 FYI: a new JTAbbedPane test Robert Schuster
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).