source: josm/trunk/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java@ 10945

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

convert more unit tests to JOSMTestRules

File size: 1.9 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.data.conflict.Conflict;
7import org.openstreetmap.josm.data.osm.DataSet;
8import org.openstreetmap.josm.data.osm.Node;
9import org.openstreetmap.josm.data.osm.Relation;
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 RelationMemberConflictResolverCommand} class.
20 */
21public 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}
Note: See TracBrowser for help on using the repository browser.