Changeset 18870 in josm for trunk/test/functional
- Timestamp:
- 2023-10-16T15:19:07+02:00 (13 months ago)
- Location:
- trunk/test/functional/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java
r18294 r18870 12 12 13 13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.extension.RegisterExtension;15 14 import org.openstreetmap.josm.data.osm.DataSet; 16 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 16 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 18 17 import org.openstreetmap.josm.io.OsmReader; 19 import org.openstreetmap.josm.testutils.JOSMTestRules; 20 21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 22 19 23 20 /** 24 21 * Test of boundaries OSM file. 25 22 */ 23 @BasicPreferences 26 24 class BoundariesTestIT { 27 25 … … 46 44 "US-PR", "US-RI", "US-SC", "US-SD", "US-TN", "US-TX", "US-UM", "US-UT", "US-VT", "US-VA", "US-VI", "US-WA", "US-WV", "US-WI", 47 45 "US-WY"); 48 49 /**50 * Setup test.51 */52 @RegisterExtension53 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")54 public JOSMTestRules test = new JOSMTestRules().preferences();55 46 56 47 /** -
trunk/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java
r17275 r18870 7 7 8 8 import org.junit.jupiter.api.Test; 9 import org.junit.jupiter.api. extension.RegisterExtension;9 import org.junit.jupiter.api.Timeout; 10 10 import org.openstreetmap.josm.spi.preferences.Config; 11 import org.openstreetmap.josm.testutils. JOSMTestRules;11 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 12 12 import org.openstreetmap.josm.tools.HttpClient; 13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 13 16 14 /** … … 18 16 * See <a href="https://josm.openstreetmap.de/wiki/ImageryCompare">JOSM wiki</a> 19 17 */ 18 @BasicPreferences 19 @Timeout(60) 20 20 class ImageryCompareTestIT { 21 21 22 22 private static final String BLACK_PREFIX = "<pre style=\"margin:3px;color:black\">"; 23 23 private static final String RED_PREFIX = "<pre style=\"margin:3px;color:red\">"; 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules().preferences().timeout(60000);31 24 32 25 /** -
trunk/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java
r18723 r18870 10 10 import java.util.List; 11 11 12 import org.junit.jupiter.api.Test; 13 import org.junit.jupiter.api.Timeout; 14 import org.openstreetmap.josm.data.coor.LatLon; 15 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker; 16 import org.openstreetmap.josm.data.validation.tests.TagChecker; 17 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException; 18 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 19 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 20 import org.openstreetmap.josm.tools.HttpClient; 21 12 22 import jakarta.json.Json; 13 23 import jakarta.json.JsonObject; … … 15 25 import jakarta.json.JsonValue; 16 26 17 import org.junit.jupiter.api.Test;18 import org.junit.jupiter.api.extension.RegisterExtension;19 import org.openstreetmap.josm.data.coor.LatLon;20 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;21 import org.openstreetmap.josm.data.validation.tests.TagChecker;22 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;23 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;24 import org.openstreetmap.josm.testutils.JOSMTestRules;25 import org.openstreetmap.josm.tools.HttpClient;26 import org.xml.sax.SAXException;27 28 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;29 30 27 /** 31 28 * Various integration tests with Taginfo. 32 29 */ 30 @BasicPreferences 31 @Timeout(20) 33 32 class TaginfoTestIT { 34 35 /**36 * Setup test.37 */38 @RegisterExtension39 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")40 public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000);41 42 33 /** 43 34 * Checks that popular tags are known (i.e included in internal presets, or deprecated, or explicitely ignored) 44 * @throws SAXException if any XML parsing error occurs45 35 * @throws IOException if any I/O error occurs 46 36 * @throws ParseException if any MapCSS parsing error occurs 47 37 */ 48 38 @Test 49 void testCheckPopularTags() throws SAXException,IOException, ParseException {39 void testCheckPopularTags() throws IOException, ParseException { 50 40 TaggingPresets.readFromPreferences(); 51 41 new TagChecker().initialize(); -
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
r17276 r18870 28 28 import javax.imageio.ImageIO; 29 29 30 import org.junit.jupiter.api.extension.RegisterExtension;31 30 import org.junit.jupiter.params.ParameterizedTest; 32 31 import org.junit.jupiter.params.provider.MethodSource; … … 40 39 import org.openstreetmap.josm.io.IllegalDataException; 41 40 import org.openstreetmap.josm.io.OsmReader; 42 import org.openstreetmap.josm.testutils.JOSMTestRules; 41 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 42 import org.openstreetmap.josm.testutils.annotations.Projection; 43 43 import org.openstreetmap.josm.tools.ColorHelper; 44 44 import org.openstreetmap.josm.tools.Utils; 45 46 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;47 45 48 46 /** … … 52 50 * @author Michael Zangl 53 51 */ 52 @BasicPreferences 53 @Projection 54 54 public class MapCSSRendererTest { 55 55 private static final String TEST_DATA_BASE = "/renderer/"; … … 59 59 private static final Bounds AREA_DEFAULT = new Bounds(0, 0, 1, 1); 60 60 private static final int IMAGE_SIZE = 256; 61 62 /**63 * Minimal test rules required64 */65 @RegisterExtension66 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")67 public JOSMTestRules test = new JOSMTestRules().preferences().projection();68 61 69 62 // development flag - set to true in order to update all reference images -
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
r17809 r18870 10 10 import java.awt.image.BufferedImage; 11 11 import java.io.File; 12 import java.io.IOException; 12 13 import java.io.InputStream; 13 14 import java.util.IdentityHashMap; 14 15 15 16 import org.junit.jupiter.api.AfterAll; 17 import org.junit.jupiter.api.BeforeAll; 16 18 import org.junit.jupiter.api.BeforeEach; 17 19 import org.junit.jupiter.api.Test; 18 import org.junit.jupiter.api. extension.RegisterExtension;20 import org.junit.jupiter.api.Timeout; 19 21 import org.openstreetmap.josm.data.Bounds; 20 22 import org.openstreetmap.josm.data.osm.DataSet; … … 27 29 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 28 30 import org.openstreetmap.josm.io.Compression; 31 import org.openstreetmap.josm.io.IllegalDataException; 29 32 import org.openstreetmap.josm.io.OsmReader; 30 import org.openstreetmap.josm.testutils.JOSMTestRules; 33 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 34 import org.openstreetmap.josm.testutils.annotations.Main; 35 import org.openstreetmap.josm.testutils.annotations.Projection; 31 36 import org.openstreetmap.josm.tools.Pair; 32 33 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;34 37 35 38 /** 36 39 * Test {@link StyleCache}. 37 40 */ 41 @BasicPreferences 42 @Main 43 @org.openstreetmap.josm.testutils.annotations.MapPaintStyles 44 @Projection 45 @Timeout(60) 38 46 class StyleCacheTest { 39 47 … … 47 55 private static DataSet dsCity2; 48 56 49 /** 50 * The test rules used for this test. 51 */ 52 @RegisterExtension 53 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 54 public JOSMTestRules test = new JOSMTestRules().main().preferences().projection().mapStyles().timeout(60000); 57 @BeforeAll 58 static void beforeAll() throws IllegalDataException, IOException { 59 try (InputStream in = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2"))) { 60 dsCity = OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE); 61 } 62 dsCity2 = new DataSet(dsCity); 63 } 55 64 56 65 /** … … 61 70 public void load() throws Exception { 62 71 img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_ARGB); 63 try (InputStream in = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2"))) {64 dsCity = OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);65 }66 dsCity2 = new DataSet(dsCity);67 72 } 68 73 … … 97 102 * Verifies, that the intern pool is not growing when repeatedly rendering the 98 103 * same set of primitives (and clearing the calculated styles each time). 99 * 104 * <p> 100 105 * If it grows, this is an indication that the {@code equals} and {@code hashCode} 101 106 * implementation is broken and two identical objects are not recognized as equal 102 107 * or produce different hash codes. 103 * 108 * <p> 104 109 * The opposite problem (different objects are mistaken as equal) has more visible 105 110 * consequences for the user (wrong rendering on the map) and is not recognized by … … 135 140 * Verifies, that the number of {@code StyleElementList} instances stored 136 141 * for all the rendered primitives is actually low (as intended). 137 * 142 * <p> 138 143 * Two primitives with the same style should share one {@code StyleElementList} 139 144 * instance for the cached style elements. This is verified by counting all
Note:
See TracChangeset
for help on using the changeset viewer.