Changeset 11110 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-10-09T13:47:44+02:00 (3 years ago)
Author:
Don-vip
Message:

add more unit tests

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java

    r11109 r11110  
    1212import org.openstreetmap.josm.Main;
    1313import org.openstreetmap.josm.data.coor.LatLon;
     14import org.openstreetmap.josm.data.osm.DataSet;
    1415import org.openstreetmap.josm.data.osm.Node;
    1516import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    6970    public void testSelectTargetNode() {
    7071        assertNull(MergeNodesAction.selectTargetNode(Collections.emptyList()));
    71         assertEquals(1, MergeNodesAction.selectTargetNode(Arrays.asList(new Node(1))).getId());
     72        DataSet ds = new DataSet();
     73        Node n1 = new Node(1);
     74        ds.addPrimitive(n1);
     75        assertEquals(1, MergeNodesAction.selectTargetNode(Arrays.asList(n1)).getId());
    7276    }
    7377}
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java

    r11102 r11110  
    5858
    5959            CommandStackDialog dlg = new CommandStackDialog();
    60             dlg.showDialog();
     60            Main.map.addToggleDialog(dlg);
     61            dlg.unfurlDialog();
    6162            assertTrue(dlg.isVisible());
     63            Main.map.removeToggleDialog(dlg);
    6264            dlg.hideDialog();
    6365            assertFalse(dlg.isVisible());
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r10899 r11110  
    269269
    270270        // TODO: Remove global listeners and other global state.
    271         Main.pref.resetToInitialState();;
     271        Main.pref.resetToInitialState();
    272272        Main.platform = null;
    273273        // Parts of JOSM uses weak references - destroy them.
Note: See TracChangeset for help on using the changeset viewer.