Changeset 17275 in josm for trunk/test/performance/org/openstreetmap/josm/data
- Timestamp:
- 2020-10-28T20:41:00+01:00 (6 years ago)
- Location:
- trunk/test/performance/org/openstreetmap/josm/data/osm
- Files:
-
- 5 edited
-
KeyValuePerformanceTest.java (modified) (8 diffs)
-
RoundingPerformanceTest.java (modified) (3 diffs)
-
visitor/paint/AbstractMapRendererPerformanceTestParent.java (modified) (5 diffs)
-
visitor/paint/StyledMapRendererPerformanceTest.java (modified) (3 diffs)
-
visitor/paint/WireframeMapRendererPerformanceTest.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java
r16913 r17275 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertFalse;6 import static org.junit. Assert.assertNotSame;7 import static org.junit. Assert.assertSame;8 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertFalse; 6 import static org.junit.jupiter.api.Assertions.assertNotSame; 7 import static org.junit.jupiter.api.Assertions.assertSame; 8 import static org.junit.jupiter.api.Assertions.assertTrue; 9 9 10 10 import java.security.SecureRandom; 11 11 import java.util.ArrayList; 12 12 import java.util.Random; 13 import java.util.concurrent.TimeUnit; 13 14 14 15 import org.apache.commons.lang3.RandomStringUtils; 15 16 import org.junit.Before; 16 import org.junit. Rule;17 import org.junit. Test;18 import org.junit. rules.Timeout;17 import org.junit.jupiter.api.Test; 18 import org.junit.jupiter.api.Timeout; 19 import org.junit.jupiter.api.extension.RegisterExtension; 19 20 import org.openstreetmap.josm.PerformanceTestUtils; 20 21 import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer; … … 28 29 * @author Michael Zangl 29 30 */ 30 public class KeyValuePerformanceTest { 31 @Timeout(value = 15*60, unit = TimeUnit.SECONDS) 32 class KeyValuePerformanceTest { 31 33 private static final int PUT_RUNS = 10000; 32 34 private static final int GET_RUNS = 100000; … … 38 40 39 41 /** 40 * Global timeout applied to all test methods.41 */42 @Rule43 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")44 public Timeout globalTimeout = Timeout.seconds(15*60);45 46 /**47 42 * Prepare the test. 48 43 */ 49 @R ule44 @RegisterExtension 50 45 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 51 46 public JOSMTestRules test = new JOSMTestRules().projection(); … … 56 51 @Test 57 52 @SuppressFBWarnings(value = "DM_STRING_CTOR", justification = "test Strings that are interned and those that are not") 58 publicvoid testMeasureStringEqualsIntern() {53 void testMeasureStringEqualsIntern() { 59 54 String str1Interned = "string1"; 60 55 String str1InternedB = "string1"; … … 134 129 */ 135 130 @Test 136 publicvoid testKeyValuePut() {131 void testKeyValuePut() { 137 132 for (double tagNodeRatio : TAG_NODE_RATIOS) { 138 133 int nodeCount = (int) (PUT_RUNS / tagNodeRatio); … … 158 153 @Test 159 154 @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT") 160 publicvoid testKeyValueGet() {155 void testKeyValueGet() { 161 156 for (double tagNodeRatio : TAG_NODE_RATIOS) { 162 157 KeyValueDataGenerator generator = OsmDataGenerator.getKeyValue(tagNodeRatio); … … 179 174 */ 180 175 @Test 181 publicvoid testKeyValueGetKeys() {176 void testKeyValueGetKeys() { 182 177 for (double tagNodeRatio : TAG_NODE_RATIOS) { 183 178 KeyValueDataGenerator generator = OsmDataGenerator.getKeyValue(tagNodeRatio); … … 202 197 @Test 203 198 @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT") 204 publicvoid testKeyValueGetKeysGet() {199 void testKeyValueGetKeysGet() { 205 200 for (double tagNodeRatio : TAG_NODE_RATIOS) { 206 201 KeyValueDataGenerator generator = OsmDataGenerator.getKeyValue(tagNodeRatio); -
trunk/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java
r10758 r17275 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertTrue; 5 5 6 import org.junit.Test; 6 import org.junit.jupiter.api.Test; 7 7 import org.openstreetmap.josm.data.coor.LatLon; 8 8 import org.openstreetmap.josm.data.coor.LatLonTest; … … 13 13 * Checks that rounding of coordinates is not too slow. 14 14 */ 15 publicclass RoundingPerformanceTest {15 class RoundingPerformanceTest { 16 16 17 17 private static double oldRoundToOsmPrecision(double value) { … … 25 25 @Test 26 26 @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT") 27 publicvoid testRounding() {27 void testRounding() { 28 28 final int n = 1000000; 29 29 long start = System.nanoTime(); -
trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java
r16006 r17275 11 11 import java.nio.file.Files; 12 12 import java.nio.file.Paths; 13 import java.util.concurrent.TimeUnit; 13 14 14 15 import javax.imageio.ImageIO; 15 16 16 import org.junit.Rule; 17 import org.junit.Test; 18 import org.junit.rules.Timeout; 17 import org.junit.jupiter.api.Test; 18 import org.junit.jupiter.api.Timeout; 19 19 import org.openstreetmap.josm.JOSMFixture; 20 20 import org.openstreetmap.josm.data.Bounds; … … 30 30 * Abstract superclass of {@code StyledMapRendererPerformanceTest} and {@code WireframeMapRendererPerformanceTest}. 31 31 */ 32 public abstract class AbstractMapRendererPerformanceTestParent { 32 @Timeout(value = 15*60, unit = TimeUnit.SECONDS) 33 abstract class AbstractMapRendererPerformanceTestParent { 33 34 34 35 private static final int IMG_WIDTH = 1400; … … 45 46 private static DataSet dsOverpass; 46 47 private static DataSet dsCity; 47 48 /**49 * Global timeout applied to all test methods.50 */51 @Rule52 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")53 public Timeout globalTimeout = Timeout.seconds(15*60);54 48 55 49 protected static void load() throws Exception { … … 112 106 113 107 @Test 114 publicvoid testRestriction() throws Exception {108 void testRestriction() throws Exception { 115 109 test(700, dsRestriction, new Bounds(51.12, 14.147472381591795, 51.128, 14.162492752075195)); 116 110 } 117 111 118 112 @Test 119 publicvoid testRestrictionSmall() throws Exception {113 void testRestrictionSmall() throws Exception { 120 114 test(1500, dsRestriction, new Bounds(51.125, 14.147, 51.128, 14.152)); 121 115 } 122 116 123 117 @Test 124 publicvoid testMultipolygon() throws Exception {118 void testMultipolygon() throws Exception { 125 119 test(400, dsMultipolygon, new Bounds(60, -180, 85, -122)); 126 120 } 127 121 128 122 @Test 129 publicvoid testMultipolygonSmall() throws Exception {123 void testMultipolygonSmall() throws Exception { 130 124 test(850, dsMultipolygon, new Bounds(-90, -180, 90, 180)); 131 125 } … … 135 129 * Complex polygon (Lake Ontario) with small download area. 136 130 */ 137 publicvoid testOverpassDownload() throws Exception {131 void testOverpassDownload() throws Exception { 138 132 test(20, dsOverpass, new Bounds(43.4510496, -76.536684, 43.4643202, -76.4954853)); 139 133 } 140 134 141 135 @Test 142 publicvoid testCity() throws Exception {136 void testCity() throws Exception { 143 137 test(50, dsCity, new Bounds(53.51, 13.20, 53.59, 13.34)); 144 138 } 145 139 146 140 @Test 147 publicvoid testCitySmall() throws Exception {141 void testCitySmall() throws Exception { 148 142 test(70, dsCity, new Bounds(52, 11, 55, 14)); 149 143 } 150 144 151 145 @Test 152 publicvoid testCityPart1() throws Exception {146 void testCityPart1() throws Exception { 153 147 test(250, dsCity, new Bounds(53.56, 13.25, 53.57, 13.26)); 154 148 } 155 149 156 150 @Test 157 publicvoid testCityPart2() throws Exception {151 void testCityPart2() throws Exception { 158 152 test(200, dsCity, new Bounds(53.55, 13.29, 53.57, 13.30)); 159 153 } 160 154 161 155 @Test 162 publicvoid testCitySmallPart2() throws Exception {156 void testCitySmallPart2() throws Exception { 163 157 test(200, dsCity, new Bounds(53.56, 13.295, 53.57, 13.30)); 164 158 } -
trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java
r10907 r17275 7 7 import javax.imageio.ImageIO; 8 8 9 import org.junit. AfterClass;10 import org.junit. BeforeClass;9 import org.junit.jupiter.api.AfterAll; 10 import org.junit.jupiter.api.BeforeAll; 11 11 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 12 12 … … 16 16 * Performance test of {@code StyledMapRenderer}. 17 17 */ 18 publicclass StyledMapRendererPerformanceTest extends AbstractMapRendererPerformanceTestParent {18 class StyledMapRendererPerformanceTest extends AbstractMapRendererPerformanceTestParent { 19 19 20 @Before Class20 @BeforeAll 21 21 public static void load() throws Exception { 22 22 AbstractMapRendererPerformanceTestParent.load(); … … 25 25 } 26 26 27 @After Class27 @AfterAll 28 28 public static void clean() throws Exception { 29 29 AbstractMapRendererPerformanceTestParent.clean(); -
trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java
r10907 r17275 2 2 package org.openstreetmap.josm.data.osm.visitor.paint; 3 3 4 import org.junit. AfterClass;5 import org.junit. BeforeClass;4 import org.junit.jupiter.api.AfterAll; 5 import org.junit.jupiter.api.BeforeAll; 6 6 7 7 /** 8 8 * Performance test of {@code WireframeMapRenderer}. 9 9 */ 10 publicclass WireframeMapRendererPerformanceTest extends AbstractMapRendererPerformanceTestParent {10 class WireframeMapRendererPerformanceTest extends AbstractMapRendererPerformanceTestParent { 11 11 12 @Before Class12 @BeforeAll 13 13 public static void load() throws Exception { 14 14 AbstractMapRendererPerformanceTestParent.load(); 15 15 } 16 16 17 @After Class17 @AfterAll 18 18 public static void clean() throws Exception { 19 19 AbstractMapRendererPerformanceTestParent.clean();
Note:
See TracChangeset
for help on using the changeset viewer.
