Changeset 12568 in josm for trunk/test/unit/org
- Timestamp:
- 2017-08-04T20:03:38+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java
r11403 r12568 6 6 7 7 import org.junit.Before; 8 import org.junit.Rule; 8 9 import org.junit.Test; 9 import org.openstreetmap.josm.JOSMFixture; 10 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 10 import org.openstreetmap.josm.testutils.JOSMTestRules; 11 12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 11 13 12 14 /** … … 19 21 /** 20 22 * Setup test 23 */ 24 @Rule 25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 26 public JOSMTestRules rule = new JOSMTestRules().presets(); 27 28 /** 29 * Setup test 21 30 * @throws Exception if an error occurs 22 31 */ 23 32 @Before 24 33 public void setUp() throws Exception { 25 JOSMFixture.createUnitTestFixture().init();26 TaggingPresets.readFromPreferences();27 34 test.initialize(); 28 35 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
r12564 r12568 35 35 @Rule 36 36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 37 public JOSMTestRules test = new JOSMTestRules().projection(). preferences();37 public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main().platform(); 38 38 39 39 private static Way createUnclosedWay(String tags) { -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
r10743 r12568 10 10 import java.util.List; 11 11 12 import org.junit. BeforeClass;12 import org.junit.Rule; 13 13 import org.junit.Test; 14 import org.openstreetmap.josm.JOSMFixture;15 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 15 import org.openstreetmap.josm.data.osm.OsmUtils; 17 16 import org.openstreetmap.josm.data.osm.Tag; 18 17 import org.openstreetmap.josm.data.validation.TestError; 19 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 18 import org.openstreetmap.josm.testutils.JOSMTestRules; 19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 20 21 21 22 /** … … 27 28 * Setup test. 28 29 */ 29 @BeforeClass 30 public static void setUp() { 31 JOSMFixture.createUnitTestFixture().init(); 32 TaggingPresets.readFromPreferences(); 33 } 30 @Rule 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 public JOSMTestRules rule = new JOSMTestRules().presets(); 34 33 35 34 List<TestError> test(OsmPrimitive primitive) throws IOException { -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
r12564 r12568 31 31 @Rule 32 32 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 33 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection() ;33 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection().mapStyles(); 34 34 35 35 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r12564 r12568 41 41 @Rule 42 42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 43 public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection() ;43 public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection().i18n(); 44 44 45 45 private static String getHtml(GpxLayer layer) { … … 146 146 " </td>\n" + 147 147 " <td>\n" + 148 " 1/3/16 1 2:59 PM - 1:00 PM (0:00)\n" +148 " 1/3/16 11:59 AM - 12:00 PM (0:00)\n" + 149 149 " </td>\n" + 150 150 " <td>\n" + -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java
r9996 r12568 10 10 import javax.swing.JPanel; 11 11 12 import org.junit. BeforeClass;12 import org.junit.Rule; 13 13 import org.junit.Test; 14 import org.openstreetmap.josm.JOSMFixture;15 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 15 import org.openstreetmap.josm.testutils.JOSMTestRules; 16 17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 17 18 18 19 /** … … 24 25 * Setup test. 25 26 */ 26 @BeforeClass 27 public static void setUp() { 28 JOSMFixture.createUnitTestFixture().init(); 29 TaggingPresets.readFromPreferences(); 30 } 27 @Rule 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules rule = new JOSMTestRules().presets(); 31 30 32 31 /** -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r12566 r12568 20 20 import org.openstreetmap.josm.gui.MainMenu; 21 21 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 22 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 22 23 import org.openstreetmap.josm.gui.util.GuiHelper; 23 24 import org.openstreetmap.josm.io.CertificateAmendment; … … 54 55 private boolean allowMemoryManagerLeaks; 55 56 private boolean useMapStyles; 57 private boolean usePresets; 56 58 private boolean useHttps; 57 59 private boolean territories; … … 189 191 preferences(); 190 192 useMapStyles = true; 193 return this; 194 } 195 196 /** 197 * Use presets in this test. 198 * @return this instance, for easy chaining 199 * @since 12568 200 */ 201 public JOSMTestRules presets() { 202 preferences(); 203 usePresets = true; 191 204 return this; 192 205 } … … 325 338 // Reset the map paint styles. 326 339 MapPaintStyles.readFromPreferences(); 340 } 341 342 if (usePresets) { 343 // Reset the presets. 344 TaggingPresets.readFromPreferences(); 327 345 } 328 346
Note:
See TracChangeset
for help on using the changeset viewer.