source: josm/trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java@ 13079

Last change on this file since 13079 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.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.command.conflict;
3
4import org.junit.Rule;
5import org.junit.Test;
6import org.openstreetmap.josm.TestUtils;
7import org.openstreetmap.josm.data.conflict.Conflict;
8import org.openstreetmap.josm.data.osm.DataSet;
9import org.openstreetmap.josm.data.osm.Node;
10import org.openstreetmap.josm.data.osm.User;
11import org.openstreetmap.josm.gui.layer.OsmDataLayer;
12import org.openstreetmap.josm.testutils.JOSMTestRules;
13
14import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
15import nl.jqno.equalsverifier.EqualsVerifier;
16import nl.jqno.equalsverifier.Warning;
17
18/**
19 * Unit tests of {@link ConflictResolveCommand} class.
20 */
21public class ConflictResolveCommandTest {
22
23 /**
24 * Setup test.
25 */
26 @Rule
27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
28 public JOSMTestRules test = new JOSMTestRules();
29
30 /**
31 * Unit test of methods {@link ConflictResolveCommand#equals} and {@link ConflictResolveCommand#hashCode}.
32 */
33 @Test
34 public void testEqualsContract() {
35 TestUtils.assumeWorkingEqualsVerifier();
36 EqualsVerifier.forClass(ConflictResolveCommand.class).usingGetClass()
37 .withPrefabValues(Conflict.class,
38 new Conflict<>(new Node(1, 1), new Node(2, 1)),
39 new Conflict<>(new Node(1, 1), new Node(3, 1)))
40 .withPrefabValues(DataSet.class,
41 new DataSet(), new DataSet())
42 .withPrefabValues(User.class,
43 User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
44 .withPrefabValues(OsmDataLayer.class,
45 new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
46 .suppress(Warning.NONFINAL_FIELDS)
47 .verify();
48 }
49}
Note: See TracBrowser for help on using the repository browser.