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: TitledBorder tests - minor fix


This patch sets a known look and feel and theme, so that the tests pass when running on Sun's JDK 1.5:

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

   * gnu/testlet/javax/swing/border/TitledBorder/constructors.java
   (test): Set known look and feel and theme.

Regards,

Dave
Index: gnu/testlet/javax/swing/border/TitledBorder/constructors.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/border/TitledBorder/constructors.java,v
retrieving revision 1.1
diff -u -r1.1 constructors.java
--- gnu/testlet/javax/swing/border/TitledBorder/constructors.java	10 Oct 2005 08:06:08 -0000	1.1
+++ gnu/testlet/javax/swing/border/TitledBorder/constructors.java	1 Feb 2006 14:10:24 -0000
@@ -1,6 +1,6 @@
 // Tags: JDK1.2
 
-// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+// Copyright (C) 2005, 2006 David Gilbert <david.gilbert@object-refinery.com>
 
 // Mauve is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -26,9 +26,12 @@
 import java.awt.Font;
 
 import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.border.Border;
 import javax.swing.border.EmptyBorder;
 import javax.swing.border.TitledBorder;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+import javax.swing.plaf.metal.MetalLookAndFeel;
 
 /**
  * Some checks for the constructors of the {@link TitledBorder} 
@@ -44,6 +47,16 @@
    */
   public void test(TestHarness harness)       
   {
+    // test with DefaultMetalTheme
+    try
+      {
+        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+        UIManager.setLookAndFeel(new MetalLookAndFeel());
+      }
+    catch (UnsupportedLookAndFeelException e)
+      {
+        e.printStackTrace();  
+      }
     test1(harness);
     test2(harness);
     test3(harness);

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