source: josm/trunk/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java@ 9943

Last change on this file since 9943 was 9943, checked in by Don-vip, 8 years ago

update to equalsverifier 2.0

File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.command;
3
4import org.junit.BeforeClass;
5import org.junit.Test;
6import org.openstreetmap.josm.JOSMFixture;
7import org.openstreetmap.josm.data.coor.LatLon;
8import org.openstreetmap.josm.data.osm.DataSet;
9import org.openstreetmap.josm.data.osm.User;
10import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11
12import nl.jqno.equalsverifier.EqualsVerifier;
13import nl.jqno.equalsverifier.Warning;
14
15/**
16 * Unit tests of {@link ScaleCommand} class.
17 */
18public class ScaleCommandTest {
19
20 /**
21 * Setup test.
22 */
23 @BeforeClass
24 public static void setUpBeforeClass() {
25 JOSMFixture.createUnitTestFixture().init(false);
26 }
27
28 /**
29 * Unit test of methods {@link ScaleCommand#equals} and {@link ScaleCommand#hashCode}.
30 */
31 @Test
32 public void equalsContract() {
33 EqualsVerifier.forClass(ScaleCommand.class).usingGetClass()
34 .withPrefabValues(LatLon.class,
35 LatLon.ZERO, new LatLon(45, 45))
36 .withPrefabValues(DataSet.class,
37 new DataSet(), new DataSet())
38 .withPrefabValues(User.class,
39 User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
40 .withPrefabValues(OsmDataLayer.class,
41 new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
42 .suppress(Warning.NONFINAL_FIELDS)
43 .verify();
44 }
45}
Note: See TracBrowser for help on using the repository browser.