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

Last change on this file since 14219 was 13079, checked in by Don-vip, 6 years ago

see #15560 - EqualsVerifier does not work with newer Java versions -> disable tests automatically in this case
Workaround to https://github.com/jqno/equalsverifier/issues/177 / https://github.com/raphw/byte-buddy/issues/370
Inspired by https://issues.apache.org/jira/browse/SOLR-11606

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.TestUtils;
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;
11import org.openstreetmap.josm.testutils.JOSMTestRules;
12
13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14import nl.jqno.equalsverifier.EqualsVerifier;
15import nl.jqno.equalsverifier.Warning;
16
17/**
18 * Unit tests of {@link TransformNodesCommand} class.
19 */
20public class TransformNodesCommandTest {
21
22 /**
23 * Setup test.
24 */
25 @Rule
26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
27 public JOSMTestRules test = new JOSMTestRules();
28
29 /**
30 * Unit test of methods {@link TransformNodesCommand#equals} and {@link TransformNodesCommand#hashCode}.
31 */
32 @Test
33 public void testEqualsContract() {
34 TestUtils.assumeWorkingEqualsVerifier();
35 EqualsVerifier.forClass(TransformNodesCommand.class).usingGetClass()
36 .withPrefabValues(LatLon.class,
37 LatLon.ZERO, new LatLon(45, 45))
38 .withPrefabValues(DataSet.class,
39 new DataSet(), new DataSet())
40 .withPrefabValues(User.class,
41 User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
42 .withPrefabValues(OsmDataLayer.class,
43 new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
44 .suppress(Warning.NONFINAL_FIELDS)
45 .verify();
46 }
47}
Note: See TracBrowser for help on using the repository browser.