Ignore:
Timestamp:
2016-06-14T19:26:16+02:00 (5 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/search/SearchCompilerTest.java

    r10299 r10373  
    55import static org.junit.Assert.assertFalse;
    66import static org.junit.Assert.assertTrue;
    7 
    8 import org.junit.Before;
     7import static org.junit.Assert.fail;
     8
     9import org.junit.Rule;
    910import org.junit.Test;
    10 import org.openstreetmap.josm.JOSMFixture;
    1111import org.openstreetmap.josm.actions.search.SearchCompiler.Match;
    1212import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;
     
    2323import org.openstreetmap.josm.data.osm.Way;
    2424import org.openstreetmap.josm.data.osm.WayData;
     25import org.openstreetmap.josm.testutils.JOSMTestRules;
    2526import org.openstreetmap.josm.tools.date.DateUtils;
    2627
     
    3132
    3233    /**
    33      * Setup test.
    34      */
    35     @Before
    36     public void setUp() {
    37         JOSMFixture.createUnitTestFixture().init();
    38     }
     34     * We need prefs for this. We access preferences when creating OSM primitives.
     35     */
     36    @Rule
     37    public JOSMTestRules test = new JOSMTestRules().preferences();
    3938
    4039    private static final class SearchContext {
     
    390389        try {
    391390            SearchCompiler.compile("foo type bar");
    392             throw new RuntimeException();
     391            fail();
    393392        } catch (ParseError parseError) {
    394393            assertEquals("<html>Expecting <code>:</code> after <i>type</i>", parseError.getMessage());
Note: See TracChangeset for help on using the changeset viewer.