所有类 接口概要 类概要 枚举概要 异常错误概要 错误概要 注释类型概要 类 | 说明 |
---|
After | If you allocate external resources in a Before method you need to release them after the test runs. |
---|
AfterClass | If you allocate expensive external resources in a BeforeClass method you need to release them after all the tests in the class have run. |
---|
AllMembersSupplier | Supplies Theory parameters based on all public members of the target class. |
---|
AllOf<T> | Calculates the logical conjunction of multiple matchers. |
---|
AllTests | Runner for use with JUnit 3.8.x-style AllTests classes (those that only implement a static suite() method). |
---|
Annotatable | A model element that may have annotations. |
---|
AnnotationsValidator | An AnnotationsValidator 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. |
---|
AnyOf<T> | Calculates the logical disjunction of multiple matchers. |
---|
ArrayComparisonFailure | Thrown when two array elements differ |
---|
ArrayIterator | |
---|
Assert | A set of assertion methods useful for writing tests. |
---|
Assignments | A potentially incomplete list of value assignments for a method's formal parameters |
---|
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). |
---|
AssumptionViolatedException | An exception class used to implement assumptions (state in which a given test is meaningful and should or should not be executed). |
---|
BaseDescription | |
---|
BaseMatcher<T> | BaseClass for all Matcher implementations. |
---|
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 | |
---|
BlockJUnit4ClassRunnerWithParametersFactory | |
---|
BooleanSupplier | |
---|
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 the Category annotation. |
---|
Classes | Miscellaneous functions dealing with classes. |
---|
ClassRule | Annotates static fields that reference rules or methods that return them. |
---|
CombinableMatcher<T> | |
---|
CombinableMatcher.CombinableBothMatcher<X> | |
---|
CombinableMatcher.CombinableEitherMatcher<X> | |
---|
ComparisonCriteria | Defines criteria for finding two items "equal enough". |
---|
ComparisonFailure | |
---|
Computer | Represents a strategy for computing runners and suites. |
---|
Condition<T> | A Condition implements part of a multi-step match. |
---|
Condition.Step<I,O> | |
---|
CoreMatchers | |
---|
CouldNotReadCoreException | Thrown when Max cannot read the MaxCore serialization |
---|
CustomMatcher<T> | Utility class for writing one off matchers. |
---|
CustomTypeSafeMatcher<T> | Utility class for writing one off matchers. |
---|
DataPoint | 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 the Theories 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 the Theories runner. |
---|
Describable | Represents an object that can describe itself |
---|
DescribedAs<T> | Provides a custom description to another matcher. |
---|
Description | A description of a Matcher. |
---|
Description | A Description describes a test which is to be run or has been run. |
---|
Description.NullDescription | |
---|
DiagnosingMatcher<T> | TODO(ngd): Document. |
---|
DisableOnDebug | The DisableOnDebug 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. |
---|
EnumSupplier | |
---|
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): |
---|
Every<T> | |
---|
ExactComparisonCriteria | |
---|
ExcludeCategories | |
---|
ExpectedException | The ExpectedException 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: |
---|
Factory | Marks a Hamcrest static factory method so tools recognise them. |
---|
Failure | A Failure holds a description of the failed test and the exception that was thrown while running it. |
---|
FeatureMatcher<T,U> | Supporting class for matching a feature of an object. |
---|
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 creates Filter . |
---|
FilterFactory.FilterNotCreatedException | Exception thrown if the Filter 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 in BlockJUnit4ClassRunner , but custom runners can make other uses) |
---|
FrameworkMember<T extends FrameworkMember<T>> | |
---|
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 the DataPoints with the given name. |
---|
Ignore | Sometimes you want to temporarily disable a test or a group of tests. |
---|
IncludeCategories | |
---|
InexactComparisonCriteria | |
---|
InitializationError | Represents one or more problems encountered while initializing a Runner |
---|
Is<T> | Decorates another Matcher, retaining the behaviour but allowing tests to be slightly more expressive. |
---|
IsAnything<T> | A matcher that always returns true . |
---|
IsCollectionContaining<T> | |
---|
IsEqual<T> | |
---|
IsInstanceOf | Tests whether the value is an instance of a class. |
---|
IsNot<T> | Calculates the logical negation of a matcher. |
---|
IsNull<T> | Is the value null? |
---|
IsSame<T> | Is the value the same object as another value? |
---|
JUnit4 | Aliases the current default JUnit 4 class runner, for future-proofing. |
---|
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. |
---|
JUnitSystem | |
---|
Matcher<T> | A matcher over acceptable values. |
---|
MatcherAssert | |
---|
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 execution |
---|
MethodRule | A MethodRule is an alteration in how a test method is run and reported. |
---|
MethodSorter | |
---|
MethodSorters | Sort the methods into a specified execution order. |
---|
MultipleFailureException | Collects multiple Throwable s into one exception. |
---|
NoTestsRemainException | Thrown when a filter removes all tests from a runner. |
---|
ParallelComputer | |
---|
Parameterized | The custom runner Parameterized implements parameterized tests. |
---|
Parameterized.Parameter | Annotation for fields of the test class which will be initialized by the method annotated by Parameters . |
---|
Parameterized.Parameters | Annotation for a method which provides parameters to be injected into the test class constructor by Parameterized . |
---|
Parameterized.UseParametersRunnerFactory | Add this annotation to your test class if you want to generate a special runner. |
---|
ParameterizedAssertionError | |
---|
ParameterSignature | |
---|
ParametersRunnerFactory | |
---|
ParametersSuppliedBy | Annotating a Theory method parameter with @ParametersSuppliedBy causes it to be supplied with values from the named ParameterSupplier when run as a theory by the Theories 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 type T . |
---|
PotentialAssignment | |
---|
PotentialAssignment.CouldNotGenerateValueException | |
---|
PrintableResult | A test result that prints nicely in error messages. |
---|
PublicClassValidator | |
---|
RealSystem | |
---|
ReflectiveTypeFinder | |
---|
Request | A Request is an abstract description of tests to be run. |
---|
Result | A Result collects and summarizes information from running multiple tests. |
---|
ResultMatchers | Matchers on a PrintableResult, to enable JUnit self-tests. |
---|
Rule | Annotates fields that reference rules or methods that return a rule. |
---|
RuleChain | The RuleChain rule allows ordering of TestRules. |
---|
RunListener | Register an instance of this class with RunNotifier to be notified of events that occur during a test run. |
---|
RunListener.ThreadSafe | Indicates a RunListener that can have its methods called concurrently. |
---|
Runner | A Runner runs tests and notifies a RunNotifier 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. |
---|
SelfDescribing | The ability of an object to describe itself. |
---|
SelfDescribingValue<T> | |
---|
SelfDescribingValueIterator<T> | |
---|
Sortable | Interface for runners that allow sorting of tests. |
---|
Sorter | A Sorter orders tests. |
---|
SpecificDataPointsSupplier | |
---|
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. |
---|
StringContains | Tests if the argument is a string that contains a substring. |
---|
StringDescription | |
---|
StringEndsWith | Tests if the argument is a string that contains a substring. |
---|
StringStartsWith | Tests if the argument is a string that contains a substring. |
---|
SubstringMatcher | |
---|
Suite | Using Suite as a runner allows you to manually build a suite containing tests from many classes. |
---|
Suite.SuiteClasses | The SuiteClasses 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). |
---|
Test | The Test annotation tells JUnit that the public void method to which it is attached can be run as a test case. |
---|
Test.None | Default empty exception |
---|
TestClass | Wraps a class to be run, providing method validation and annotation searching |
---|
TestClassValidator | Validates a single facet of a test class. |
---|
TestedOn | Annotating a Theory method int parameter with @TestedOn causes it to be supplied with values from the ints array given when run as a theory by the Theories runner. |
---|
TestedOnSupplier | |
---|
TestName | The TestName Rule makes the current test name available inside test methods: |
---|
TestRule | A TestRule is an alteration in how a test method, or set of test methods, is run and reported. |
---|
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 | 已过时。 |
---|
TestWithParameters | A TestWithParameters keeps the data together that are needed for creating a runner for a single data set of a parameterized test. |
---|
TextListener | |
---|
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 the Theories runner. |
---|
Throwables | Miscellaneous functions dealing with Throwable . |
---|
Timeout | The Timeout Rule applies the same timeout to all test methods in a class: |
---|
Timeout.Builder | |
---|
TypeSafeDiagnosingMatcher<T> | Convenient base class for Matchers that require a non-null value of a specific type and that will report why the received value has been rejected. |
---|
TypeSafeMatcher<T> | Convenient base class for Matchers that require a non-null value of a specific type. |
---|
ValidateWith | |
---|
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 failed |
---|