All Classes
-
All Classes Interface Summary Class Summary Enum Summary Exception Summary Error Summary Annotation Types Summary Class Description ActiveTestSuite A TestSuite for active Tests.After If you allocate external resources in aBefore
method you need to release them after the test runs.AfterClass If you allocate expensive external resources in aBeforeClass
method you need to release them after all the tests in the class have run.AllTests Runner for use with JUnit 3.8.x-style AllTests classes (those that only implement a staticsuite()
method).Alphanumeric A sorter that orders tests alphanumerically by test name.Annotatable A model element that may have annotations.AnnotationsValidator AnAnnotationsValidator
validates all annotations of a test class, including its annotated fields and methods.AnnotationValidator Validates annotations on classes and methods.AnnotationValidatorFactory Creates instances of Annotation Validators.Assert Deprecated. Please useAssert
instead.Assert A set of assertion methods useful for writing tests.AssertionFailedError Thrown when an assertion failed.Assume A set of methods useful for stating assumptions about the conditions in which a test is meaningful.AssumptionViolatedException An exception class used to implement assumptions (state in which a given test is meaningful and should or should not be executed).BaseTestRunner Base class for all test runners.Before When writing tests, it is common to find that several tests need similar objects created before they can run.BeforeClass Sometimes several tests need to share computationally expensive setup (like logging into a database).BlockJUnit4ClassRunner Implements the JUnit 4 standard test case class model, as defined by the annotations in the org.junit package.BlockJUnit4ClassRunnerWithParameters ABlockJUnit4ClassRunner
with parameters support.BlockJUnit4ClassRunnerWithParametersFactory AParametersRunnerFactory
that createsBlockJUnit4ClassRunnerWithParameters
.Categories From a given set of test classes, runs only the classes and methods that are annotated with either the category given with the @IncludeCategory annotation, or a subtype of that category.Categories.CategoryFilter Categories.ExcludeCategory Categories.IncludeCategory Category Marks a test class or test method as belonging to one or more categories of tests.CategoryValidator Validates that there are no errors in the use of theCategory
annotation.ClassRule Annotates static fields that reference rules or methods that return them.ComparisonCompactor ComparisonFailure Thrown when an assert equals for Strings failed.ComparisonFailure Thrown when anassertEquals(String, String)
fails.Computer Represents a strategy for computing runners and suites.CouldNotReadCoreException Thrown when Max cannot read the MaxCore serializationDataPoint Annotating an field or method with @DataPoint will cause the field value or the value returned by the method to be used as a potential parameter for theories in that class, when run with theTheories
runner.DataPoints Annotating an array or iterable-typed field or method with @DataPoints will cause the values in the array or iterable given to be used as potential parameters for theories in that class when run with theTheories
runner.Describable Represents an object that can describe itselfDescription ADescription
describes a test which is to be run or has been run.DisableOnDebug TheDisableOnDebug
Rule allows you to label certain rules to be disabled when debugging.Enclosed If you put tests in inner classes, Ant, for example, won't find them.ErrorCollector The ErrorCollector rule allows execution of a test to continue after the first problem is found (for example, to collect _all_ the incorrect rows in a table, and report them all at once):ExcludeCategories FilterFactory
to exclude categories.ExpectedException TheExpectedException
rule allows you to verify that your code throws a specific exception.ExternalResource A base class for Rules (like TemporaryFolder) that set up an external resource before a test (a file, socket, server, database connection, etc.), and guarantee to tear it down afterward:Failure AFailure
holds a description of the failed test and the exception that was thrown while running it.Filter The canonical case of filtering is when you want to run a single test method in a class.Filterable Runners that allow filtering should implement this interface.FilterFactory Extend this class to create a factory that createsFilter
.FilterFactory.FilterNotCreatedException Exception thrown if theFilter
cannot be created.FilterFactoryParams FixMethodOrder This class allows the user to choose the order of execution of the methods within a test class.FrameworkField Represents a field on a test class (currently used only for Rules inBlockJUnit4ClassRunner
, but custom runners can make other uses)FrameworkMember<T extends FrameworkMember<T>> Parent class forFrameworkField
andFrameworkMethod
FrameworkMethod Represents a method on a test class to be invoked at the appropriate point in test execution.FromDataPoints Annotating a parameter of a@Theory
method with@FromDataPoints
will limit the datapoints considered as potential values for that parameter to just theDataPoints
with the given name.Ignore Sometimes you want to temporarily disable a test or a group of tests.IncludeCategories FilterFactory
to include categories.InitializationError Represents one or more problems encountered while initializing a RunnerInvalidOrderingException Thrown when an ordering does something invalid (like remove or add children)InvalidTestClassError Thrown byRunner
s in case the class under test is not valid.JUnit4 Aliases the current default JUnit 4 class runner, for future-proofing.JUnit4TestAdapter The JUnit4TestAdapter enables running JUnit-4-style tests using a JUnit-3-style test runner.JUnit4TestAdapterCache JUnit4TestCaseFacade JUnitCore JUnitCore
is a facade for running tests.JUnitMatchers Convenience import class: these are useful matchers for use with the assertThat method, but they are not currently included in the basic CoreMatchers class from hamcrest.MaxCore A replacement for JUnitCore, which keeps track of runtime and failure history, and reorders tests to maximize the chances that a failing test occurs early in the test run.MaxHistory Stores a subset of the history of each test: Last failure timestamp Duration of last executionMemberValueConsumer<T> Represents a receiver for values of annotated fields/methods together with the declaring member.MethodRule A MethodRule is an alteration in how a test method is run and reported.MethodSorters Sort the methods into a specified execution order.MultipleFailureException Collects multipleThrowable
s into one exception.NoTestsRemainException Thrown when a filter removes all tests from a runner.Orderable Interface for runners that allow ordering of tests.Orderer Orders tests.Ordering Reorders tests.Ordering.Context Context about the ordering being applied.Ordering.Factory Factory for creatingOrdering
instances.OrderWith When a test class is annotated with@OrderWith
or extends a class annotated with@OrderWith
, JUnit will order the tests in the test class (and child test classes, if any) using the ordering defined by theOrdering
class.OrderWithValidator Validates that there are no errors in the use of theOrderWith
annotation.ParallelComputer Parameterized The custom runnerParameterized
implements parameterized tests.Parameterized.AfterParam Annotation forpublic static void
methods which should be executed after evaluating tests with particular parameters.Parameterized.BeforeParam Annotation forpublic static void
methods which should be executed before evaluating tests with particular parameters.Parameterized.Parameter Annotation for fields of the test class which will be initialized by the method annotated byParameters
.Parameterized.Parameters Annotation for a method which provides parameters to be injected into the test class constructor byParameterized
.Parameterized.UseParametersRunnerFactory Add this annotation to your test class if you want to generate a special runner.ParameterSignature ParametersRunnerFactory AParametersRunnerFactory
creates a runner for a singleTestWithParameters
.ParametersSuppliedBy Annotating aTheory
method parameter with @ParametersSuppliedBy causes it to be supplied with values from the namedParameterSupplier
when run as a theory by theTheories
runner.ParameterSupplier Abstract parent class for suppliers of input data points for theories.ParentRunner<T> Provides most of the functionality specific to a Runner that implements a "parent node" in the test tree, with children defined by objects of some data typeT
.PotentialAssignment PotentialAssignment.CouldNotGenerateValueException PrintableResult A test result that prints nicely in error messages.Protectable A Protectable can be run and can throw a Throwable.PublicClassValidator Validates that aTestClass
is public.RepeatedTest A Decorator that runs a test repeatedly.Request ARequest
is an abstract description of tests to be run.Result AResult
collects and summarizes information from running multiple tests.ResultMatchers Matchers on a PrintableResult, to enable JUnit self-tests.ResultPrinter Rule Annotates fields that reference rules or methods that return a rule.RuleChain TheRuleChain
can be used for creating composite rules.RunListener Register an instance of this class withRunNotifier
to be notified of events that occur during a test run.RunListener.ThreadSafe Indicates aRunListener
that can have its methods called concurrently.Runner ARunner
runs tests and notifies aRunNotifier
of significant events as it does so.RunnerBuilder A RunnerBuilder is a strategy for constructing runners for classes.RunnerScheduler Represents a strategy for scheduling when individual test methods should be run (in serial or parallel) WARNING: still experimental, may go away.RunNotifier If you write custom runners, you may need to notify JUnit of your progress running tests.RunRules Runs a collection of rules on a statement.RunWith When a class is annotated with@RunWith
or extends a class annotated with@RunWith
, JUnit will invoke the class it references to run the tests in that class instead of the runner built into JUnit.Sortable Interface for runners that allow sorting of tests.Sorter ASorter
orders tests.Statement Represents one or more actions to be taken at runtime in the course of running a JUnit test suite.StoppedByUserException Thrown when a user has requested that the test run stop.Stopwatch The Stopwatch Rule notifies one of its own protected methods of the time spent by a test.Suite UsingSuite
as a runner allows you to manually build a suite containing tests from many classes.Suite.SuiteClasses TheSuiteClasses
annotation specifies the classes to be run when a class annotated with@RunWith(Suite.class)
is run.TemporaryFolder The TemporaryFolder Rule allows creation of files and folders that should be deleted when the test method finishes (whether it passes or fails).TemporaryFolder.Builder Builds an instance ofTemporaryFolder
.Test A Test can be run and collect its results.Test TheTest
annotation tells JUnit that thepublic void
method to which it is attached can be run as a test case.Test.None Default empty exception.TestCase A test case defines the fixture to run multiple tests.TestClass Wraps a class to be run, providing method validation and annotation searchingTestClassValidator Validates a single facet of a test class.TestCouldNotBeSkippedException Indicates that a test that indicated that it should be skipped could not be skipped.TestDecorator A Decorator for Tests.TestedOn TestedOnSupplier TestFailure ATestFailure
collects a failed test together with the caught exception.TestListener A Listener for test progressTestName The TestName Rule makes the current test name available inside test methods:TestResult ATestResult
collects the results of executing a test case.TestRule A TestRule is an alteration in how a test method, or set of test methods, is run and reported.TestRunListener A listener interface for observing the execution of a test run.TestRunner A command line based tool to run tests.TestSetup A Decorator to set up and tear down additional fixture state.TestSuite ATestSuite
is aComposite
of Tests.TestTimedOutException Exception thrown when a test fails on timeout.TestWatcher TestWatcher is a base class for Rules that take note of the testing action, without modifying it.TestWatchman Deprecated. UseTestWatcher
(which implementsTestRule
) instead.TestWithParameters ATestWithParameters
keeps the data together that are needed for creating a runner for a single data set of a parameterized test.Theories The Theories runner allows to test a certain functionality against a subset of an infinite set of data points.Theories.TheoryAnchor Theory Marks test methods that should be read as theories by theTheories
runner.ThrowingRunnable This interface facilitates the use ofAssert.assertThrows(Class, ThrowingRunnable)
from Java 8.Timeout The Timeout Rule applies the same timeout to all test methods in a class:Timeout.Builder Builder forTimeout
.ValidateWith Allows for anAnnotationValidator
to be attached to an annotation.Verifier Verifier is a base class for Rules like ErrorCollector, which can turn otherwise passing test methods into failing tests if a verification check is failedVersion This class defines the current version of JUnit