From: David Gilbert <david.gilbert@object-refinery.com>
To: mauve-patches <mauve-patches@sources.redhat.com>
Subject: FYI: ListDataEvent - new tests
Date: Fri, 16 Jun 2006 13:24:00 -0000 [thread overview]
Message-ID: <4492B176.9040101@object-refinery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 680 bytes --]
This patch (committed) adds new tests for the ListDataEvent class:
2006-06-16 David Gilbert <david.gilbert@object-refinery.com>
* gnu/testlet/javax/swing/event/ListDataEvent/constructor.java: New
file,
* gnu/testlet/javax/swing/event/ListDataEvent/getIndex0.java: New file,
* gnu/testlet/javax/swing/event/ListDataEvent/getIndex1.java: New file,
* gnu/testlet/javax/swing/event/ListDataEvent/getSource.java: New file,
* gnu/testlet/javax/swing/event/ListDataEvent/getType.java: New file,
* gnu/testlet/javax/swing/event/ListDataEvent/toString.java: New file.
I already committed a patch to GNU Classpath CVS to fix the failing tests.
Regards,
Dave
[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 11952 bytes --]
Index: gnu/testlet/javax/swing/event/ListDataEvent/constructor.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/ListDataEvent/constructor.java
diff -N gnu/testlet/javax/swing/event/ListDataEvent/constructor.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/ListDataEvent/constructor.java 16 Jun 2006 13:20:26 -0000
@@ -0,0 +1,74 @@
+/* constructor.java -- some checks for the constructor in the ListDataEvent
+ class.
+ Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.event.ListDataEvent;
+
+public class constructor implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ ListDataEvent e = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED,
+ 1, 2);
+ harness.check(e.getSource(), this);
+ harness.check(e.getType(), ListDataEvent.CONTENTS_CHANGED);
+ harness.check(e.getIndex0(), 1);
+ harness.check(e.getIndex1(), 2);
+
+ // try null source
+ boolean pass = false;
+ try
+ {
+ e = new ListDataEvent(null, ListDataEvent.CONTENTS_CHANGED, 1, 2);
+ }
+ catch (IllegalArgumentException ex)
+ {
+ pass = true;
+ }
+ harness.check(pass);
+
+ // try first index greater than second
+ e = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 99, 2);
+ harness.check(e.getIndex0(), 2);
+ harness.check(e.getIndex1(), 99);
+
+ // try bad type
+ e = new ListDataEvent(this, -99, 1, 2);
+ harness.check(e.getType(), -99);
+
+ // try negative first index
+ e = new ListDataEvent(this, -ListDataEvent.CONTENTS_CHANGED, -10, 2);
+ harness.check(e.getIndex0(), -10);
+ harness.check(e.getIndex1(), 2);
+
+ // try negative second index
+ e = new ListDataEvent(this, -ListDataEvent.CONTENTS_CHANGED, 1, -2);
+ harness.check(e.getIndex0(), -2);
+ harness.check(e.getIndex1(), 1);
+ }
+}
Index: gnu/testlet/javax/swing/event/ListDataEvent/getIndex0.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/ListDataEvent/getIndex0.java
diff -N gnu/testlet/javax/swing/event/ListDataEvent/getIndex0.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/ListDataEvent/getIndex0.java 16 Jun 2006 13:20:26 -0000
@@ -0,0 +1,42 @@
+/* getIndex0.java -- some checks for the getIndex0() method in the
+ ListDataEvent class.
+ Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.event.ListDataEvent;
+
+public class getIndex0 implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ ListDataEvent e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED,
+ 1, 2);
+ harness.check(e.getIndex0(), 1);
+ e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED, 4, 3);
+ harness.check(e.getIndex0(), 3);
+ }
+}
Index: gnu/testlet/javax/swing/event/ListDataEvent/getIndex1.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/ListDataEvent/getIndex1.java
diff -N gnu/testlet/javax/swing/event/ListDataEvent/getIndex1.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/ListDataEvent/getIndex1.java 16 Jun 2006 13:20:26 -0000
@@ -0,0 +1,42 @@
+/* getIndex1.java -- some checks for the getIndex1() method in the
+ ListDataEvent class.
+ Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.event.ListDataEvent;
+
+public class getIndex1 implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ ListDataEvent e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED,
+ 1, 2);
+ harness.check(e.getIndex1(), 2);
+ e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED, 4, 3);
+ harness.check(e.getIndex1(), 4);
+ }
+}
Index: gnu/testlet/javax/swing/event/ListDataEvent/getSource.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/ListDataEvent/getSource.java
diff -N gnu/testlet/javax/swing/event/ListDataEvent/getSource.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/ListDataEvent/getSource.java 16 Jun 2006 13:20:26 -0000
@@ -0,0 +1,40 @@
+/* getSource.java -- some checks for the getSource() method in the
+ ListDataEvent class.
+ Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.event.ListDataEvent;
+
+public class getSource implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ ListDataEvent e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED,
+ 1, 2);
+ harness.check(e.getSource(), this);
+ }
+}
Index: gnu/testlet/javax/swing/event/ListDataEvent/getType.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/ListDataEvent/getType.java
diff -N gnu/testlet/javax/swing/event/ListDataEvent/getType.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/ListDataEvent/getType.java 16 Jun 2006 13:20:26 -0000
@@ -0,0 +1,40 @@
+/* getType.java -- some checks for the getType() method in the
+ ListDataEvent class.
+ Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.event.ListDataEvent;
+
+public class getType implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ ListDataEvent e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED,
+ 1, 2);
+ harness.check(e.getType(), ListDataEvent.INTERVAL_REMOVED);
+ }
+}
Index: gnu/testlet/javax/swing/event/ListDataEvent/toString.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/ListDataEvent/toString.java
diff -N gnu/testlet/javax/swing/event/ListDataEvent/toString.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/ListDataEvent/toString.java 16 Jun 2006 13:20:26 -0000
@@ -0,0 +1,44 @@
+/* getIndex0.java -- some checks for the toString() method in the
+ ListDataEvent class.
+ Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.event.ListDataEvent;
+
+public class toString implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ ListDataEvent e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED,
+ 1, 2);
+ harness.check(e.toString(),
+ "javax.swing.event.ListDataEvent[type=2,index0=1,index1=2]");
+ e = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED, 4, 3);
+ harness.check(e.toString(),
+ "javax.swing.event.ListDataEvent[type=2,index0=3,index1=4]");
+ }
+}
reply other threads:[~2006-06-16 13:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4492B176.9040101@object-refinery.com \
--to=david.gilbert@object-refinery.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).