Changeset 9436 in josm for trunk/test
- Timestamp:
- 2016-01-13T23:58:45+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/layer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
r9430 r9436 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.data.imagery.ImageryInfo; 10 11 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; … … 20 21 @BeforeClass 21 22 public static void setUpBeforeClass() { 22 JOSMFixture.createUnitTestFixture().init(); 23 JOSMFixture.createUnitTestFixture().init(true); 24 } 25 26 /** 27 * Creates a new TMS layer. 28 * @return a new TMS layer 29 */ 30 public static TMSLayer createTmsLayer() { 31 return new TMSLayer(new ImageryInfo("test tms", "http://localhost", "tms", null, null)); 32 } 33 34 /** 35 * Creates a new Bing layer. 36 * @return a new Bing layer 37 */ 38 public static TMSLayer createBingLayer() { 39 return new TMSLayer(new ImageryInfo("test bing", "http://localhost", "bing", null, null)); 40 } 41 42 /** 43 * Creates a new Scanex layer. 44 * @return a new Scanex layer 45 */ 46 public static TMSLayer createScanexLayer() { 47 return new TMSLayer(new ImageryInfo("test scanex", "http://localhost", "scanex", null, null)); 48 } 49 50 private static void test(ImageryType expected, TMSLayer layer) { 51 Main.main.addLayer(layer); 52 assertEquals(expected, layer.getInfo().getImageryType()); 23 53 } 24 54 … … 28 58 @Test 29 59 public void testTMSLayer() { 30 TMSLayer tms = new TMSLayer(new ImageryInfo("test tms", "http://localhost", "tms", null, null)); 31 assertEquals(ImageryType.TMS, tms.getInfo().getImageryType()); 32 33 TMSLayer bing = new TMSLayer(new ImageryInfo("test bing", "http://localhost", "bing", null, null)); 34 assertEquals(ImageryType.BING, bing.getInfo().getImageryType()); 35 36 TMSLayer scanex = new TMSLayer(new ImageryInfo("test scanex", "http://localhost", "scanex", null, null)); 37 assertEquals(ImageryType.SCANEX, scanex.getInfo().getImageryType()); 60 test(ImageryType.TMS, createTmsLayer()); 61 test(ImageryType.BING, createBingLayer()); 62 test(ImageryType.SCANEX, createScanexLayer()); 38 63 } 39 64 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
r9430 r9436 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.data.imagery.ImageryInfo; 10 11 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; … … 20 21 @BeforeClass 21 22 public static void setUpBeforeClass() { 22 JOSMFixture.createUnitTestFixture().init( );23 JOSMFixture.createUnitTestFixture().init(true); 23 24 } 24 25 … … 29 30 public void testWMSLayer() { 30 31 WMSLayer wms = new WMSLayer(new ImageryInfo("test wms", "http://localhost")); 32 Main.main.addLayer(wms); 31 33 assertEquals(ImageryType.WMS, wms.getInfo().getImageryType()); 32 34 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java
r9430 r9436 27 27 */ 28 28 @Test 29 public void test TMSLayer() {29 public void testWMTSLayer() { 30 30 WMTSLayer wmts = new WMTSLayer(new ImageryInfo("test wmts", "http://localhost", "wmts", null, null)); 31 31 assertEquals(ImageryType.WMTS, wmts.getInfo().getImageryType());
Note:
See TracChangeset
for help on using the changeset viewer.