source: josm/trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java@ 9761

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

fix #12508 - add missing fixtures for command unit tests

File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.command;
3
4import org.junit.BeforeClass;
5import org.junit.Test;
6import org.openstreetmap.josm.JOSMFixture;
7import org.openstreetmap.josm.data.osm.DataSet;
8import org.openstreetmap.josm.data.osm.Hash;
9import org.openstreetmap.josm.data.osm.OsmPrimitive;
10import org.openstreetmap.josm.data.osm.Storage;
11import org.openstreetmap.josm.gui.layer.OsmDataLayer;
12
13import nl.jqno.equalsverifier.EqualsVerifier;
14import nl.jqno.equalsverifier.Warning;
15
16/**
17 * Unit tests of {@link PurgeCommand} class.
18 */
19public class PurgeCommandTest {
20
21 /**
22 * Setup test.
23 */
24 @BeforeClass
25 public static void setUpBeforeClass() {
26 JOSMFixture.createUnitTestFixture().init(false);
27 }
28
29 /**
30 * Unit test of methods {@link PurgeCommand#equals} and {@link PurgeCommand#hashCode}.
31 */
32 @Test
33 public void equalsContract() {
34 EqualsVerifier.forClass(PurgeCommand.class).usingGetClass()
35 .withPrefabValues(DataSet.class,
36 new DataSet(), new DataSet())
37 .withPrefabValues(OsmDataLayer.class,
38 new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
39 .withPrefabValues(Hash.class,
40 Storage.<OsmPrimitive>defaultHash(), Storage.<OsmPrimitive>defaultHash())
41 .suppress(Warning.NONFINAL_FIELDS)
42 .verify();
43 }
44}
Note: See TracBrowser for help on using the repository browser.