Changeset 10373 in josm for trunk/test
- Timestamp:
- 2016-06-14T19:26:16+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
r10364 r10373 8 8 import java.util.List; 9 9 10 import org.junit. BeforeClass;10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 12 import org.openstreetmap.josm.Main; 14 13 import org.openstreetmap.josm.data.imagery.ImageryInfo; 15 14 import org.openstreetmap.josm.gui.layer.TMSLayer; 16 15 import org.openstreetmap.josm.gui.layer.WMSLayer; 16 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 17 18 18 /** … … 20 20 */ 21 21 public final class AddImageryLayerActionTest { 22 23 22 /** 24 * Setup test.23 * We need prefs for this. We need platform for actions and the OSM API for checking blacklist. 25 24 */ 26 @BeforeClass 27 public static void setUp() { 28 JOSMFixture.createUnitTestFixture().init(true); 29 } 25 @Rule 26 public JOSMTestRules test = new JOSMTestRules().preferences().platform().fakeAPI(); 30 27 31 28 /** … … 35 32 public void testEnabledState() { 36 33 assertFalse(new AddImageryLayerAction(new ImageryInfo()).isEnabled()); 37 assertFalse(new AddImageryLayerAction(new ImageryInfo("google", "http://maps.google.com/api", "tms", null, null)).isEnabled());38 34 assertTrue(new AddImageryLayerAction(new ImageryInfo("foo_tms", "http://bar", "tms", null, null)).isEnabled()); 39 35 assertTrue(new AddImageryLayerAction(new ImageryInfo("foo_bing", "http://bar", "bing", null, null)).isEnabled()); -
trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java
r10299 r10373 5 5 import static org.junit.Assert.assertFalse; 6 6 import static org.junit.Assert.assertTrue; 7 8 import org.junit.Before; 7 import static org.junit.Assert.fail; 8 9 import org.junit.Rule; 9 10 import org.junit.Test; 10 import org.openstreetmap.josm.JOSMFixture;11 11 import org.openstreetmap.josm.actions.search.SearchCompiler.Match; 12 12 import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError; … … 23 23 import org.openstreetmap.josm.data.osm.Way; 24 24 import org.openstreetmap.josm.data.osm.WayData; 25 import org.openstreetmap.josm.testutils.JOSMTestRules; 25 26 import org.openstreetmap.josm.tools.date.DateUtils; 26 27 … … 31 32 32 33 /** 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(); 39 38 40 39 private static final class SearchContext { … … 390 389 try { 391 390 SearchCompiler.compile("foo type bar"); 392 throw new RuntimeException();391 fail(); 393 392 } catch (ParseError parseError) { 394 393 assertEquals("<html>Expecting <code>:</code> after <i>type</i>", parseError.getMessage());
Note:
See TracChangeset
for help on using the changeset viewer.