org.apache.sling.performance

## Class PerformanceRunner

- java.lang.Object
- - org.junit.runner.Runner
  - - org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
    - - org.junit.runners.BlockJUnit4ClassRunner
      - - org.apache.sling.performance.PerformanceRunner

All Implemented Interfaces:
  org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

    public class PerformanceRunner
    extends org.junit.runners.BlockJUnit4ClassRunner

The custom JUnit runner that collects the performance tests

### Nested Class Summary

Nested Classes
`static interface` `PerformanceRunner.Parameters`
`static class` `PerformanceRunner.ReportLevel`

### Field Summary

Fields
`String` `referenceMethod`
`PerformanceRunner.ReportLevel` `reportLevel`
`protected LinkedList<org.junit.runners.model.FrameworkMethod>` `tests`

### Constructor Summary

Constructors
Constructor and Description
`PerformanceRunner(Class<?> clazz)`

### Method Summary

Methods
`protected Collection<? extends org.junit.runners.model.FrameworkMethod>` `computePerformanceTests()` Compute performance tests
`protected List<org.junit.runners.model.FrameworkMethod>` `computeTestMethods()`
`protected void` `computeTests()` Compute the tests that will be run
`void` `run(org.junit.runner.notification.RunNotifier notifier)`
`protected void` `validateInstanceMethods(List<Throwable> errors)` Need to override method otherwise the validation will fail because of some hardcoded conditions in JUnit

### Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

`collectInitializationErrors, createTest, describeChild, getChildren, methodBlock, methodInvoker, possiblyExpectingExceptions, runChild, testName, validateConstructor, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout`

### Methods inherited from class org.junit.runners.ParentRunner

`childrenInvoker, classBlock, filter, getDescription, getName, getTestClass, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses`

### Methods inherited from class org.junit.runner.Runner

`testCount`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### tests

    protected LinkedList<org.junit.runners.model.FrameworkMethod> tests

#### reportLevel

    public PerformanceRunner.ReportLevel reportLevel

#### referenceMethod

    public String referenceMethod

### Constructor Detail

#### PerformanceRunner

    public PerformanceRunner(Class<?> clazz)
                      throws org.junit.runners.model.InitializationError

Throws:
  `org.junit.runners.model.InitializationError`

### Method Detail

#### run

    public void run(org.junit.runner.notification.RunNotifier notifier)

Overrides:
  `run` in class `org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>`

#### computeTests

    protected void computeTests()
                         throws Exception

Compute the tests that will be run

Throws:
  `Exception`

#### computePerformanceTests

    protected Collection<? extends org.junit.runners.model.FrameworkMethod> computePerformanceTests()
                                                                                             throws Exception

Compute performance tests

Returns:
  the list containing the performance test methods
Throws:
  `Exception`

#### computeTestMethods

    protected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()

Overrides:
  `computeTestMethods` in class `org.junit.runners.BlockJUnit4ClassRunner`
See Also:
  `BlockJUnit4ClassRunner.computeTestMethods()`

#### validateInstanceMethods

    protected void validateInstanceMethods(List<Throwable> errors)

Need to override method otherwise the validation will fail because of some hardcoded conditions in JUnit

Overrides:
  `validateInstanceMethods` in class `org.junit.runners.BlockJUnit4ClassRunner`