Ignore:
Timestamp:
2016-06-14T19:26:16+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #12949 - Use test rule instead of JOSMFixture to speed up tests (patch by michael2402) - gsoc-core

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java

    r10364 r10373  
    88import java.util.List;
    99
    10 import org.junit.BeforeClass;
     10import org.junit.Rule;
    1111import org.junit.Test;
    12 import org.openstreetmap.josm.JOSMFixture;
    1312import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.data.imagery.ImageryInfo;
    1514import org.openstreetmap.josm.gui.layer.TMSLayer;
    1615import org.openstreetmap.josm.gui.layer.WMSLayer;
     16import org.openstreetmap.josm.testutils.JOSMTestRules;
    1717
    1818/**
     
    2020 */
    2121public final class AddImageryLayerActionTest {
    22 
    2322    /**
    24      * Setup test.
     23     * We need prefs for this. We need platform for actions and the OSM API for checking blacklist.
    2524     */
    26     @BeforeClass
    27     public static void setUp() {
    28         JOSMFixture.createUnitTestFixture().init(true);
    29     }
     25    @Rule
     26    public JOSMTestRules test = new JOSMTestRules().preferences().platform().fakeAPI();
    3027
    3128    /**
     
    3532    public void testEnabledState() {
    3633        assertFalse(new AddImageryLayerAction(new ImageryInfo()).isEnabled());
    37         assertFalse(new AddImageryLayerAction(new ImageryInfo("google", "http://maps.google.com/api", "tms", null, null)).isEnabled());
    3834        assertTrue(new AddImageryLayerAction(new ImageryInfo("foo_tms", "http://bar", "tms", null, null)).isEnabled());
    3935        assertTrue(new AddImageryLayerAction(new ImageryInfo("foo_bing", "http://bar", "bing", null, null)).isEnabled());
Note: See TracChangeset for help on using the changeset viewer.