Changeset 17617 in josm


Ignore:
Timestamp:
2021-03-21T13:56:17+01:00 (4 years ago)
Author:
simon04
Message:

see #4626 - Add ValidationTaskPerformanceTest

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/ValidationTask.java

    r17616 r17617  
    88import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    99import org.openstreetmap.josm.gui.layer.ValidatorLayer;
     10import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     11import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
    1012import org.openstreetmap.josm.gui.util.GuiHelper;
    1113
     
    3638                          Collection<OsmPrimitive> validatedPrimitives,
    3739                          Collection<OsmPrimitive> formerValidatedPrimitives) {
    38         super(tr("Validating"), false /*don't ignore exceptions */);
     40        this(new PleaseWaitProgressMonitor(tr("Validating")), tests, validatedPrimitives, formerValidatedPrimitives);
     41    }
     42
     43    protected ValidationTask(ProgressMonitor progressMonitor,
     44                             Collection<Test> tests,
     45                             Collection<OsmPrimitive> validatedPrimitives,
     46                             Collection<OsmPrimitive> formerValidatedPrimitives) {
     47        super(tr("Validating"), progressMonitor, false /*don't ignore exceptions */);
    3948        this.validatedPrimitives = validatedPrimitives;
    4049        this.formerValidatedPrimitives = formerValidatedPrimitives;
     
    94103        }
    95104    }
     105
     106    /**
     107     * Gets the validation errors accumulated until this moment.
     108     * @return The list of errors
     109     */
     110    public List<TestError> getErrors() {
     111        return errors;
     112    }
    96113}
  • trunk/test/performance/org/openstreetmap/josm/PerformanceTestUtils.java

    r17615 r17617  
    3737    public static DataSet getNeubrandenburgDataSet() throws IOException, IllegalDataException {
    3838        try (InputStream in = Compression.getUncompressedFileInputStream(new File(DATA_FILE))) {
    39             return OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);
     39            DataSet dataSet = OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);
     40            dataSet.setName(DATA_FILE);
     41            return dataSet;
    4042        }
    4143    }
  • trunk/test/performance/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerPerformanceTest.java

    r17615 r17617  
    3939    @Test
    4040    void testCity() {
    41         tagChecker.visit(dsCity.allPrimitives());
     41        PerformanceTestUtils.runPerformanceTest("MapCSSTagChecker on " + dsCity.getName(),
     42                () -> tagChecker.visit(dsCity.allPrimitives()));
    4243    }
    4344}
Note: See TracChangeset for help on using the changeset viewer.