* FYI: New JSlider Test
@ 2006-11-20 19:51 Tania Bento
2006-11-20 19:52 ` Tania Bento
0 siblings, 1 reply; 2+ messages in thread
From: Tania Bento @ 2006-11-20 19:51 UTC (permalink / raw)
To: mauve-patches
Hey,
This patch adds a new test to javax.swing.JSlider.setLabelTable().
Cheers,
Tania
2006-11-20 Tania Bento <tbento@redhat.com>
* gnu/testlet/javax/swing/JSlider/setLabelTable.java: Added a
new test.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: FYI: New JSlider Test
2006-11-20 19:51 FYI: New JSlider Test Tania Bento
@ 2006-11-20 19:52 ` Tania Bento
0 siblings, 0 replies; 2+ messages in thread
From: Tania Bento @ 2006-11-20 19:52 UTC (permalink / raw)
To: mauve-patches
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
Sorry... Forgot to attach the patch. Here it is.
On Mon, 2006-11-20 at 14:51 -0500, Tania Bento wrote:
> Hey,
>
> This patch adds a new test to javax.swing.JSlider.setLabelTable().
>
> Cheers,
> Tania
>
> 2006-11-20 Tania Bento <tbento@redhat.com>
>
> * gnu/testlet/javax/swing/JSlider/setLabelTable.java: Added a
> new test.
>
[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 1530 bytes --]
Index: gnu/testlet/javax/swing/JSlider/setLabelTable.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/JSlider/setLabelTable.java,v
retrieving revision 1.1
diff -u -r1.1 setLabelTable.java
--- gnu/testlet/javax/swing/JSlider/setLabelTable.java 20 Jul 2005 10:20:06 -0000 1.1
+++ gnu/testlet/javax/swing/JSlider/setLabelTable.java 20 Nov 2006 19:48:46 -0000
@@ -2,6 +2,7 @@
// Uses: MyChangeListener MyPropertyChangeListener
// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+// 2006 Red Hat
// Mauve is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -23,6 +24,7 @@
import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
+import java.util.Dictionary;
import java.util.Hashtable;
import javax.swing.JLabel;
@@ -69,6 +71,23 @@
// try null table
slider.setLabelTable(null);
harness.check(slider.getLabelTable(), null);
+
+ // This next test shows that it is not necessary to cast
+ // "list.nextElement()" to type JLabel.
+ // NOTE: With the casting, a ClassCastException was thrown.
+ boolean pass = false;
+ Dictionary labelTable = new Hashtable();
+ labelTable.put("a", "b");
+ try
+ {
+ slider.setLabelTable(labelTable);
+ pass = true;
+ }
+ catch (ClassCastException e)
+ {
+ // Do nothing.
+ }
+ harness.check(pass);
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-20 19:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-20 19:51 FYI: New JSlider Test Tania Bento
2006-11-20 19:52 ` Tania Bento
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).