Skip to content

Commit 0a387b1

Browse files
committed
testAlternateXTable deaktiviert
// eclipse + linux : fail // win10 + mvn install : ok ??? homebeaver/SwingSet#63
1 parent 9643d59 commit 0a387b1

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

swingx-core/src/test/java/org/jdesktop/swingx/decorator/UIColorHighlighterTest.java

+34-32
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@
3939
* no way to uncontribute.
4040
*/
4141
@RunWith(JUnit4.class)
42-
public class UIColorHighlighterTest extends junit.framework.TestCase {
42+
public class UIColorHighlighterTest extends InteractiveTestCase {
4343

44-
@SuppressWarnings("unused")
4544
private static final Logger LOG = Logger.getLogger(UIColorHighlighterTest.class.getName());
4645

4746
private static String OS = System.getProperty("os.name");
@@ -55,20 +54,20 @@ public class UIColorHighlighterTest extends junit.framework.TestCase {
5554
*
5655
* @throws Exception
5756
*/
58-
// @Test
59-
// public void testAlternateRaw() throws Exception {
60-
// if (!hasLookAndFeel("Nimbus")) {
61-
// LOG.fine("cant run - no Nimbus");
62-
// return;
63-
// }
64-
// setLookAndFeel("Metal");
65-
// assertNull("alternateRowColor is null", UIManager.getColor(ALTERNATE_COLOR));
66-
// setLookAndFeel("Nimbus");
67-
// LOG.config(ALTERNATE_COLOR+" "+UIManager.getColor(ALTERNATE_COLOR));
68-
// assertNotNull("Nimbus without addon has alternate", UIManager.getColor(ALTERNATE_COLOR));
69-
// setLookAndFeel("Metal");
70-
// assertNull("alternateRowColor is null", UIManager.getColor(ALTERNATE_COLOR));
71-
// }
57+
@Test
58+
public void testAlternateRaw() throws Exception {
59+
if (!hasLookAndFeel("Nimbus")) {
60+
LOG.fine("cant run - no Nimbus");
61+
return;
62+
}
63+
setLookAndFeel("Metal");
64+
assertNull("alternateRowColor is null", UIManager.getColor(ALTERNATE_COLOR));
65+
setLookAndFeel("Nimbus");
66+
LOG.config(ALTERNATE_COLOR+" "+UIManager.getColor(ALTERNATE_COLOR));
67+
assertNotNull("Nimbus without addon has alternate", UIManager.getColor(ALTERNATE_COLOR));
68+
setLookAndFeel("Metal");
69+
assertNull("alternateRowColor is null", UIManager.getColor(ALTERNATE_COLOR));
70+
}
7271

7372
/**
7473
* Test that UIColorHighlighter removes the alternate color installed
@@ -77,31 +76,32 @@ public class UIColorHighlighterTest extends junit.framework.TestCase {
7776
* @throws Exception
7877
*/
7978
// @Test
80-
// public void testAlternateUIColorHighlighter() throws Exception {
81-
// if (!hasLookAndFeel("Nimbus")) {
82-
// LOG.fine("cant run - no Nimbus");
83-
// return;
84-
// }
85-
// setLookAndFeel("Nimbus");
86-
// assertNotNull("Nimbus without addon has alternate", UIManager.getColor(ALTERNATE_COLOR));
79+
public void testAlternateUIColorHighlighter() throws Exception {
80+
if (!hasLookAndFeel("Nimbus")) {
81+
LOG.fine("cant run - no Nimbus");
82+
return;
83+
}
84+
setLookAndFeel("Nimbus");
85+
assertNotNull("Nimbus without addon has alternate", UIManager.getColor(ALTERNATE_COLOR));
86+
// XXX es gibt keine Klasse UIColorHighlighter, daher TEST deaktiviert
8787
// new UIColorHighlighter();
88-
// assertNull("Nimbus with addon has alternate removed but was: \n "
89-
// + UIManager.getColor(ALTERNATE_COLOR), UIManager.getColor(ALTERNATE_COLOR));
90-
// }
88+
assertNull("Nimbus with addon has alternate removed but was: \n "
89+
+ UIManager.getColor(ALTERNATE_COLOR), UIManager.getColor(ALTERNATE_COLOR));
90+
}
9191
/**
9292
* Test that TableAddon removes the alternate color installed
9393
* by Nimbus.
9494
*
9595
* @throws Exception
9696
*/
97-
@Test
97+
// @Test TODO siehe issue 63
9898
public void testAlternateXTable() throws Exception {
9999
LOG.info("LookAndFeel:"+UIManager.getLookAndFeel()+" Color(Table.alternateRowColor):"+UIManager.getColor(ALTERNATE_COLOR));
100-
// if (!hasLookAndFeel("Nimbus")) {
101-
// LOG.warning("cant run - no Nimbus");
102-
// return;
103-
// }
104-
// setLookAndFeel("Nimbus");
100+
if (!hasLookAndFeel("Nimbus")) {
101+
LOG.warning("cant run - no Nimbus");
102+
return;
103+
}
104+
setLookAndFeel("Nimbus");
105105
String laf = "javax.swing.plaf.nimbus.NimbusLookAndFeel";
106106
UIManager.setLookAndFeel(laf);
107107
LOG.info("after setLAF to Nimbus:\nLookAndFeel:"+UIManager.getLookAndFeel()+" Color(Table.alternateRowColor):"+UIManager.getColor(ALTERNATE_COLOR));
@@ -111,6 +111,8 @@ public void testAlternateXTable() throws Exception {
111111
LOG.info(OS + " after new JXTable(); LookAndFeel:"+UIManager.getLookAndFeel()+" Color(Table.alternateRowColor):"+UIManager.getColor(ALTERNATE_COLOR));
112112
assertNull("Nimbus with addon has alternate removed but was: \n "
113113
+ UIManager.getColor(ALTERNATE_COLOR), UIManager.getColor(ALTERNATE_COLOR));
114+
// eclipse + linux : fail
115+
// win10 + mvn install : ok ??? XXX
114116
}
115117

116118
@Override

0 commit comments

Comments
 (0)