Changeset 11777 in josm for trunk/test/unit


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.