Changeset 17834 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2021-04-28T22:01:28+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java
r17275 r17834 5 5 6 6 import java.awt.Dimension; 7 import java.awt.Graphics2D; 7 8 import java.awt.Rectangle; 9 import java.awt.image.BufferedImage; 10 import java.nio.file.DirectoryStream; 11 import java.nio.file.Files; 12 import java.nio.file.Path; 13 import java.nio.file.Paths; 8 14 15 import org.junit.jupiter.api.Disabled; 9 16 import org.junit.jupiter.api.extension.RegisterExtension; 10 17 import org.junit.jupiter.api.Test; 11 18 import org.openstreetmap.josm.gui.layer.geoimage.ImageDisplay.VisRect; 19 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings; 12 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 13 21 … … 43 51 ImageDisplay.calculateDrawImageRectangle(new VisRect(0, 0, 10, 5), new Dimension(8, 6))); 44 52 } 53 54 /** 55 * Performance test for {@link ImageDisplay.LoadImageRunnable} 56 * @throws Exception if any error occurs 57 */ 58 @Test 59 @Disabled("Set working directory to image folder and run manually") 60 void testLoadImageRunnablePerformance() throws Exception { 61 ImageDisplay imageDisplay = new ImageDisplay(new ImageryFilterSettings()); 62 imageDisplay.setSize(640, 480); 63 Graphics2D graphics = new BufferedImage(640, 480, BufferedImage.TYPE_INT_RGB).createGraphics(); 64 try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(".").toAbsolutePath(), "*.{JPG,jpg}")) { 65 for (Path p : stream) { 66 Runnable loadImage = imageDisplay.setImage0(new ImageEntry(p.toFile())); 67 loadImage.run(); 68 imageDisplay.paintComponent(graphics); 69 } 70 } 71 } 45 72 }
Note:
See TracChangeset
for help on using the changeset viewer.