Changeset 15400 in josm for trunk/test/unit


Ignore:
Timestamp:
2019-10-01T02:20:06+02:00 (5 years ago)
Author:
Don-vip
Message:

Force metric measurement system only in tests requiring it as it creates a new preference entry

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

Legend:

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

    r15399 r15400  
    4141    @Rule
    4242    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    43     public JOSMTestRules test = new JOSMTestRules().main().projection().i18n();
     43    public JOSMTestRules test = new JOSMTestRules().main().projection().i18n().metricSystem();
    4444
    4545    private static String getHtml(GpxLayer layer) {
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r15399 r15400  
    101101    private boolean territories;
    102102    private boolean rlTraffic;
     103    private boolean metric;
    103104    private boolean main;
    104105
     
    283284        territories();
    284285        rlTraffic = true;
     286        return this;
     287    }
     288
     289    /**
     290     * Force metric measurement system.
     291     * @return this instance, for easy chaining
     292     * @since 15400
     293     */
     294    public JOSMTestRules metricSystem() {
     295        metric = true;
    285296        return this;
    286297    }
     
    502513
    503514        // Make sure we're using the metric system
    504         SystemOfMeasurement.setSystemOfMeasurement(SystemOfMeasurement.METRIC.getName());
     515        if (metric) {
     516            SystemOfMeasurement.setSystemOfMeasurement(SystemOfMeasurement.METRIC.getName());
     517        }
    505518
    506519        if (useHttps) {
Note: See TracChangeset for help on using the changeset viewer.