Changeset 9817 in josm for trunk/test/unit/org
- Timestamp:
- 2016-02-17T22:05:02+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
r9816 r9817 3 3 4 4 import static org.junit.Assert.assertNotNull; 5 import static org.junit.Assert.assertNull; 5 6 6 7 import org.junit.BeforeClass; … … 28 29 } 29 30 30 /** 31 * Test action. 32 * @throws Exception if an error occurs 33 */ 34 @Test 35 public void testDownload() throws Exception { 36 final OsmDataLayer layer = new OsmDataLayer(new DataSet(), getClass().getName(), null); 31 private static PleaseWaitRunnable createTask(String file) throws Exception { 32 final OsmDataLayer layer = new OsmDataLayer(new DataSet(), DownloadAlongTrackActionTest.class.getName(), null); 37 33 try { 38 34 Main.main.addLayer(layer); 39 35 // Perform action 40 final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "minimal.gpx"); 41 PleaseWaitRunnable task = new DownloadAlongTrackAction(gpx).createTask(); 42 assertNotNull(task); 36 final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + file); 37 return new DownloadAlongTrackAction(gpx).createTask(); 43 38 } finally { 44 39 // Ensure we clean the place before leaving, even if test fails. … … 46 41 } 47 42 } 43 44 /** 45 * Test action with nominal data set. 46 * @throws Exception if an error occurs 47 */ 48 @Test 49 public void testDownload() throws Exception { 50 assertNotNull(createTask("minimal.gpx")); 51 } 52 53 /** 54 * Test action with empty data set. 55 * @throws Exception if an error occurs 56 */ 57 @Test 58 public void testDownloadEmpty() throws Exception { 59 assertNull(createTask("empty.gpx")); 60 } 48 61 }
Note:
See TracChangeset
for help on using the changeset viewer.