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