From 365010ff3eb8d87eeb7d06215fe2613bada88205 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 27 Sep 2010 21:07:45 +0400 Subject: [PATCH] 6986450: javax/swing/JTable/Test6888156.java test is failing against jdk7 just on windows Reviewed-by: alexp --- jdk/test/javax/swing/JTable/Test6888156.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/jdk/test/javax/swing/JTable/Test6888156.java b/jdk/test/javax/swing/JTable/Test6888156.java index 79809e582a1..f82d8026be4 100644 --- a/jdk/test/javax/swing/JTable/Test6888156.java +++ b/jdk/test/javax/swing/JTable/Test6888156.java @@ -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 @@ public class Test6888156 { 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 class Test6888156 { 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()); + } } } -