1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.command;
|
---|
3 |
|
---|
4 | import org.junit.BeforeClass;
|
---|
5 | import org.junit.Test;
|
---|
6 | import org.openstreetmap.josm.JOSMFixture;
|
---|
7 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
8 | import org.openstreetmap.josm.data.osm.Node;
|
---|
9 | import org.openstreetmap.josm.data.osm.User;
|
---|
10 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
11 |
|
---|
12 | import nl.jqno.equalsverifier.EqualsVerifier;
|
---|
13 | import nl.jqno.equalsverifier.Warning;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Unit tests of {@link SequenceCommand} class.
|
---|
17 | */
|
---|
18 | public class SequenceCommandTest {
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Setup test.
|
---|
22 | */
|
---|
23 | @BeforeClass
|
---|
24 | public static void setUpBeforeClass() {
|
---|
25 | JOSMFixture.createUnitTestFixture().init(false);
|
---|
26 | }
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Unit test of methods {@link SequenceCommand#equals} and {@link SequenceCommand#hashCode}.
|
---|
30 | */
|
---|
31 | @Test
|
---|
32 | public void equalsContract() {
|
---|
33 | EqualsVerifier.forClass(SequenceCommand.class).usingGetClass()
|
---|
34 | .withPrefabValues(Command.class,
|
---|
35 | new AddCommand(new Node(1)), new AddCommand(new Node(2)))
|
---|
36 | .withPrefabValues(DataSet.class,
|
---|
37 | new DataSet(), new DataSet())
|
---|
38 | .withPrefabValues(User.class,
|
---|
39 | User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
|
---|
40 | .withPrefabValues(OsmDataLayer.class,
|
---|
41 | new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
|
---|
42 | .suppress(Warning.NONFINAL_FIELDS)
|
---|
43 | .verify();
|
---|
44 | }
|
---|
45 | }
|
---|