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.data.conflict.Conflict;
|
---|
7 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
8 | import org.openstreetmap.josm.data.osm.Node;
|
---|
9 | import org.openstreetmap.josm.data.osm.Relation;
|
---|
10 | import org.openstreetmap.josm.data.osm.User;
|
---|
11 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
12 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
13 |
|
---|
14 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
15 | import nl.jqno.equalsverifier.EqualsVerifier;
|
---|
16 | import nl.jqno.equalsverifier.Warning;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Unit tests of {@link RelationMemberConflictResolverCommand} class.
|
---|
20 | */
|
---|
21 | public class RelationMemberConflictResolverCommandTest {
|
---|
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 RelationMemberConflictResolverCommand#equals} and {@link RelationMemberConflictResolverCommand#hashCode}.
|
---|
32 | */
|
---|
33 | @Test
|
---|
34 | public void testEqualsContract() {
|
---|
35 | EqualsVerifier.forClass(RelationMemberConflictResolverCommand.class).usingGetClass()
|
---|
36 | .withPrefabValues(Relation.class,
|
---|
37 | new Relation(1), new Relation(2))
|
---|
38 | .withPrefabValues(Conflict.class,
|
---|
39 | new Conflict<>(new Node(), new Node()), new Conflict<>(new Relation(), new Relation()))
|
---|
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 | }
|
---|