com.carrotsearch.junitbenchmarks
Class BenchmarkRule

java.lang.Object
  extended by com.carrotsearch.junitbenchmarks.BenchmarkRule
All Implemented Interfaces:
org.junit.rules.TestRule

public final class BenchmarkRule
extends Object
implements org.junit.rules.TestRule

A benchmark rule (causes tests to be repeated and measured). Benchmark rule should be placed in the test class as a field, with annotation. Example:

 Rule
 public TestRule runBenchmarks = new BenchmarkRule();
 


Constructor Summary
BenchmarkRule()
          Creates a benchmark rule with the default sink for benchmark results (the default sink is taken from global properties).
BenchmarkRule(IResultsConsumer... consumers)
          Creates a benchmark rule with a given sink for benchmark results.
 
Method Summary
 org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
          Apply benchmarking to the given test description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BenchmarkRule

public BenchmarkRule()
Creates a benchmark rule with the default sink for benchmark results (the default sink is taken from global properties).


BenchmarkRule

public BenchmarkRule(IResultsConsumer... consumers)
Creates a benchmark rule with a given sink for benchmark results.

Method Detail

apply

public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
                                               org.junit.runner.Description description)
Apply benchmarking to the given test description.

Specified by:
apply in interface org.junit.rules.TestRule


Copyright © 2013 Carrot Search s.c.. All Rights Reserved.