1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.command;
|
---|
3 |
|
---|
4 | import org.junit.Rule;
|
---|
5 | import org.junit.Test;
|
---|
6 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
7 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
8 | import org.openstreetmap.josm.data.osm.User;
|
---|
9 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
10 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
11 |
|
---|
12 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
13 | import nl.jqno.equalsverifier.EqualsVerifier;
|
---|
14 | import nl.jqno.equalsverifier.Warning;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Unit tests of {@link TransformNodesCommand} class.
|
---|
18 | */
|
---|
19 | public class TransformNodesCommandTest {
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Setup test.
|
---|
23 | */
|
---|
24 | @Rule
|
---|
25 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
26 | public JOSMTestRules test = new JOSMTestRules();
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Unit test of methods {@link TransformNodesCommand#equals} and {@link TransformNodesCommand#hashCode}.
|
---|
30 | */
|
---|
31 | @Test
|
---|
32 | public void testEqualsContract() {
|
---|
33 | EqualsVerifier.forClass(TransformNodesCommand.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 | }
|
---|