Changeset 10553 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2016-07-17T14:54:06+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r10475 r10553 161 161 */ 162 162 protected void before() throws InitializationError { 163 cleanUpFromJosmFixture();164 165 163 // Tests are running headless by default. 166 164 System.setProperty("java.awt.headless", "true"); 165 166 cleanUpFromJosmFixture(); 167 167 168 // All tests use the same timezone. 168 169 TimeZone.setDefault(DateUtils.UTC); -
trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java
r9952 r10553 6 6 7 7 import org.junit.Assert; 8 import org.junit. BeforeClass;8 import org.junit.Rule; 9 9 import org.junit.Test; 10 import org.openstreetmap.josm.JOSMFixture;11 10 import org.openstreetmap.josm.TestUtils; 12 11 import org.openstreetmap.josm.actions.search.SearchCompiler; … … 16 15 import org.openstreetmap.josm.data.osm.Way; 17 16 import org.openstreetmap.josm.io.OsmReader; 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 20 19 21 /** … … 21 23 */ 22 24 public class GeometryTest { 23 24 25 /** 25 * Setup test.26 * Primitives need preferences and projection. 26 27 */ 27 @BeforeClass 28 public static void setUp() { 29 JOSMFixture.createUnitTestFixture().init(); 30 } 28 @Rule 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules().preferences().projection(); 31 31 32 32 /** -
trunk/test/unit/org/openstreetmap/josm/tools/OverpassTurboQueryWizardTest.java
r9856 r10553 4 4 import static org.junit.Assert.assertEquals; 5 5 6 import org.junit. BeforeClass;6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.JOSMFixture; 8 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 9 11 10 12 /** … … 12 14 */ 13 15 public class OverpassTurboQueryWizardTest { 14 15 16 /** 16 * Setup test.17 * Base test environment is enough 17 18 */ 18 @BeforeClass 19 public static void setUp() { 20 JOSMFixture.createUnitTestFixture().init(false); 21 OverpassTurboQueryWizard.getInstance(); 22 } 19 @Rule 20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 21 public JOSMTestRules test = new JOSMTestRules(); 23 22 24 23 /** -
trunk/test/unit/org/openstreetmap/josm/tools/PredicatesTest.java
r10399 r10553 11 11 import java.util.regex.Pattern; 12 12 13 import org.junit. BeforeClass;13 import org.junit.Rule; 14 14 import org.junit.Test; 15 import org.openstreetmap.josm.JOSMFixture;16 15 import org.openstreetmap.josm.data.osm.Node; 17 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 20 19 21 /** … … 24 26 public class PredicatesTest { 25 27 /** 26 * Not needed by this test, but JOSM has so many dependencies :-( 27 */ 28 @BeforeClass 29 public static void setUpClass() { 30 JOSMFixture.createUnitTestFixture().init(); 31 } 28 * Some of this depends on preferences. 29 */ 30 @Rule 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 public JOSMTestRules test = new JOSMTestRules().preferences(); 32 33 33 34 /** -
trunk/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java
r10378 r10553 7 7 8 8 import org.junit.Assert; 9 import org.junit. BeforeClass;9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.JOSMFixture; 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 12 14 13 15 /** … … 15 17 */ 16 18 public class TextTagParserTest { 17 18 19 /** 19 * S etup test.20 * Some of this depends on preferences. 20 21 */ 21 @BeforeClass 22 public static void setUp() { 23 JOSMFixture.createUnitTestFixture().init(); 24 } 22 @Rule 23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 24 public JOSMTestRules test = new JOSMTestRules().preferences(); 25 25 26 26 /** -
trunk/test/unit/org/openstreetmap/josm/tools/WindowGeometryTest.java
r10200 r10553 14 14 import javax.swing.JPanel; 15 15 16 import org.junit. BeforeClass;16 import org.junit.Rule; 17 17 import org.junit.Test; 18 import org.openstreetmap.josm.JOSMFixture;19 18 import org.openstreetmap.josm.Main; 19 import org.openstreetmap.josm.testutils.JOSMTestRules; 20 20 import org.openstreetmap.josm.tools.WindowGeometry.WindowGeometryException; 21 21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 22 23 import nl.jqno.equalsverifier.EqualsVerifier; 23 24 import nl.jqno.equalsverifier.Warning; … … 27 28 */ 28 29 public class WindowGeometryTest { 29 30 30 /** 31 * S etup test.31 * Some of this depends on preferences. 32 32 */ 33 @BeforeClass 34 public static void setUp() { 35 JOSMFixture.createUnitTestFixture().init(); 36 } 33 @Rule 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules().preferences(); 37 36 38 37 /** … … 53 52 assertEquals(new WindowGeometry(new Point(0, 0), dim), WindowGeometry.centerOnScreen(dim)); 54 53 assertEquals(new WindowGeometry(new Point(300, 250), dim), WindowGeometry.centerOnScreen(dim, null)); 54 55 Main.pref.put("gui.geometry", "x=0,y=0,width=800,height=600"); 56 assertEquals(new WindowGeometry(new Point(300, 250), dim), WindowGeometry.centerOnScreen(dim)); 55 57 } 56 58
Note:
See TracChangeset
for help on using the changeset viewer.