6986450: javax/swing/JTable/Test6888156.java test is failing against jdk7 just on windows
authormalenkov
Mon, 27 Sep 2010 21:07:45 +0400
changeset 6659 8add9a1f278a
parent 6658 f7a9cf17fed4
child 6660 7bc303389b4f
6986450: javax/swing/JTable/Test6888156.java test is failing against jdk7 just on windows Reviewed-by: alexp
jdk/test/javax/swing/JTable/Test6888156.java
--- a/jdk/test/javax/swing/JTable/Test6888156.java	Mon Sep 27 11:30:03 2010 -0400
+++ b/jdk/test/javax/swing/JTable/Test6888156.java	Mon Sep 27 21:07:45 2010 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,14 +71,14 @@
         table = new JTable(model);
     }
 
-    public void test(final LookAndFeel laf) throws Exception {
+    public void test(final String laf) throws Exception {
         SwingUtilities.invokeAndWait(new Runnable() {
             @Override public void run() {
                 try {
+                    System.out.println(laf);
                     UIManager.setLookAndFeel(laf);
-                } catch (UnsupportedLookAndFeelException e) {
-                    System.err.println(laf.getDescription() +
-                                       " is unsupported; continuing");
+                } catch (Exception e) {
+                    System.err.println(laf + " is unsupported; continuing");
                     return;
                 }
                 SwingUtilities.updateComponentTreeUI(table);
@@ -92,8 +92,10 @@
 
     public static void main(String[] args) throws Exception {
         Test6888156 t = new Test6888156();
-        t.test(new javax.swing.plaf.nimbus.NimbusLookAndFeel());
-        t.test(new com.sun.java.swing.plaf.gtk.GTKLookAndFeel());
+        t.test("javax.swing.plaf.nimbus.NimbusLookAndFeel");
+        t.test("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+        for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
+            t.test(laf.getClassName());
+        }
     }
 }
-