private void validatePerformanceTestsExecutionStrategy()

in src/main/java/org/apache/sling/junit/performance/runner/PerformanceRunner.java [83:107]


    private void validatePerformanceTestsExecutionStrategy(List<Throwable> errors) {
        for (FrameworkMethod method : getTestClass().getAnnotatedMethods(PerformanceTest.class)) {
            int warmUpInvocations = getWarmUpInvocations(method);
            int warmUpTime = getWarmUpTime(method);

            if (warmUpInvocations <= 0 && warmUpTime <= 0) {
                errors.add(new Error("Method " + method.getName() + "() should provide a valid warmUpInvocations or warmUpTime"));
            }

            if (warmUpInvocations > 0 && warmUpTime > 0) {
                errors.add(new Error("Method " + method.getName() + "() provides both a valid warmUpInvocations and a warmUpTime"));
            }

            int runInvocations = getRunInvocations(method);
            int runTime = getRunTime(method);

            if (runInvocations <= 0 && runTime <= 0) {
                errors.add(new Error("Method " + method.getName() + "() should provide a valid runInvocations or runTime"));
            }

            if (runInvocations > 0 && runTime > 0) {
                errors.add(new Error("Method " + method.getName() + "() provides both a valid runInvocations or runTime"));
            }
        }
    }