Changeset 11181 in josm for trunk


Ignore:
Timestamp:
2016-10-28T11:50:35+02:00 (3 years ago)
Author:
simon04
Message:

see #13828 - Fix unit test

Location:
trunk
Files:
2 edited

Legend:

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

    r11174 r11181  
    7575            }
    7676        } catch (IllegalArgumentException ex) {
    77             if (ex.getMessage() == null || ex.getMessage().isEmpty()) {
     77            if (ex.getMessage() == null || ex.getMessage().isEmpty() || GraphicsEnvironment.isHeadless()) {
    7878                throw ex;
    7979            } else {
  • trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java

    r10739 r11181  
    7171    public void testActionPerformedDisabled() {
    7272        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
    73         new AddImageryLayerAction(new ImageryInfo()).actionPerformed(null);
     73        try {
     74            new AddImageryLayerAction(new ImageryInfo()).actionPerformed(null);
     75        } catch (IllegalArgumentException expected) {
     76            assertEquals("Parameter 'info.url' must not be null", expected.getMessage());
     77        }
    7478        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
    7579    }
Note: See TracChangeset for help on using the changeset viewer.