* Runs the test using the specified harness.
*
* @param harness the test harness (<code>null</code> not permitted).
*/
public void test(TestHarness harness) {
DefaultMetalTheme theme = new DefaultMetalTheme();
MetalLookAndFeel.setCurrentTheme(theme);
ColorUIResource c = MetalLookAndFeel.getAcceleratorForeground();
harness.check(c, theme.getAcceleratorForeground());
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
public ColorUIResource getAcceleratorForeground() {
return new ColorUIResource(Color.red);
}
});
c = MetalLookAndFeel.getAcceleratorForeground();
harness.check(c, new ColorUIResource(Color.red));
// reset the theme so that other tests won't be affected
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
}