Changeset 17119 in josm for trunk/test/unit


Ignore:
Timestamp:
2020-10-08T20:26:04+02:00 (4 years ago)
Author:
simon04
Message:

see #19819 - NamedColorProperty: update Javadoc, add unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java

    r14149 r17119  
    77import java.awt.Color;
    88import java.util.Arrays;
     9import java.util.Collections;
     10
     11import javax.swing.UIManager;
    912
    1013import org.junit.Before;
     
    4346    @Test
    4447    public void testGet() {
     48        assertEquals(Color.RED, base.get());
     49
     50        UIManager.put("JOSM.clr.general.test", Color.GRAY);
     51        base = new NamedColorProperty("test", Color.RED);
     52        assertEquals(Color.GRAY, base.get());
     53
     54        Config.getPref().putList("clr.general.test", Collections.singletonList("#123456"));
     55        assertEquals(new Color(0x123456), base.get());
     56
     57        Config.getPref().putList("clr.general.test", null);
     58        UIManager.put("JOSM.clr.general.test", null);
     59        base = new NamedColorProperty("test", Color.RED);
    4560        assertEquals(Color.RED, base.get());
    4661    }
Note: See TracChangeset for help on using the changeset viewer.