Changeset 11635 in josm


Ignore:
Timestamp:
2017-02-26T13:44:47+01:00 (8 months ago)
Author:
Don-vip
Message:

see #12313 - fix unit tests properly

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r11626 r11635  
    6767        putValue("toolbar", "imagery_" + info.getToolbarName());
    6868        putValue("help", ht("/Preferences/Imagery"));
    69         String tooltip = info.getToolTipText();
    70         if (tooltip != null) {
    71             setTooltip(tooltip.replaceAll("</?html>", ""));
    72         }
     69        setTooltip(info.getToolTipText().replaceAll("</?html>", ""));
    7370        this.info = info;
    7471        installAdapters();
  • trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java

    r11185 r11635  
    3535    @Test
    3636    public void testEnabledState() {
    37         assertTrue(new AddImageryLayerAction(new ImageryInfo()).isEnabled());
     37        assertTrue(new AddImageryLayerAction(new ImageryInfo("foo")).isEnabled());
    3838        assertTrue(new AddImageryLayerAction(new ImageryInfo("foo_tms", "http://bar", "tms", null, null)).isEnabled());
    3939        assertTrue(new AddImageryLayerAction(new ImageryInfo("foo_bing", "http://bar", "bing", null, null)).isEnabled());
     
    7171        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
    7272        try {
    73             new AddImageryLayerAction(new ImageryInfo()).actionPerformed(null);
     73            new AddImageryLayerAction(new ImageryInfo("foo")).actionPerformed(null);
    7474        } catch (IllegalArgumentException expected) {
    7575            assertEquals("Parameter 'info.url' must not be null", expected.getMessage());
Note: See TracChangeset for help on using the changeset viewer.