Ignore:
Timestamp:
2015-10-11T17:28:19+02:00 (11 years ago)
Author:
Don-vip
Message:

improve/cleanup unit tests

Location:
trunk/test/unit/org/openstreetmap/josm/actions
Files:
8 edited

Legend:

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

    r7937 r8857  
    1616
    1717/**
    18  * Unit tests for class AlignInLineAction.
     18 * Unit tests for class {@link AlignInLineAction}.
    1919 */
    2020public final class AlignInLineActionTest {
  • trunk/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java

    r8856 r8857  
    2222
    2323/**
    24  * Unit tests for class CombineWayAction.
     24 * Unit tests for class {@link CombineWayAction}.
    2525 */
    2626public class CombineWayActionTest {
     
    3131    @BeforeClass
    3232    public static void setUp() {
    33         JOSMFixture.createUnitTestFixture().init(false);
     33        JOSMFixture.createUnitTestFixture().init();
    3434    }
    3535
  • trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java

    r8624 r8857  
    22package org.openstreetmap.josm.actions;
    33
    4 import static org.hamcrest.CoreMatchers.is;
    5 import static org.junit.Assert.assertThat;
     4import static org.junit.Assert.assertEquals;
    65
    76import java.util.Arrays;
     
    1413import org.openstreetmap.josm.data.osm.Way;
    1514
     15/**
     16 * Unit tests for class {@link CopyAction}.
     17 */
    1618public class CopyActionTest {
    1719
     20    /**
     21     * Setup test.
     22     */
    1823    @BeforeClass
    1924    public static void setUpBeforeClass() {
     
    2429    public void testCopyStringWay() throws Exception {
    2530        final Way way = new Way(123L);
    26         assertThat(CopyAction.getCopyString(Collections.singleton(way)), is("way 123"));
     31        assertEquals("way 123", CopyAction.getCopyString(Collections.singleton(way)));
    2732    }
    2833
     
    3136        final Way way = new Way(123L);
    3237        final Relation relation = new Relation(456);
    33         assertThat(CopyAction.getCopyString(Arrays.asList(way, relation)), is("way 123,relation 456"));
    34         assertThat(CopyAction.getCopyString(Arrays.asList(relation, way)), is("relation 456,way 123"));
     38        assertEquals("way 123,relation 456", CopyAction.getCopyString(Arrays.asList(way, relation)));
     39        assertEquals("relation 456,way 123", CopyAction.getCopyString(Arrays.asList(relation, way)));
    3540    }
    3641}
  • trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java

    r8624 r8857  
    3131
    3232/**
    33  * Unit tests for class CreateCircleAction.
     33 * Unit tests for class {@link CreateCircleAction}.
    3434 */
    3535public final class CreateCircleActionTest {
  • trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java

    r8624 r8857  
    1818
    1919/**
    20  * Unit tests for class SplitWayAction.
     20 * Unit tests for class {@link SplitWayAction}.
    2121 */
    2222public final class SplitWayActionTest {
  • trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java

    r8624 r8857  
    1717
    1818/**
    19  * Unit tests for class UnJoinNodeWayAction.
     19 * Unit tests for class {@link UnJoinNodeWayAction}.
    2020 */
    2121public final class UnJoinNodeWayActionTest {
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java

    r8836 r8857  
    2424import org.openstreetmap.josm.data.osm.DataSet;
    2525import org.openstreetmap.josm.data.osm.Node;
    26 import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2726import org.openstreetmap.josm.data.osm.Way;
    2827import org.openstreetmap.josm.gui.MapFrame;
     
    3029import org.openstreetmap.josm.gui.layer.Layer;
    3130import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    32 import org.openstreetmap.josm.tools.Predicate;
    3331
    3432/**
     
    3735public class SelectActionTest {
    3836
    39     public class MapViewMock extends MapView {
    40         public OsmDataLayer layer;
    41         public DataSet currentDataSet;
    42 
    43         public Predicate<OsmPrimitive> isSelectablePredicate =
    44                 new Predicate<OsmPrimitive>() {
    45                     @Override
    46                     public boolean evaluate(OsmPrimitive prim) {
    47                         return true;
    48                     }
    49                 };
     37    private class MapViewMock extends MapView {
     38        private OsmDataLayer layer;
     39        private DataSet currentDataSet;
    5040
    5141        MapViewMock(DataSet dataSet, OsmDataLayer layer) {
     
    6555        @Override
    6656        public void removeMouseListener(MouseListener ml) {}
    67 
    68         public void addMouseMotionListener(MouseListener ml) {}
    69 
    70         public void removeMouseMotionListener(MouseListener ml) {}
    71 
    72         public void mvRepaint() {}
    7357
    7458        @Override
  • trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java

    r8838 r8857  
    1313import org.openstreetmap.josm.data.osm.Way;
    1414
     15/**
     16 * Unit tests for class {@link SearchCompiler}.
     17 */
    1518public class SearchCompilerTest {
    1619
     
    109112    public void testNthParseNegative() throws Exception {
    110113        Assert.assertThat(SearchCompiler.compile("nth:-1").toString(), CoreMatchers.is("Nth{nth=-1, modulo=false}"));
    111 
    112114    }
    113115}
Note: See TracChangeset for help on using the changeset viewer.