src/test/java/org/apache/bval/bench/AbstractBenchTest.java
@Test
    public void checkRawValidationSpeed() {

        Validator validator = getValidatorFactory().getValidator();

        // Initial parse
        for (Object o : holder.beans) {
            rvErrors += validator.validate(o).size();
        }

        // Check validation speed
        for (int i = 0; i < Config.CFG.numTestRepetitions(); ++i) {
            long initTime = System.nanoTime();
            for (Object o : holder.beans) {
                rvErrors += validator.validate(o).size();
            }
            rvTime += System.nanoTime() - initTime;
        }

    }
/**
     * Tests the speed of validating beans that are already parsed.
     */
Tests the speed of validating beans that are already parsed.
Tests the speed of validating beans that are already parsed .
@Test
    public void checkRawValidationSpeed() {
        Validator validator = getValidatorFactory().getValidator();
        for (Object o : holder.beans) {
            rvErrors += validator.validate(o).size();
        }
        for (int i = 0; i < Config.CFG.numTestRepetitions(); ++i) {
            long initTime = System.nanoTime();
            for (Object o : holder.beans) {
                rvErrors += validator.validate(o).size();
            }
            rvTime += System.nanoTime() - initTime;
        }
    }
@ Test public void checkRawValidationSpeed ( ) { Validator validator = getValidatorFactory ( ) . getValidator ( ) ; for ( Object o : holder . beans ) { rvErrors += validator . validate ( o ) . size ( ) ; } for ( int i = 0 ; i < Config . CFG . numTestRepetitions ( ) ; ++ i ) { long initTime = System . nanoTime ( ) ; for ( Object o : holder . beans ) { rvErrors += validator . validate ( o ) . size ( ) ; } rvTime += System . nanoTime ( ) - initTime ; } }
Tests the speed of validating beans that are already parsed.
Tests the speed of validating beans that are already parsed .
// Initial parse // Check validation speed