This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: CardLayout tests
- From: Tania Bento <tbento at redhat dot com>
- To: mauve-patches at sources dot redhat dot com
- Date: Wed, 18 Oct 2006 17:40:35 -0400
- Subject: FYI: CardLayout tests
Hey,
These two new mauve tests checks what happens when the
maximumLayoutSize() and minimumLayoutSize() methods are called with null
as its argument.
In maximumLayoutSize(), a new Dimension with Integer.MAX_VALUE as its
width and height values should be thrown and not a NullPointerException.
However, minimumLayoutSize() remain as it is and throw a
NullPointerException.
I will be committing the fix in maximumLayoutSize() shortly.
Tania
2006-10-18 Tania Bento <tbento@redhat.com>
* gnu/testlet/java/awt/CardLayout/testMaximumLayoutSize.java:
New test.
* gnu/testlet/java/awt/CardLayout/testMinimumLayoutSize.java:
New test.
Index: gnu/testlet/java/awt/CardLayout/testMaximumLayoutSize.java
===================================================================
RCS file: gnu/testlet/java/awt/CardLayout/testMaximumLayoutSize.java
diff -N gnu/testlet/java/awt/CardLayout/testMaximumLayoutSize.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/awt/CardLayout/testMaximumLayoutSize.java 18 Oct 2006 21:40:02 -0000
@@ -0,0 +1,42 @@
+/* testMaximumLayout.java
+ Copyright (C) 2006 Red Hat
+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: 1.4
+
+package gnu.testlet.java.awt.CardLayout;
+
+import java.awt.CardLayout;
+import java.awt.Dimension;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+public class testMaximumLayoutSize implements Testlet
+{
+
+ public void test(TestHarness harness)
+ {
+ CardLayout layout = new CardLayout();
+ harness.check(layout.maximumLayoutSize(null),
+ new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
+ }
+
+}
Index: gnu/testlet/java/awt/CardLayout/testMinimumLayoutSize.java
===================================================================
RCS file: gnu/testlet/java/awt/CardLayout/testMinimumLayoutSize.java
diff -N gnu/testlet/java/awt/CardLayout/testMinimumLayoutSize.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/awt/CardLayout/testMinimumLayoutSize.java 18 Oct 2006 21:40:02 -0000
@@ -0,0 +1,49 @@
+/* testMinimumLayoutSize.java
+ Copyright (C) 2006 Red Hat
+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: 1.4
+
+package gnu.testlet.java.awt.CardLayout;
+
+import java.awt.CardLayout;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+public class testMinimumLayoutSize implements Testlet
+{
+
+ public void test(TestHarness harness)
+ {
+ CardLayout layout = new CardLayout();
+ boolean failed = false;
+ try
+ {
+ layout.minimumLayoutSize(null);
+ }
+ catch (NullPointerException e)
+ {
+ failed = true;
+ }
+ harness.check(failed);
+ }
+
+}