1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.gpx;
|
---|
3 |
|
---|
4 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
5 | import org.junit.jupiter.api.Test;
|
---|
6 | import org.openstreetmap.josm.TestUtils;
|
---|
7 | import org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerActionTest;
|
---|
8 | import org.openstreetmap.josm.io.GpxReaderTest;
|
---|
9 | import org.openstreetmap.josm.io.GpxWriterTest;
|
---|
10 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
11 |
|
---|
12 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
13 | import nl.jqno.equalsverifier.EqualsVerifier;
|
---|
14 | import nl.jqno.equalsverifier.Warning;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Unit tests for class {@link GpxExtension}
|
---|
18 | */
|
---|
19 | class GpxExtensionTest {
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Setup test.
|
---|
23 | */
|
---|
24 | @RegisterExtension
|
---|
25 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
26 | public JOSMTestRules test = new JOSMTestRules();
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Unit test of methods {@link GpxExtension#equals} and {@link GpxExtension#hashCode}.
|
---|
30 | * @see GpxWriterTest#testExtensions()
|
---|
31 | * @see GpxReaderTest#testLayerPrefs()
|
---|
32 | * @see ConvertToDataLayerActionTest#testFromTrack()
|
---|
33 | */
|
---|
34 | @Test
|
---|
35 | void testEqualsContract() {
|
---|
36 | TestUtils.assumeWorkingEqualsVerifier();
|
---|
37 | GpxExtensionCollection col = new GpxExtensionCollection();
|
---|
38 | col.add("josm", "from-server", "true");
|
---|
39 | EqualsVerifier.forClass(GpxExtension.class).usingGetClass()
|
---|
40 | .suppress(Warning.NONFINAL_FIELDS)
|
---|
41 | .withIgnoredFields("qualifiedName", "parent")
|
---|
42 | .withPrefabValues(GpxExtensionCollection.class, new GpxExtensionCollection(), col)
|
---|
43 | .verify();
|
---|
44 | }
|
---|
45 |
|
---|
46 | }
|
---|