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: BasicButtonUI tests


I committed this patch:

2005-10-02 David Gilbert <david.gilbert@object-refinery.com>

* gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/MyBasicButtonUI.java
(getDefaultTextIconGapField): new method,
(getDefaultTextShiftOffsetField): new method,
(setDefaultTextShiftOffsetField): new method,
(getTextShiftOffset): new method,
(setTextShiftOffset): new method,
(clearTextShiftOffset): new method,
* gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/clearTextShiftOffset.java:
New test,
* gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java:
New test,
* gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextShiftOffset.java:
New test,
* gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/getTextShiftOffset.java:
New test,
* gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/setTextShiftOffset.java:
New test.


Regards,

Dave
Index: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/MyBasicButtonUI.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/MyBasicButtonUI.java,v
retrieving revision 1.1
diff -u -r1.1 MyBasicButtonUI.java
--- gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/MyBasicButtonUI.java	30 Aug 2005 21:31:59 -0000	1.1
+++ gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/MyBasicButtonUI.java	2 Oct 2005 06:24:07 -0000
@@ -16,8 +16,8 @@
 
 // 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.
+// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+// Boston, MA 02110-1301 USA.
 
 package gnu.testlet.javax.swing.plaf.basic.BasicButtonUI;
 
@@ -32,8 +32,32 @@
   {
     super();
   }
+  public int getDefaultTextIconGapField() 
+  {
+    return this.defaultTextIconGap;
+  }
+  public int getDefaultTextShiftOffsetField()
+  {
+    return this.defaultTextShiftOffset;
+  }
+  public void setDefaultTextShiftOffsetField(int offset)
+  {
+    this.defaultTextShiftOffset = offset;
+  }
   public String getPropertyPrefix()
   {
     return super.getPropertyPrefix();
   }
+  public int getTextShiftOffset()
+  {
+    return super.getTextShiftOffset();
+  }
+  public void setTextShiftOffset()
+  {
+    super.setTextShiftOffset();
+  }
+  public void clearTextShiftOffset()
+  {
+    super.clearTextShiftOffset();
+  }
 }
Index: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/clearTextShiftOffset.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/clearTextShiftOffset.java
diff -N gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/clearTextShiftOffset.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/clearTextShiftOffset.java	2 Oct 2005 06:24:07 -0000
@@ -0,0 +1,50 @@
+// Tags: JDK1.2 
+
+// Copyright (C) 2005 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.
+
+
+package gnu.testlet.javax.swing.plaf.basic.BasicButtonUI;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Some checks for the clearTextShiftOffset() method.
+ */
+public class clearTextShiftOffset implements Testlet 
+{
+
+  /**
+   * Runs the test using the specified harness.
+   * 
+   * @param harness  the test harness (<code>null</code> not permitted).
+   */
+  public void test(TestHarness harness) 
+  {
+    MyBasicButtonUI ui = new MyBasicButtonUI();
+    harness.check(ui.getTextShiftOffset(), 0);
+    ui.setDefaultTextShiftOffsetField(99);
+    ui.setTextShiftOffset();
+    harness.check(ui.getTextShiftOffset(), 99);
+    ui.clearTextShiftOffset();
+    harness.check(ui.getTextShiftOffset(), 0);
+  }
+  
+}
Index: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java
diff -N gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java	2 Oct 2005 06:24:07 -0000
@@ -0,0 +1,52 @@
+// Tags: JDK1.2 
+
+// Copyright (C) 2005 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.
+
+
+package gnu.testlet.javax.swing.plaf.basic.BasicButtonUI;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.JButton;
+
+/**
+ * Checks the defaultTextIconGap field.
+ */
+public class defaultTextIconGap implements Testlet 
+{
+
+  /**
+   * Runs the test using the specified harness.
+   * 
+   * @param harness  the test harness (<code>null</code> not permitted).
+   */
+  public void test(TestHarness harness) 
+  {
+    // at first the field value is 0
+    MyBasicButtonUI ui = new MyBasicButtonUI();
+    harness.check(ui.getDefaultTextIconGapField(), 0);
+    
+    // the field value is updated after a call to installUI()
+    ui.installUI(new JButton());
+    harness.check(ui.getDefaultTextIconGapField(), 4);    
+  }
+  
+}
Index: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextShiftOffset.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextShiftOffset.java
diff -N gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextShiftOffset.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextShiftOffset.java	2 Oct 2005 06:24:07 -0000
@@ -0,0 +1,51 @@
+// Tags: JDK1.2 
+
+// Copyright (C) 2005 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.
+
+
+package gnu.testlet.javax.swing.plaf.basic.BasicButtonUI;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.JButton;
+
+/**
+ * Checks the defaultTextShiftOffset field.
+ */
+public class defaultTextShiftOffset implements Testlet 
+{
+
+  /**
+   * Runs the test using the specified harness.
+   * 
+   * @param harness  the test harness (<code>null</code> not permitted).
+   */
+  public void test(TestHarness harness) 
+  {
+    // at first the field is 0
+    MyBasicButtonUI ui = new MyBasicButtonUI();
+    harness.check(ui.getDefaultTextShiftOffsetField(), 0);
+    
+    // the field value is still 0 after a call to installUI()
+    ui.installUI(new JButton());
+    harness.check(ui.getDefaultTextShiftOffsetField(), 0);    
+  }
+}
Index: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/getTextShiftOffset.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/getTextShiftOffset.java
diff -N gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/getTextShiftOffset.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/getTextShiftOffset.java	2 Oct 2005 06:24:07 -0000
@@ -0,0 +1,50 @@
+// Tags: JDK1.2 
+
+// Copyright (C) 2005 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.
+
+
+package gnu.testlet.javax.swing.plaf.basic.BasicButtonUI;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Some checks for the getTextShiftOffset() method.
+ */
+public class getTextShiftOffset implements Testlet 
+{
+
+  /**
+   * Runs the test using the specified harness.
+   * 
+   * @param harness  the test harness (<code>null</code> not permitted).
+   */
+  public void test(TestHarness harness) 
+  {
+    MyBasicButtonUI ui = new MyBasicButtonUI();
+    harness.check(ui.getTextShiftOffset(), 0);
+    ui.setTextShiftOffset();
+    harness.check(ui.getTextShiftOffset(), 0);
+    ui.setDefaultTextShiftOffsetField(99);
+    ui.setTextShiftOffset();
+    harness.check(ui.getTextShiftOffset(), 99);
+  }
+  
+}
Index: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/setTextShiftOffset.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/setTextShiftOffset.java
diff -N gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/setTextShiftOffset.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/setTextShiftOffset.java	2 Oct 2005 06:24:07 -0000
@@ -0,0 +1,50 @@
+// Tags: JDK1.2 
+
+// Copyright (C) 2005 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.
+
+
+package gnu.testlet.javax.swing.plaf.basic.BasicButtonUI;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Some checks for the setTextShiftOffset() method.
+ */
+public class setTextShiftOffset implements Testlet 
+{
+
+  /**
+   * Runs the test using the specified harness.
+   * 
+   * @param harness  the test harness (<code>null</code> not permitted).
+   */
+  public void test(TestHarness harness) 
+  {
+    MyBasicButtonUI ui = new MyBasicButtonUI();
+    harness.check(ui.getTextShiftOffset(), 0);
+    ui.setTextShiftOffset();
+    harness.check(ui.getTextShiftOffset(), 0);
+    ui.setDefaultTextShiftOffsetField(99);
+    ui.setTextShiftOffset();
+    harness.check(ui.getTextShiftOffset(), 99);
+  }
+  
+}

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