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: MetalLookAndFeel test updates


This patch updates a couple of tests so that they pass on JDK 1.5:

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

* gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/getAcceleratorForeground.java
(test): Set theme then check color against theme,
* gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/setCurrentTheme.java
(test): Likewise.


Regards,

Dave
Index: gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/getAcceleratorForeground.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/getAcceleratorForeground.java,v
retrieving revision 1.4
diff -u -r1.4 getAcceleratorForeground.java
--- gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/getAcceleratorForeground.java	1 Feb 2006 09:46:34 -0000	1.4
+++ gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/getAcceleratorForeground.java	1 Feb 2006 16:37:53 -0000
@@ -40,9 +40,10 @@
    * @param harness  the test harness (<code>null</code> not permitted).
    */
   public void test(TestHarness harness) {
-    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+    DefaultMetalTheme theme = new DefaultMetalTheme();
+    MetalLookAndFeel.setCurrentTheme(theme);
     ColorUIResource c = MetalLookAndFeel.getAcceleratorForeground();
-    harness.check(c, new ColorUIResource(new Color(99, 130, 191)));
+    harness.check(c, theme.getAcceleratorForeground());
 
     MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
       public ColorUIResource getAcceleratorForeground() {
Index: gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/setCurrentTheme.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/setCurrentTheme.java,v
retrieving revision 1.4
diff -u -r1.4 setCurrentTheme.java
--- gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/setCurrentTheme.java	1 Feb 2006 09:46:34 -0000	1.4
+++ gnu/testlet/javax/swing/plaf/metal/MetalLookAndFeel/setCurrentTheme.java	1 Feb 2006 16:37:53 -0000
@@ -21,8 +21,8 @@
 
 package gnu.testlet.javax.swing.plaf.metal.MetalLookAndFeel;
 
-import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
 
 import java.awt.Color;
 
@@ -39,10 +39,11 @@
 {
   public void test(TestHarness h)
   {
-    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+    DefaultMetalTheme theme = new DefaultMetalTheme();
+    MetalLookAndFeel.setCurrentTheme(theme);
     MetalLookAndFeel laf = new MetalLookAndFeel();
     Color c1 = laf.getDefaults().getColor("Button.background");
-    h.check(c1, new Color(238, 238, 238));
+    h.check(c1, theme.getControl());
     MetalLookAndFeel.setCurrentTheme(new TestTheme());
     c1 = laf.getDefaults().getColor("Button.background");
     h.check(c1, Color.red);

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