Changeset 11777 in josm


Ignore:
Timestamp:
2017-03-25T22:09:41+01:00 (3 years ago)
Author:
michael2402
Message:

See #14495 - move style source reset to JOSM test rules.

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java

    r11776 r11777  
    5353    @Rule
    5454    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    55     public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection();
     55    public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection().mapStyles();
    5656
    5757    /**
    5858     * Load the test data that is required.
    59      * @throws Exception
     59     * @throws Exception It an error occurred during load.
    6060     */
    6161    @BeforeClass
     
    9696        nc = new MapView(Main.getLayerManager(), null);
    9797        nc.setBounds(0, 0, IMG_WIDTH, IMG_HEIGHT);
    98         MapPaintStyles.readFromPreferences();
    9998    }
    10099
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r11251 r11777  
    1515import org.openstreetmap.josm.Main;
    1616import org.openstreetmap.josm.data.projection.Projections;
     17import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    1718import org.openstreetmap.josm.gui.util.GuiHelper;
    1819import org.openstreetmap.josm.io.OsmApi;
     
    4445    private boolean commands;
    4546    private boolean allowMemoryManagerLeaks;
     47    private boolean useMapStyles;
    4648
    4749    /**
     
    153155    public JOSMTestRules memoryManagerLeaks() {
    154156        allowMemoryManagerLeaks = true;
     157        return this;
     158    }
     159
     160    /**
     161     * Use map styles in this test.
     162     * @return this instance, for easy chaining
     163     * @since 11777
     164     */
     165    public JOSMTestRules mapStyles() {
     166        preferences();
     167        useMapStyles = true;
    155168        return this;
    156169    }
     
    233246        if (platform) {
    234247            Main.determinePlatformHook();
     248        }
     249
     250        if (useMapStyles) {
     251            // Reset the map paint styles.
     252            MapPaintStyles.readFromPreferences();
    235253        }
    236254
Note: See TracChangeset for help on using the changeset viewer.