Ignore:
Timestamp:
2018-07-29T00:41:59+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16010 - more fixes (patch by ris)

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java

    r13112 r14066  
    1616import org.openstreetmap.josm.gui.layer.gpx.DownloadWmsAlongTrackAction.PrecacheWmsTask;
    1717import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.TileSourceRule;
    1819
    1920import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    2930    @Rule
    3031    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules().platform().main().projection().timeout(20000);
     32    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().fakeImagery().timeout(20000);
    3233
    3334    /**
     
    4546    @Test
    4647    public void testTMSLayer() throws Exception {
    47         // Create new TMS layer and clear cache
    48         TMSLayer layer = new TMSLayer(new ImageryInfo("OSM TMS", "https://a.tile.openstreetmap.org/{zoom}/{x}/{y}.png", "tms", null, null));
     48        final TileSourceRule tileSourceRule = this.test.getTileSourceRule();
     49
     50        TMSLayer layer = new TMSLayer(
     51            tileSourceRule.getSourcesList().get(0).getImageryInfo(tileSourceRule.port())
     52        );
    4953        try {
    5054            MainApplication.getLayerManager().addLayer(layer);
  • trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java

    r13078 r14066  
    214214            this.stubFor(source.getMappingBuilder().willReturn(source.getResponseDefinitionBuilder()));
    215215        }
     216    }
     217
     218    /**
     219     * Get the tile sources served by this TileSourceRule.
     220     *
     221     * @return an unmodifiable list of the tile sources served by this TileSourceRule
     222     */
     223    public List<ConstSource> getSourcesList() {
     224        return Collections.unmodifiableList(this.sourcesList);
    216225    }
    217226
Note: See TracChangeset for help on using the changeset viewer.