Changeset 8917 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2015-10-20T16:05:10+02:00 (9 years ago)
Author:
Don-vip
Message:

fix unit tests

Location:
trunk/test/unit/org/openstreetmap/josm/command/conflict
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java

    r8916 r8917  
    99import org.junit.Test;
    1010import org.openstreetmap.josm.JOSMFixture;
     11import org.openstreetmap.josm.Main;
    1112import org.openstreetmap.josm.data.conflict.Conflict;
    1213import org.openstreetmap.josm.data.osm.DataSet;
     
    2425    @BeforeClass
    2526    public static void setUpBeforeClass() {
    26         JOSMFixture.createUnitTestFixture().init();
     27        JOSMFixture.createUnitTestFixture().init(true);
     28        Main.map.mapView.addLayer(new OsmDataLayer(new DataSet(), null, null));
    2729    }
    2830
     
    3234    @Test
    3335    public void testExecuteUndoCommand() {
    34         OsmDataLayer layer = new OsmDataLayer(new DataSet(), null, null);
     36        OsmDataLayer layer = Main.map.mapView.getEditLayer();
    3537        Conflict<Node> conflict = new Conflict<>(new Node(), new Node());
    3638        ConflictAddCommand cmd = new ConflictAddCommand(layer, conflict);
     
    4850    @Test
    4951    public void testGetDescriptionIcon() {
    50         OsmDataLayer layer = new OsmDataLayer(new DataSet(), null, null);
     52        OsmDataLayer layer = Main.map.mapView.getEditLayer();
    5153        Conflict<Node> conflict = new Conflict<>(new Node(), new Node());
    5254        assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon());
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java

    r8916 r8917  
    22package org.openstreetmap.josm.command.conflict;
    33
     4import static org.junit.Assert.assertEquals;
    45import static org.junit.Assert.assertNotNull;
    56import static org.junit.Assert.assertTrue;
     
    4243        CoordinateConflictResolveCommand cmd = new CoordinateConflictResolveCommand(conflict, MergeDecisionType.KEEP_MINE);
    4344        assertTrue(cmd.executeCommand());
    44         assertTrue(LatLon.ZERO.equals(conflict.getMy().getCoor()));
     45        assertEquals(LatLon.ZERO, conflict.getMy().getCoor());
    4546        cmd.undoCommand();
    46         assertTrue(LatLon.ZERO.equals(conflict.getMy().getCoor()));
     47        assertEquals(LatLon.ZERO, conflict.getMy().getCoor());
    4748    }
    4849
     
    5556        CoordinateConflictResolveCommand cmd = new CoordinateConflictResolveCommand(conflict, MergeDecisionType.KEEP_THEIR);
    5657        assertTrue(cmd.executeCommand());
    57         assertTrue(conflict.getTheir().getCoor().equals(conflict.getMy().getCoor()));
     58        assertEquals(conflict.getTheir().getCoor(), conflict.getMy().getCoor());
    5859        cmd.undoCommand();
    59         //assertTrue(LatLon.ZERO.equals(conflict.getMy().getCoor())); // FIXME it does not work
     60        //assertEquals(LatLon.ZERO, conflict.getMy().getCoor()); // FIXME it does not work
    6061    }
    6162
Note: See TracChangeset for help on using the changeset viewer.