* FYI: javax.swing.UIManager test fixes
@ 2006-01-28 22:32 David Gilbert
0 siblings, 0 replies; only message in thread
From: David Gilbert @ 2006-01-28 22:32 UTC (permalink / raw)
To: mauve-patches
[-- Attachment #1: Type: text/plain, Size: 489 bytes --]
A couple of tests were failing because they assumed the UIManager was in
a clean state, whereas in fact it can be updated by tests run
previously. This patch is committed:
2006-01-28 David Gilbert <david.gilbert@object-refinery.com>
* gnu/testlet/javax/swing/UIManager/addPropertyChangeListener.java
(test): Don't assume there are zero listeners at start of test,
* gnu/testlet/javax/swing/UIManager/getPropertyChangeListeners.java
(test): Likewise.
Regards,
Dave
[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 4042 bytes --]
Index: gnu/testlet/javax/swing/UIManager/addPropertyChangeListener.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/UIManager/addPropertyChangeListener.java,v
retrieving revision 1.1
diff -u -r1.1 addPropertyChangeListener.java
--- gnu/testlet/javax/swing/UIManager/addPropertyChangeListener.java 23 Aug 2005 13:53:36 -0000 1.1
+++ gnu/testlet/javax/swing/UIManager/addPropertyChangeListener.java 28 Jan 2006 22:26:12 -0000
@@ -1,6 +1,6 @@
// Tags: JDK1.4
-// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+// Copyright (C) 2005, 2006 David Gilbert <david.gilbert@object-refinery.com>
// Mauve is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,9 +13,9 @@
// 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. */
+// along with Mauve; see the file COPYING. If not, write to the
+// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301 USA.
package gnu.testlet.javax.swing.UIManager;
@@ -42,17 +42,17 @@
{
// check that there are no listeners
PropertyChangeListener[] listeners = UIManager.getPropertyChangeListeners();
- harness.check(listeners.length, 0);
+ int count = listeners.length;
// now add a listener
UIManager.addPropertyChangeListener(this);
listeners = UIManager.getPropertyChangeListeners();;
- harness.check(listeners.length, 1);
- harness.check(listeners[0], this);
+ harness.check(listeners.length, count + 1);
+ harness.check(listeners[count], this);
// try adding a null listener - it gets silently ignored
UIManager.addPropertyChangeListener(null);
- harness.check(listeners.length, 1);
+ harness.check(listeners.length, count + 1);
}
public void propertyChange(PropertyChangeEvent e)
Index: gnu/testlet/javax/swing/UIManager/getPropertyChangeListeners.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/UIManager/getPropertyChangeListeners.java,v
retrieving revision 1.1
diff -u -r1.1 getPropertyChangeListeners.java
--- gnu/testlet/javax/swing/UIManager/getPropertyChangeListeners.java 23 Aug 2005 13:53:36 -0000 1.1
+++ gnu/testlet/javax/swing/UIManager/getPropertyChangeListeners.java 28 Jan 2006 22:26:12 -0000
@@ -1,6 +1,6 @@
// Tags: JDK1.4
-// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+// Copyright (C) 2005, 2006 David Gilbert <david.gilbert@object-refinery.com>
// Mauve is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,9 +13,9 @@
// 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. */
+// along with Mauve; see the file COPYING. If not, write to the
+// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301 USA.
package gnu.testlet.javax.swing.UIManager;
@@ -42,13 +42,13 @@
{
// check that there are no listeners
PropertyChangeListener[] listeners = UIManager.getPropertyChangeListeners();
- harness.check(listeners.length, 0);
+ int count = listeners.length;
// now add a listener
UIManager.addPropertyChangeListener(this);
listeners = UIManager.getPropertyChangeListeners();;
- harness.check(listeners.length, 1);
- harness.check(listeners[0], this);
+ harness.check(listeners.length, count + 1);
+ harness.check(listeners[count], this);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-01-28 22:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-28 22:32 FYI: javax.swing.UIManager test fixes David Gilbert
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).