This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: MetalComboBoxEditor tests updated
- From: David Gilbert <david dot gilbert at object-refinery dot com>
- To: mauve-patches at sources dot redhat dot com
- Date: Wed, 01 Feb 2006 10:57:41 +0000
- Subject: FYI: MetalComboBoxEditor tests updated
In JDK1.5, the insets for the MetalComboBoxEditor seem to have changed -
this patch (committed) updates our tests accordingly:
2006-02-01 David Gilbert <david.gilbert@object-refinery.com>
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/constructor.java
(test): Set DefaultMetalTheme and use correct insets,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/editorBorderInsets.java
(test): Likewise,
Updated tag to JDK1.5 for both.
Regards,
Dave
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/constructor.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/constructor.java,v
retrieving revision 1.2
diff -u -r1.2 constructor.java
--- gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/constructor.java 7 Nov 2005 21:15:51 -0000 1.2
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/constructor.java 1 Feb 2006 10:52:40 -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.
@@ -27,8 +27,12 @@
import java.awt.Insets;
import javax.swing.JTextField;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.UIResource;
+import javax.swing.plaf.metal.DefaultMetalTheme;
import javax.swing.plaf.metal.MetalComboBoxEditor;
+import javax.swing.plaf.metal.MetalLookAndFeel;
/**
* Some tests for the constructor() in the {@link MetalComboBoxEditor}
@@ -44,10 +48,20 @@
*/
public void test(TestHarness harness)
{
+ // test with DefaultMetalTheme
+ try
+ {
+ MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+ UIManager.setLookAndFeel(new MetalLookAndFeel());
+ }
+ catch (UnsupportedLookAndFeelException e)
+ {
+ e.printStackTrace();
+ }
MetalComboBoxEditor editor = new MetalComboBoxEditor();
JTextField tf = (JTextField) editor.getEditorComponent();
harness.check(tf.getColumns(), 9);
- harness.check(tf.getInsets(), new Insets(4, 2, 4, 0));
+ harness.check(tf.getInsets(), new Insets(2, 2, 2, 0));
harness.check(tf.getMargin(), new Insets(0, 0, 0, 0));
harness.check(!(tf.getInsets() instanceof UIResource));
}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/editorBorderInsets.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/editorBorderInsets.java,v
retrieving revision 1.1
diff -u -r1.1 editorBorderInsets.java
--- gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/editorBorderInsets.java 7 Nov 2005 21:15:51 -0000 1.1
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxEditor/editorBorderInsets.java 1 Feb 2006 10:52:40 -0000
@@ -1,4 +1,4 @@
-// Tags: JDK1.2
+// Tags: JDK1.5
// Uses: MyMetalComboBoxEditor
// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
@@ -27,6 +27,11 @@
import java.awt.Insets;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+
/**
* Checks the value of the editorBorderInsets field.
*/
@@ -40,8 +45,18 @@
*/
public void test(TestHarness harness)
{
+ // test with DefaultMetalTheme
+ try
+ {
+ MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+ UIManager.setLookAndFeel(new MetalLookAndFeel());
+ }
+ catch (UnsupportedLookAndFeelException e)
+ {
+ e.printStackTrace();
+ }
harness.check(MyMetalComboBoxEditor.getEditorBorderInsetsField(),
- new Insets(4, 2, 4, 0));
+ new Insets(2, 2, 2, 0));
}
}