- Timestamp:
- 2016-06-16T16:37:27+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
r10396 r10402 16 16 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 19 18 20 /** 19 21 * Unit tests for class {@link AddImageryLayerAction}. … … 24 26 */ 25 27 @Rule 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 26 29 public JOSMTestRules test = new JOSMTestRules().preferences().platform().fakeAPI(); 27 30 -
trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
r10375 r10402 13 13 import org.CustomMatchers; 14 14 import org.junit.Before; 15 import org.junit. BeforeClass;15 import org.junit.Rule; 16 16 import org.junit.Test; 17 import org.openstreetmap.josm.JOSMFixture;18 17 import org.openstreetmap.josm.Main; 19 18 import org.openstreetmap.josm.data.Bounds; … … 22 21 import org.openstreetmap.josm.data.coor.LatLon; 23 22 import org.openstreetmap.josm.gui.util.GuiHelper; 23 import org.openstreetmap.josm.testutils.JOSMTestRules; 24 25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 24 26 25 27 /** … … 35 37 36 38 /** 37 * Setup test.39 * We need the projection for coordinate conversions. 38 40 */ 39 @BeforeClass 40 public static void setUpBeforeClass() { 41 JOSMFixture.createUnitTestFixture().init(); 42 } 41 @Rule 42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 43 public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection(); 43 44 44 45 /** -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r10373 r10402 12 12 import org.junit.runners.model.Statement; 13 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.data.projection.Projections; 14 15 import org.openstreetmap.josm.gui.layer.MainLayerManager; 15 16 import org.openstreetmap.josm.gui.util.GuiHelper; … … 35 36 private String i18n = null; 36 37 private boolean platform; 38 private boolean useProjection; 37 39 38 40 /** … … 117 119 public JOSMTestRules fakeAPI() { 118 120 useAPI = APIType.FAKE; 121 return this; 122 } 123 124 /** 125 * Set up default projection (Mercator) 126 * @return this instance, for easy chaining 127 */ 128 public JOSMTestRules projection() { 129 useProjection = true; 119 130 return this; 120 131 } … … 174 185 } 175 186 187 if (useProjection) { 188 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 189 } 190 176 191 // Set API 177 192 if (useAPI == APIType.DEV) { … … 214 229 215 230 // TODO: Remove global listeners and other global state. 216 217 231 Main.pref = null; 218 232 Main.platform = null;
Note:
See TracChangeset
for help on using the changeset viewer.