Changeset 17275 in josm for trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
- Timestamp:
- 2020-10-28T20:41:00+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r15924 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertFalse; 6 import static org.junit.Assert.assertNull; 7 import static org.junit.Assert.assertTrue; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertFalse; 6 import static org.junit.jupiter.api.Assertions.assertNull; 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 import static org.junit.jupiter.api.Assertions.assertThrows; 8 9 9 10 import java.awt.Color; … … 16 17 import javax.swing.JScrollPane; 17 18 18 import org.junit. Rule;19 import org.junit. Test;19 import org.junit.jupiter.api.Test; 20 import org.junit.jupiter.api.extension.RegisterExtension; 20 21 import org.openstreetmap.josm.TestUtils; 21 22 import org.openstreetmap.josm.data.gpx.GpxData; … … 41 42 * Setup tests 42 43 */ 43 @R ule44 @RegisterExtension 44 45 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 45 46 public JOSMTestRules test = new JOSMTestRules().main().projection().i18n().metricSystem(); … … 74 75 */ 75 76 @Test 76 publicvoid testGpxLayer() throws Exception {77 void testGpxLayer() throws Exception { 77 78 GpxLayer layer = new GpxLayer(new GpxData(), "foo", false); 78 79 GpxTrack trk = new GpxTrack(new ArrayList<IGpxTrackSegment>(), new HashMap<>()); … … 105 106 */ 106 107 @Test 107 publicvoid testGetInfoComponent() throws Exception {108 void testGetInfoComponent() throws Exception { 108 109 assertEquals("<html>\n"+ 109 110 " <head>\n" + … … 192 193 */ 193 194 @Test 194 publicvoid testGetTimespanForTrack() throws Exception {195 void testGetTimespanForTrack() throws Exception { 195 196 assertEquals("", GpxLayer.getTimespanForTrack( 196 197 new GpxTrack(new ArrayList<Collection<WayPoint>>(), new HashMap<String, Object>()))); … … 207 208 */ 208 209 @Test 209 publicvoid testMergeFrom() throws Exception {210 void testMergeFrom() throws Exception { 210 211 GpxLayer layer = new GpxLayer(new GpxData()); 211 212 assertTrue(layer.data.isEmpty()); … … 219 220 * Test that {@link GpxLayer#mergeFrom} throws IAE for invalid arguments 220 221 */ 221 @Test (expected = IllegalArgumentException.class)222 publicvoid testMergeFromIAE() {223 new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null));222 @Test 223 void testMergeFromIAE() { 224 assertThrows(IllegalArgumentException.class, () -> new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null))); 224 225 } 225 226 … … 229 230 */ 230 231 @Test 231 publicvoid testPaint() throws Exception {232 void testPaint() throws Exception { 232 233 GpxLayer layer = getMinimalGpxLayer(); 233 234 try { … … 244 245 */ 245 246 @Test 246 publicvoid testGetChangesetSourceTag() {247 void testGetChangesetSourceTag() { 247 248 assertEquals("survey", new GpxLayer(new GpxData(), "", true).getChangesetSourceTag()); 248 249 assertNull(new GpxLayer(new GpxData(), "", false).getChangesetSourceTag());
Note:
See TracChangeset
for help on using the changeset viewer.