Changeset 16282 in josm


Ignore:
Timestamp:
2020-04-12T22:31:36+02:00 (4 years ago)
Author:
simon04
Message:

see #8352, see #19075 - Presets: fix unit tests

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java

    r16277 r16282  
    101101            combobox.setSelectedItem(originalValue);
    102102        }
    103         if ("colour".equals(key) || key.startsWith("colour:") || key.endsWith(":colour")) {
     103        if (key != null && ("colour".equals(key) || key.startsWith("colour:") || key.endsWith(":colour"))) {
    104104            p.add(combobox, GBC.std().fill(GBC.HORIZONTAL));
    105105            JButton button = new JButton(new ChooseColorAction());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java

    r9996 r16282  
    99import javax.swing.JPanel;
    1010
    11 import org.junit.BeforeClass;
     11import org.junit.Rule;
    1212import org.junit.Test;
    13 import org.openstreetmap.josm.JOSMFixture;
    1413import org.openstreetmap.josm.data.osm.OsmPrimitive;
     14import org.openstreetmap.josm.testutils.JOSMTestRules;
     15
     16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1517
    1618/**
     
    2224     * Setup test.
    2325     */
    24     @BeforeClass
    25     public static void setUp() {
    26         JOSMFixture.createUnitTestFixture().init();
    27     }
     26    @Rule
     27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     28    public JOSMTestRules test = new JOSMTestRules().main();
    2829
    2930    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java

    r9996 r16282  
    99import javax.swing.JPanel;
    1010
    11 import org.junit.BeforeClass;
     11import org.junit.Rule;
    1212import org.junit.Test;
    13 import org.openstreetmap.josm.JOSMFixture;
    1413import org.openstreetmap.josm.data.osm.OsmPrimitive;
     14import org.openstreetmap.josm.testutils.JOSMTestRules;
     15
     16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1517
    1618/**
     
    2224     * Setup test.
    2325     */
    24     @BeforeClass
    25     public static void setUp() {
    26         JOSMFixture.createUnitTestFixture().init();
    27     }
     26    @Rule
     27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     28    public JOSMTestRules test = new JOSMTestRules().main();
    2829
    2930    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java

    r9996 r16282  
    99import javax.swing.JPanel;
    1010
    11 import org.junit.BeforeClass;
     11import org.junit.Rule;
    1212import org.junit.Test;
    13 import org.openstreetmap.josm.JOSMFixture;
    1413import org.openstreetmap.josm.data.osm.OsmPrimitive;
     14import org.openstreetmap.josm.testutils.JOSMTestRules;
     15
     16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1517
    1618/**
     
    2224     * Setup test.
    2325     */
    24     @BeforeClass
    25     public static void setUp() {
    26         JOSMFixture.createUnitTestFixture().init();
    27     }
     26    @Rule
     27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     28    public JOSMTestRules test = new JOSMTestRules().main();
    2829
    2930    /**
Note: See TracChangeset for help on using the changeset viewer.