Changeset 12557 in josm for trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTaskTest.java
- Timestamp:
- 2017-08-02T20:41:01+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTaskTest.java
r12248 r12557 8 8 import java.util.concurrent.ExecutionException; 9 9 10 import org.junit.Rule;11 10 import org.junit.Test; 12 11 import org.openstreetmap.josm.data.gpx.GpxData; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 12 17 13 /** 18 14 * Unit tests for class {@link DownloadGpsTask}. 19 15 */ 20 public class DownloadGpsTaskTest { 21 22 private static final String REMOTE_FILE = "https://josm.openstreetmap.de/export/head/josm/trunk/data_nodist/munich.gpx"; 23 24 /** 25 * Setup test. 26 */ 27 @Rule 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules().https(); 16 public class DownloadGpsTaskTest extends AbstractDownloadTaskTest { 30 17 31 18 /** … … 45 32 assertTrue(task.acceptsUrl("https://www.openstreetmap.org/edit?gpx=750057")); 46 33 assertTrue(task.acceptsUrl("http://www.openstreetmap.org/edit?gpx=2277313#map=14/-20.7321/-40.5328")); 47 assertTrue(task.acceptsUrl( REMOTE_FILE));34 assertTrue(task.acceptsUrl(getRemoteFileUrl())); 48 35 } 49 36 … … 55 42 @Test 56 43 public void testDownloadExternalFile() throws InterruptedException, ExecutionException { 44 mockHttp(); 57 45 DownloadGpsTask task = new DownloadGpsTask(); 58 task.loadUrl(false, REMOTE_FILE, null).get();46 task.loadUrl(false, getRemoteFileUrl(), null).get(); 59 47 GpxData data = task.getDownloadedData(); 60 48 assertNotNull(data); … … 62 50 assertFalse(data.tracks.isEmpty()); 63 51 } 52 53 @Override 54 protected String getRemoteFile() { 55 return "samples/data.gpx"; 56 } 64 57 }
Note:
See TracChangeset
for help on using the changeset viewer.