1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.gpx;
|
---|
3 |
|
---|
4 | import org.junit.Rule;
|
---|
5 | import org.junit.Test;
|
---|
6 | import org.openstreetmap.josm.TestUtils;
|
---|
7 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
8 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
9 |
|
---|
10 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
11 | import nl.jqno.equalsverifier.EqualsVerifier;
|
---|
12 | import nl.jqno.equalsverifier.Warning;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Unit tests for class {@link GpxTrackSegment}.
|
---|
16 | */
|
---|
17 | public class GpxTrackSegmentTest {
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Setup test.
|
---|
21 | */
|
---|
22 | @Rule
|
---|
23 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
24 | public JOSMTestRules test = new JOSMTestRules();
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Unit test of methods {@link GpxTrackSegment#equals} and {@link GpxTrackSegment#hashCode}.
|
---|
28 | */
|
---|
29 | @Test
|
---|
30 | public void testEqualsContract() {
|
---|
31 | TestUtils.assumeWorkingEqualsVerifier();
|
---|
32 | GpxExtensionCollection col = new GpxExtensionCollection();
|
---|
33 | col.add("josm", "from-server", "true");
|
---|
34 | EqualsVerifier.forClass(GpxTrackSegment.class).usingGetClass()
|
---|
35 | .suppress(Warning.NONFINAL_FIELDS)
|
---|
36 | .withIgnoredFields("bounds", "length")
|
---|
37 | .withPrefabValues(WayPoint.class, new WayPoint(LatLon.NORTH_POLE), new WayPoint(LatLon.SOUTH_POLE))
|
---|
38 | .withPrefabValues(GpxExtensionCollection.class, new GpxExtensionCollection(), col)
|
---|
39 | .verify();
|
---|
40 | }
|
---|
41 | }
|
---|