Changeset 18690 in josm for trunk/test/performance/org
- Timestamp:
- 2023-03-13T21:59:27+01:00 (21 months ago)
- Location:
- trunk/test/performance/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java
r17275 r18690 3 3 4 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assert False;5 import static org.junit.jupiter.api.Assertions.assertNotEquals; 6 6 import static org.junit.jupiter.api.Assertions.assertNotSame; 7 7 import static org.junit.jupiter.api.Assertions.assertSame; … … 14 14 15 15 import org.apache.commons.lang3.RandomStringUtils; 16 import org.junit. Before;16 import org.junit.jupiter.api.BeforeEach; 17 17 import org.junit.jupiter.api.Test; 18 18 import org.junit.jupiter.api.Timeout; … … 29 29 * @author Michael Zangl 30 30 */ 31 @Timeout(value = 15 *60, unit = TimeUnit.SECONDS)31 @Timeout(value = 15, unit = TimeUnit.MINUTES) 32 32 class KeyValuePerformanceTest { 33 33 private static final int PUT_RUNS = 10000; … … 96 96 timer = PerformanceTestUtils.startTimer("str1.equals(str2) = fails (without intern)"); 97 97 for (int i = 0; i < STRING_INTERN_TESTS; i++) { 98 assert False(str1.equals(str2));98 assertNotEquals(str1, str2); 99 99 } 100 100 timer.done(); … … 116 116 * Generate an array of test strings. 117 117 */ 118 @Before 118 @BeforeEach 119 119 public void generateTestStrings() { 120 120 testStrings.clear(); -
trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java
r17615 r18690 31 31 * Abstract superclass of {@code StyledMapRendererPerformanceTest} and {@code WireframeMapRendererPerformanceTest}. 32 32 */ 33 @Timeout(value = 15 *60, unit = TimeUnit.SECONDS)33 @Timeout(value = 15, unit = TimeUnit.MINUTES) 34 34 abstract class AbstractMapRendererPerformanceTestParent { 35 35 … … 79 79 try (InputStream fisR = Files.newInputStream(Paths.get("nodist/data/restriction.osm")); 80 80 InputStream fisM = Files.newInputStream(Paths.get("nodist/data/multipolygon.osm")); 81 InputStream fisO = Compression.getUncompressedFileInputStream(new File("nodist/data/overpass-download.osm.bz2")) ;) {81 InputStream fisO = Compression.getUncompressedFileInputStream(new File("nodist/data/overpass-download.osm.bz2"))) { 82 82 dsRestriction = OsmReader.parseDataSet(fisR, NullProgressMonitor.INSTANCE); 83 83 dsMultipolygon = OsmReader.parseDataSet(fisM, NullProgressMonitor.INSTANCE); … … 125 125 } 126 126 127 @Test128 127 /** 129 128 * Complex polygon (Lake Ontario) with small download area. 130 129 */ 130 @Test 131 131 void testOverpassDownload() throws Exception { 132 132 test(20, dsOverpass, new Bounds(43.4510496, -76.536684, 43.4643202, -76.4954853)); -
trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
r17615 r18690 3 3 4 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertNotNull; 6 import static org.junit.jupiter.api.Assertions.assertTrue; 5 7 6 8 import java.awt.Color; … … 21 23 import javax.imageio.ImageIO; 22 24 23 import org.junit.Assert;24 25 import org.junit.jupiter.api.AfterAll; 25 26 import org.junit.jupiter.api.BeforeAll; … … 125 126 List<StyleSource> sources = MapPaintStyles.getStyles().getStyleSources(); 126 127 filterStyleIdx = sources.indexOf(filterStyle); 127 Assert.assertEquals(2, filterStyleIdx);128 129 Assert.assertEquals(Feature.values().length, filterStyle.settings.size());128 assertEquals(2, filterStyleIdx); 129 130 assertEquals(Feature.values().length, filterStyle.settings.size()); 130 131 for (StyleSetting set : filterStyle.settings) { 131 132 BooleanStyleSetting bset = (BooleanStyleSetting) set; … … 139 140 } 140 141 } 141 Assert.assertTrue(prefKey, found);142 assertTrue(found, prefKey); 142 143 } 143 144 … … 151 152 } 152 153 } 153 Assert.assertNotNull(defaultStyle);154 assertNotNull(defaultStyle); 154 155 155 156 for (StyleSetting set : defaultStyle.settings) { … … 161 162 } 162 163 } 163 Assert.assertNotNull(hideIconsSetting);164 assertNotNull(hideIconsSetting); 164 165 hideIconsSetting.setValue(false); 165 166 MapPaintStyleLoader.reloadStyles(defaultStyleIdx); … … 209 210 if (checkScale) { 210 211 int lvl = Selector.GeneralSelector.scale2level(nc.getDist100Pixel()); 211 Assert.assertEquals(17, lvl);212 assertEquals(17, lvl); 212 213 } 213 214 … … 360 361 361 362 public void dumpTimes() { 362 System.out.print (String.format("gen. %4d, sort %4d, draw %4d%n", getGenerateTime(), getSortTime(), getDrawTime()));363 System.out.printf("gen. %4d, sort %4d, draw %4d%n", getGenerateTime(), getSortTime(), getDrawTime()); 363 364 } 364 365 -
trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java
r17275 r18690 18 18 * @author Michael Zangl 19 19 */ 20 @Timeout(value = 15 *60, unit = TimeUnit.SECONDS)20 @Timeout(value = 15, unit = TimeUnit.MINUTES) 21 21 class MapCSSStyleSourceFilterTest { 22 22 … … 71 71 72 72 private void addRule(String selector) { 73 sb.append(selector +" {}\n");73 sb.append(selector).append(" {}\n"); 74 74 } 75 75 -
trunk/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java
r17615 r18690 10 10 import java.io.IOException; 11 11 import java.io.InputStream; 12 import java.nio.file.Files; 12 13 import java.util.concurrent.TimeUnit; 13 14 … … 27 28 * @author Michael Zangl 28 29 */ 29 @Timeout(value = 15 *60, unit = TimeUnit.SECONDS)30 @Timeout(value = 15, unit = TimeUnit.MINUTES) 30 31 class OsmReaderPerformanceTest { 31 32 private static final int TIMES = 4; … … 73 74 private InputStream loadFile(boolean decompressBeforeRead) throws IOException { 74 75 File file = new File(PerformanceTestUtils.DATA_FILE); 75 try (InputStream is = decompressBeforeRead ? Compression.getUncompressedFileInputStream(file) : new FileInputStream(file)) {76 try (InputStream is = decompressBeforeRead ? Compression.getUncompressedFileInputStream(file) : Files.newInputStream(file.toPath())) { 76 77 ByteArrayOutputStream temporary = new ByteArrayOutputStream(); 77 78 byte[] readBuffer = new byte[4096]; -
trunk/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java
r17848 r18690 20 20 * For this, we use the neubrandenburg-file, which is a good real world example of an OSM file. 21 21 */ 22 @Timeout(value = 15 *60, unit = TimeUnit.SECONDS)22 @Timeout(value = 15, unit = TimeUnit.MINUTES) 23 23 class OsmWriterPerformanceTest { 24 24 private static final int TIMES = 4;
Note:
See TracChangeset
for help on using the changeset viewer.