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.defaultTextIconGap test updated to 1.5


I updated this test to JDK 1.5 as the behaviour seems to have changed:

2006-02-01 David Gilbert <david.gilbert@object-refinery.com>

* gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java
(test): Updated expected results and test tag to JDK1.5.


Regards,

Dave
Index: gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java,v
retrieving revision 1.1
diff -u -r1.1 defaultTextIconGap.java
--- gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java	2 Oct 2005 06:32:16 -0000	1.1
+++ gnu/testlet/javax/swing/plaf/basic/BasicButtonUI/defaultTextIconGap.java	1 Feb 2006 14:20:11 -0000
@@ -1,6 +1,6 @@
-// Tags: JDK1.2 
+// Tags: JDK1.5 
 
-// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+// Copyright (C) 2005, 2006 David Gilbert <david.gilbert@object-refinery.com>
 
 // This file is part of Mauve.
 
@@ -26,6 +26,10 @@
 import gnu.testlet.Testlet;
 
 import javax.swing.JButton;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+import javax.swing.plaf.metal.MetalLookAndFeel;
 
 /**
  * Checks the defaultTextIconGap field.
@@ -40,13 +44,25 @@
    */
   public void test(TestHarness harness) 
   {
+    // test with DefaultMetalTheme
+    try
+      {
+        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+        UIManager.setLookAndFeel(new MetalLookAndFeel());
+      }
+    catch (UnsupportedLookAndFeelException e)
+      {
+        e.printStackTrace();  
+      }
+    
     // 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()
+    // UPDATE: in JDK1.5, it seems this update no longer happens
     ui.installUI(new JButton());
-    harness.check(ui.getDefaultTextIconGapField(), 4);    
+    harness.check(ui.getDefaultTextIconGapField(), 0 /* 4 */);    
   }
   
 }

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