Ticket #21740: 21740-junit.patch

File 21740-junit.patch, 3.6 KB (added by GerdP, 4 years ago)
  • test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java

     
    22package org.openstreetmap.josm.gui.layer;
    33
    44import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
    56import static org.junit.jupiter.api.Assertions.assertNull;
    67import static org.junit.jupiter.api.Assertions.assertSame;
    7 import static org.junit.jupiter.api.Assertions.assertThrows;
    88
    99import java.util.Arrays;
    1010
     
    1616import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
    1717import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
    1818import org.openstreetmap.josm.gui.util.GuiHelper;
     19import org.openstreetmap.josm.tools.Logging;
    1920
    2021/**
    2122 * Tests {@link MainLayerManager}.
     
    145146    void testAddActiveLayerChangeListenerTwice() {
    146147        CapturingActiveLayerChangeListener listener = new CapturingActiveLayerChangeListener();
    147148        layerManagerWithActive.addActiveLayerChangeListener(listener);
    148         assertThrows(IllegalArgumentException.class, () -> layerManagerWithActive.addActiveLayerChangeListener(listener));
     149        Logging.clearLastErrorAndWarnings();
     150        layerManagerWithActive.addActiveLayerChangeListener(listener);
     151        assertFalse(Logging.getLastErrorAndWarnings().isEmpty());
    149152    }
    150153
    151154    /**
     
    171174     */
    172175    @Test
    173176    void testRemoveActiveLayerChangeListenerNotInList() {
    174         assertThrows(IllegalArgumentException.class,
    175                 () -> layerManagerWithActive.removeActiveLayerChangeListener(new CapturingActiveLayerChangeListener()));
     177        Logging.clearLastErrorAndWarnings();
     178        layerManagerWithActive.removeActiveLayerChangeListener(new CapturingActiveLayerChangeListener());
     179        assertFalse(Logging.getLastErrorAndWarnings().isEmpty());
    176180    }
    177181
    178182    /**
  • tools/eclipse/JOSM

     
    99    <booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
    1010    <booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
    1111    <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
    12     <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
     12    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
    1313    <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.openstreetmap.josm.gui.MainApplication"/>
    1414    <stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="JOSM"/>
    15     <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--trace"/>
     15    <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--debug"/>
    1616    <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="JOSM"/>
    1717    <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xverify:none"/>
    1818</launchConfiguration>