
com.carrotsearch.junitbenchmarks.AbstractBenchmark Maven / Gradle / Ivy
package com.carrotsearch.junitbenchmarks;
import org.junit.Rule;
import org.junit.rules.TestRule;
/**
* A superclass for tests that should be executed as benchmarks (several rounds, GC and
* time accounting). Provides a JUnit rule in {@link #benchmarkRun} that runs the tests
* repeatedly, logging the intermediate results (memory usage, times).
*
* Subclasses may add {@link BenchmarkOptions} at the class-level or to individual methods
* to override the defaults.
*
*/
public abstract class AbstractBenchmark
{
/**
* Enables the benchmark rule.
*/
@Rule
public TestRule benchmarkRun = new BenchmarkRule();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy