This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: InternalFrameEvent tests


This patch (committed) adds some tests for the InternalFrameEvent class:

2006-06-07 David Gilbert <david.gilbert@object-refinery.com>

* gnu/testlet/javax/swing/event/InternalFrameEvent/constructor.java:
New file,
* gnu/testlet/javax/swing/event/InternalFrameEvent/getInternalFrame.java:
New file,
* gnu/testlet/javax/swing/event/InternalFrameEvent/paramString.java:
New file.


Regards,

Dave
Index: gnu/testlet/javax/swing/event/InternalFrameEvent/constructor.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/InternalFrameEvent/constructor.java
diff -N gnu/testlet/javax/swing/event/InternalFrameEvent/constructor.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/InternalFrameEvent/constructor.java	7 Jun 2006 21:42:51 -0000
@@ -0,0 +1,59 @@
+/* constructor.java -- some checks for the constructor in the
+       InternalFrameEvent 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.InternalFrameEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.JInternalFrame;
+import javax.swing.event.InternalFrameEvent;
+
+public class constructor implements Testlet
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    InternalFrameEvent e = new InternalFrameEvent(f, 
+            InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
+    harness.check(e.getID(), InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
+    harness.check(e.getInternalFrame(), f);
+    
+    // null frame
+    boolean pass = false;
+    try
+    {
+      e = new InternalFrameEvent(null, InternalFrameEvent.INTERNAL_FRAME_CLOSED);
+    }
+    catch (IllegalArgumentException event)
+    {
+      pass = true;
+    }
+    harness.check(pass);
+    
+    // unrecognised id
+    e = new InternalFrameEvent(f, -999);
+    harness.check(e.getID(), -999);
+  }
+}
Index: gnu/testlet/javax/swing/event/InternalFrameEvent/getInternalFrame.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/InternalFrameEvent/getInternalFrame.java
diff -N gnu/testlet/javax/swing/event/InternalFrameEvent/getInternalFrame.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/InternalFrameEvent/getInternalFrame.java	7 Jun 2006 21:42:51 -0000
@@ -0,0 +1,49 @@
+/* getInternalFrame.java -- some checks for the getInternalFrame()
+       method in the InternalFrameEvent 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.InternalFrameEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.JInternalFrame;
+import javax.swing.event.InternalFrameEvent;
+
+public class getInternalFrame implements Testlet
+{
+  public void test(TestHarness harness) 
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    InternalFrameEvent e = new InternalFrameEvent(f, 
+            InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
+    harness.check(e.getInternalFrame(), f);
+    
+    JInternalFrame f2 = new JInternalFrame("Title2");
+    e.setSource(f2);
+    harness.check(e.getInternalFrame(), f2);
+    
+    e.setSource(null);
+    harness.check(e.getInternalFrame(), null);
+  }
+}
\ No newline at end of file
Index: gnu/testlet/javax/swing/event/InternalFrameEvent/paramString.java
===================================================================
RCS file: gnu/testlet/javax/swing/event/InternalFrameEvent/paramString.java
diff -N gnu/testlet/javax/swing/event/InternalFrameEvent/paramString.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/event/InternalFrameEvent/paramString.java	7 Jun 2006 21:42:52 -0000
@@ -0,0 +1,56 @@
+/* paramString.java -- some checks for the paramString() method in the
+       InternalFrameEvent 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.InternalFrameEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.JInternalFrame;
+import javax.swing.event.InternalFrameEvent;
+
+public class paramString implements Testlet
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    InternalFrameEvent e = new InternalFrameEvent(f, 
+            InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
+    harness.check(e.paramString(), "INTERNAL_FRAME_ACTIVATED");
+    e = new InternalFrameEvent(f, InternalFrameEvent.INTERNAL_FRAME_CLOSED);
+    harness.check(e.paramString(), "INTERNAL_FRAME_CLOSED"); 
+    e = new InternalFrameEvent(f, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
+    harness.check(e.paramString(), "INTERNAL_FRAME_CLOSING");  
+    e = new InternalFrameEvent(f, InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED);
+    harness.check(e.paramString(), "INTERNAL_FRAME_DEACTIVATED");  
+    e = new InternalFrameEvent(f, InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
+    harness.check(e.paramString(), "INTERNAL_FRAME_DEICONIFIED");  
+    e = new InternalFrameEvent(f, InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
+    harness.check(e.paramString(), "INTERNAL_FRAME_ICONIFIED");  
+    e = new InternalFrameEvent(f, InternalFrameEvent.INTERNAL_FRAME_OPENED);
+    harness.check(e.paramString(), "INTERNAL_FRAME_OPENED");  
+    e = new InternalFrameEvent(f, InternalFrameEvent.RESERVED_ID_MAX);
+    harness.check(e.paramString(), "unknown type");  
+  }
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]