source: josm/trunk/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java@ 11647

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

convert more unit tests to JOSMTestRules

File size: 1.6 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.command;
3
4import org.junit.Rule;
5import org.junit.Test;
6import org.openstreetmap.josm.data.coor.LatLon;
7import org.openstreetmap.josm.data.osm.DataSet;
8import org.openstreetmap.josm.data.osm.User;
9import org.openstreetmap.josm.gui.layer.OsmDataLayer;
10import org.openstreetmap.josm.testutils.JOSMTestRules;
11
12import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13import nl.jqno.equalsverifier.EqualsVerifier;
14import nl.jqno.equalsverifier.Warning;
15
16/**
17 * Unit tests of {@link TransformNodesCommand} class.
18 */
19public 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}
Note: See TracBrowser for help on using the repository browser.