Changeset 10334 in josm for trunk/test/unit/org
- Timestamp:
- 2016-06-07T21:26:44+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/coor
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
r10222 r10334 3 3 4 4 import static org.junit.Assert.assertEquals; 5 6 import java.text.DecimalFormat; 5 7 6 8 import org.junit.Before; … … 9 11 10 12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 13 import nl.jqno.equalsverifier.EqualsVerifier; 11 14 12 15 /** … … 120 123 121 124 /** 122 * Test of {@link LatLon#equals}125 * Unit test of methods {@link LatLon#equals} and {@link LatLon#hashCode}. 123 126 */ 124 127 @Test 125 public void testEquals() { 126 for (int i = 1; i < SAMPLE_VALUES.length; i++) { 127 LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]); 128 LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]); 129 assertEquals(a, b); 130 } 131 } 132 133 /** 134 * Test of {@link LatLon#hashCode} 135 */ 136 @Test 137 public void testHashCode() { 138 for (int i = 1; i < SAMPLE_VALUES.length; i++) { 139 LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]); 140 LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]); 141 assertEquals(a.hashCode(), b.hashCode()); 142 } 128 public void equalsContract() { 129 EqualsVerifier.forClass(LatLon.class).usingGetClass() 130 .withPrefabValues(DecimalFormat.class, new DecimalFormat("00.0"), new DecimalFormat("00.000")) 131 .verify(); 143 132 } 144 133
Note:
See TracChangeset
for help on using the changeset viewer.