Changeset 11986 in josm for trunk/test/unit/org
- Timestamp:
- 2017-04-23T19:14:12+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/MainTest.java
r11925 r11986 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertFalse; 5 6 import static org.junit.Assert.assertNotNull; 6 7 import static org.junit.Assert.assertNull; … … 8 9 9 10 import java.util.Collection; 11 import java.util.List; 10 12 11 13 import javax.swing.UIManager; … … 14 16 import org.junit.Test; 15 17 import org.openstreetmap.josm.Main.DownloadParamType; 18 import org.openstreetmap.josm.data.osm.DataSet; 19 import org.openstreetmap.josm.gui.ProgramArguments; 20 import org.openstreetmap.josm.gui.layer.GpxLayer; 16 21 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 22 … … 28 33 @Rule 29 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules().platform() ;35 public JOSMTestRules test = new JOSMTestRules().platform().devAPI(); 31 36 32 37 /** … … 81 86 assertNotNull(Main.toolbar); 82 87 } 88 89 /** 90 * Unit test of {@link Main#postConstructorProcessCmdLine} - empty case. 91 */ 92 @Test 93 public void testPostConstructorProcessCmdLineEmpty() { 94 // Check the method accepts no arguments 95 Main.postConstructorProcessCmdLine(new ProgramArguments(new String[0])); 96 } 97 98 /** 99 * Unit test of {@link Main#postConstructorProcessCmdLine} - nominal cases. 100 * This test assumes the DEV API contains nodes around 0,0 and GPX tracks around London 101 */ 102 @Test 103 public void testPostConstructorProcessCmdLineNominal() { 104 assertNull(Main.getLayerManager().getEditDataSet()); 105 Main.postConstructorProcessCmdLine(new ProgramArguments(new String[]{ 106 "--download=0.01,0.01,0.05,0.05", 107 "--downloadgps=51.35,-0.4,51.60,0.2", 108 "--selection=type: node"})); 109 DataSet ds = Main.getLayerManager().getEditDataSet(); 110 assertNotNull(ds); 111 assertFalse(ds.getSelected().isEmpty()); 112 Main.getLayerManager().removeLayer(Main.getLayerManager().getEditLayer()); 113 List<GpxLayer> gpxLayers = Main.getLayerManager().getLayersOfType(GpxLayer.class); 114 assertEquals(1, gpxLayers.size()); 115 Main.getLayerManager().removeLayer(gpxLayers.iterator().next()); 116 } 117 118 /** 119 * Unit test of {@link DownloadParamType} enum. 120 */ 121 @Test 122 public void testEnumDownloadParamType() { 123 TestUtils.superficialEnumCodeCoverage(DownloadParamType.class); 124 } 83 125 }
Note:
See TracChangeset
for help on using the changeset viewer.