Index (JUnit API)
From Junit
|
|
|||||||||
| 上一个 下一个 | 框架 无框架 | ||||||||
A
- aClass(Class<?>) - Static method in class org.junit.runner.Request
- Create a
Requestthat, when processed, will run all the tests in a class. - addChild(Description) - Method in class org.junit.runner.Description
- Add
Descriptionas a child of the receiver. - addFirstListener(RunListener) - Method in class org.junit.runner.notification.RunNotifier
- Internal use only.
- addListener(RunListener) - Method in class org.junit.runner.JUnitCore
- Add a listener to be notified as the tests run.
- addListener(RunListener) - Method in class org.junit.runner.notification.RunNotifier
- Internal use only
- After - Annotation Type in org.junit
- If you allocate external resources in a
Beforemethod you need to release them after the test runs. - AfterClass - Annotation Type in org.junit
- If you allocate expensive external resources in a
BeforeClassmethod you need to release them after all the tests in the class have run. - ALL - Static variable in class org.junit.runner.manipulation.Filter
- A null
Filterthat passes all tests through. - AllOf<T> - Class in org.hamcrest.core
- Calculates the logical conjunction of two matchers.
- AllOf(Iterable<Matcher<? extends T>>) - Constructor for class org.hamcrest.core.AllOf
- allOf(Matcher<? extends T>...) - Static method in class org.hamcrest.core.AllOf
- Evaluates to true only if ALL of the passed in matchers evaluate to true.
- allOf(Iterable<Matcher<? extends T>>) - Static method in class org.hamcrest.core.AllOf
- Evaluates to true only if ALL of the passed in matchers evaluate to true.
- AllTests - Class in org.junit.runners
- Runner for use with JUnit 3.8.x-style AllTests classes
(those that only implement a static
suite()method). - AllTests(Class<?>) - Constructor for class org.junit.runners.AllTests
- Only called reflectively.
- any(Class<T>) - Static method in class org.hamcrest.core.IsAnything
- This matcher always evaluates to true.
- AnyOf<T> - Class in org.hamcrest.core
- Calculates the logical disjunction of two matchers.
- AnyOf(Iterable<Matcher<? extends T>>) - Constructor for class org.hamcrest.core.AnyOf
- anyOf(Matcher<? extends T>...) - Static method in class org.hamcrest.core.AnyOf
- Evaluates to true if ANY of the passed in matchers evaluate to true.
- anyOf(Iterable<Matcher<? extends T>>) - Static method in class org.hamcrest.core.AnyOf
- Evaluates to true if ANY of the passed in matchers evaluate to true.
- anything() - Static method in class org.hamcrest.core.IsAnything
- This matcher always evaluates to true.
- anything(String) - Static method in class org.hamcrest.core.IsAnything
- This matcher always evaluates to true.
- apply(Object) - Method in class org.junit.runner.manipulation.Filter
- Invoke with a
Runnerto cause all tests it intends to run to first be checked with the filter. - apply(Object) - Method in class org.junit.runner.manipulation.Sorter
- Sorts the test in
runnerusingcomparator - Assert - Class in org.junit
- A set of assertion methods useful for writing tests.
- Assert() - Constructor for class org.junit.Assert
- Protect constructor since it is a static only class
- assertArrayEquals(String, Object[], Object[]) - Static method in class org.junit.Assert
- Asserts that two object arrays are equal.
- assertArrayEquals(Object[], Object[]) - Static method in class org.junit.Assert
- Asserts that two object arrays are equal.
- assertArrayEquals(String, byte[], byte[]) - Static method in class org.junit.Assert
- Asserts that two byte arrays are equal.
- assertArrayEquals(byte[], byte[]) - Static method in class org.junit.Assert
- Asserts that two byte arrays are equal.
- assertArrayEquals(String, char[], char[]) - Static method in class org.junit.Assert
- Asserts that two char arrays are equal.
- assertArrayEquals(char[], char[]) - Static method in class org.junit.Assert
- Asserts that two char arrays are equal.
- assertArrayEquals(String, short[], short[]) - Static method in class org.junit.Assert
- Asserts that two short arrays are equal.
- assertArrayEquals(short[], short[]) - Static method in class org.junit.Assert
- Asserts that two short arrays are equal.
- assertArrayEquals(String, int[], int[]) - Static method in class org.junit.Assert
- Asserts that two int arrays are equal.
- assertArrayEquals(int[], int[]) - Static method in class org.junit.Assert
- Asserts that two int arrays are equal.
- assertArrayEquals(String, long[], long[]) - Static method in class org.junit.Assert
- Asserts that two long arrays are equal.
- assertArrayEquals(long[], long[]) - Static method in class org.junit.Assert
- Asserts that two long arrays are equal.
- assertArrayEquals(String, double[], double[], double) - Static method in class org.junit.Assert
- Asserts that two double arrays are equal.
- assertArrayEquals(double[], double[], double) - Static method in class org.junit.Assert
- Asserts that two double arrays are equal.
- assertArrayEquals(String, float[], float[], float) - Static method in class org.junit.Assert
- Asserts that two float arrays are equal.
- assertArrayEquals(float[], float[], float) - Static method in class org.junit.Assert
- Asserts that two float arrays are equal.
- assertEquals(String, Object, Object) - Static method in class org.junit.Assert
- Asserts that two objects are equal.
- assertEquals(Object, Object) - Static method in class org.junit.Assert
- Asserts that two objects are equal.
- assertEquals(String, double, double, double) - Static method in class org.junit.Assert
- Asserts that two doubles or floats are equal to within a positive delta.
- assertEquals(long, long) - Static method in class org.junit.Assert
- Asserts that two longs are equal.
- assertEquals(String, long, long) - Static method in class org.junit.Assert
- Asserts that two longs are equal.
- assertEquals(double, double) - Static method in class org.junit.Assert
- Deprecated. Use
assertEquals(double expected, double actual, double epsilon)instead - assertEquals(String, double, double) - Static method in class org.junit.Assert
- Deprecated. Use
assertEquals(String message, double expected, double actual, double epsilon)instead - assertEquals(double, double, double) - Static method in class org.junit.Assert
- Asserts that two doubles or floats are equal to within a positive delta.
- assertEquals(String, Object[], Object[]) - Static method in class org.junit.Assert
- Deprecated. use assertArrayEquals
- assertEquals(Object[], Object[]) - Static method in class org.junit.Assert
- Deprecated. use assertArrayEquals
- assertFalse(String, boolean) - Static method in class org.junit.Assert
- Asserts that a condition is false.
- assertFalse(boolean) - Static method in class org.junit.Assert
- Asserts that a condition is false.
- assertNotNull(String, Object) - Static method in class org.junit.Assert
- Asserts that an object isn't null.
- assertNotNull(Object) - Static method in class org.junit.Assert
- Asserts that an object isn't null.
- assertNotSame(String, Object, Object) - Static method in class org.junit.Assert
- Asserts that two objects do not refer to the same object.
- assertNotSame(Object, Object) - Static method in class org.junit.Assert
- Asserts that two objects do not refer to the same object.
- assertNull(String, Object) - Static method in class org.junit.Assert
- Asserts that an object is null.
- assertNull(Object) - Static method in class org.junit.Assert
- Asserts that an object is null.
- assertSame(String, Object, Object) - Static method in class org.junit.Assert
- Asserts that two objects refer to the same object.
- assertSame(Object, Object) - Static method in class org.junit.Assert
- Asserts that two objects refer to the same object.
- assertThat(T, Matcher<T>) - Static method in class org.junit.Assert
- Asserts that
actualsatisfies the condition specified bymatcher. - assertThat(String, T, Matcher<T>) - Static method in class org.junit.Assert
- Asserts that
actualsatisfies the condition specified bymatcher. - assertTrue(String, boolean) - Static method in class org.junit.Assert
- Asserts that a condition is true.
- assertTrue(boolean) - Static method in class org.junit.Assert
- Asserts that a condition is true.
- Assume - Class in org.junit
- A set of methods useful for stating assumptions about the conditions in which a test is meaningful.
- Assume() - Constructor for class org.junit.Assume
- assumeNoException(Throwable) - Static method in class org.junit.Assume
- Use to assume that an operation completes normally.
- assumeNotNull(Object...) - Static method in class org.junit.Assume
- If called with one or more null elements in
objects, the test will halt and be ignored. - assumeThat(T, Matcher<T>) - Static method in class org.junit.Assume
- Call to assume that
actualsatisfies the condition specified bymatcher. - assumeTrue(boolean) - Static method in class org.junit.Assume
- If called with an expression evaluating to
false, the test will halt and be ignored.
B
- Before - Annotation Type in org.junit
- When writing tests, it is common to find that several tests need similar objects created before they can run.
- BeforeClass - Annotation Type in org.junit
- Sometimes several tests need to share computationally expensive setup (like logging into a database).
- BlockJUnit4ClassRunner - Class in org.junit.runners
- Implements the JUnit 4 standard test case class model, as defined by the annotations in the org.junit package.
- BlockJUnit4ClassRunner(Class<?>) - Constructor for class org.junit.runners.BlockJUnit4ClassRunner
- Creates a BlockJUnit4ClassRunner to run
klass - both(Matcher<T>) - Static method in class org.junit.matchers.JUnitMatchers
- This is useful for fluently combining matchers that must both pass.
C
- childlessCopy() - Method in class org.junit.runner.Description
- childrenInvoker(RunNotifier) - Method in class org.junit.runners.ParentRunner
- Returns a
Statement: CallParentRunner.runChild(Object, RunNotifier)on each object returned byParentRunner.getChildren()(subject to any imposed filter and sort) - classBlock(RunNotifier) - Method in class org.junit.runners.ParentRunner
- Constructs a
Statementto run all of the tests in the test class. - classes(Computer, Class<?>...) - Static method in class org.junit.runner.Request
- Create a
Requestthat, when processed, will run all the tests in a set of classes. - classes(Class<?>...) - Static method in class org.junit.runner.Request
- Create a
Requestthat, when processed, will run all the tests in a set of classes with the defaultComputer. - classWithoutSuiteMethod(Class<?>) - Static method in class org.junit.runner.Request
- Create a
Requestthat, when processed, will run all the tests in a class. - collectInitializationErrors(List<Throwable>) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- collectInitializationErrors(List<Throwable>) - Method in class org.junit.runners.ParentRunner
- Adds to
errorsa throwable for each problem noted with the test class (available fromParentRunner.getTestClass()). - compare(Description, Description) - Method in class org.junit.runner.manipulation.Sorter
- ComparisonFailure - Error in org.junit
- Thrown when an
assertEquals(String, String)fails. - ComparisonFailure(String, String, String) - Constructor for error org.junit.ComparisonFailure
- Constructs a comparison failure.
- Computer - Class in org.junit.runner
- Represents a strategy for computing runners and suites.
- Computer() - Constructor for class org.junit.runner.Computer
- computeTestMethods() - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Returns the methods that run tests.
- containsString(String) - Static method in class org.junit.matchers.JUnitMatchers
- createListener() - Method in class org.junit.runner.Result
- Internal use only.
- createSuiteDescription(String, Annotation...) - Static method in class org.junit.runner.Description
- Create a
Descriptionnamedname. - createSuiteDescription(Class<?>) - Static method in class org.junit.runner.Description
- Create a
Descriptionnamed aftertestClass - createTest() - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Returns a new fixture for running a test.
- createTestDescription(Class<?>, String, Annotation...) - Static method in class org.junit.runner.Description
- Create a
Descriptionof a single test namednamein the classclazz. - createTestDescription(Class<?>, String) - Static method in class org.junit.runner.Description
- Create a
Descriptionof a single test namednamein the classclazz.
D
- Describable - Interface in org.junit.runner
- Represents an object that can describe itself
- describe() - Method in class org.junit.runner.manipulation.Filter
- Returns a textual description of this Filter
- describeChild(FrameworkMethod) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- describeChild(T) - Method in class org.junit.runners.ParentRunner
- Returns a
Descriptionforchild, which can be assumed to be an element of the list returned byParentRunner.getChildren() - describeChild(Runner) - Method in class org.junit.runners.Suite
- DescribedAs<T> - Class in org.hamcrest.core
- Provides a custom description to another matcher.
- DescribedAs(String, Matcher<T>, Object[]) - Constructor for class org.hamcrest.core.DescribedAs
- describedAs(String, Matcher<T>, Object...) - Static method in class org.hamcrest.core.DescribedAs
- Wraps an existing matcher and overrides the description when it fails.
- describeTo(Description) - Method in class org.hamcrest.core.AllOf
- describeTo(Description) - Method in class org.hamcrest.core.AnyOf
- describeTo(Description) - Method in class org.hamcrest.core.DescribedAs
- describeTo(Description) - Method in class org.hamcrest.core.Is
- describeTo(Description) - Method in class org.hamcrest.core.IsAnything
- describeTo(Description) - Method in class org.hamcrest.core.IsEqual
- describeTo(Description) - Method in class org.hamcrest.core.IsInstanceOf
- describeTo(Description) - Method in class org.hamcrest.core.IsNot
- describeTo(Description) - Method in class org.hamcrest.core.IsNull
- describeTo(Description) - Method in class org.hamcrest.core.IsSame
- 详细描述 - Class in org.junit.runner
- A
Descriptiondescribes a test which is to be run or has been run.
E
- either(Matcher<T>) - Static method in class org.junit.matchers.JUnitMatchers
- This is useful for fluently combining matchers where either may pass, for example:
- EMPTY - Static variable in class org.junit.runner.Description
- Describes a Runner which runs no tests
- emptySuite() - Static method in class org.junit.runners.Suite
- Returns an empty suite.
- equals(Object) - Method in class org.junit.runner.Description
- equalTo(T) - Static method in class org.hamcrest.core.IsEqual
- Is the value equal to another value, as tested by the
Object.equals(java.lang.Object)invokedMethod? - errorReport(Class<?>, Throwable) - Static method in class org.junit.runner.Request
- Deprecated.
- everyItem(Matcher<T>) - Static method in class org.junit.matchers.JUnitMatchers
F
- fail(String) - Static method in class org.junit.Assert
- Fails a test with the given message.
- fail() - Static method in class org.junit.Assert
- Fails a test with no message.
- Failure - Class in org.junit.runner.notification
- A
Failureholds a description of the failed test and the exception that was thrown while running it. - Failure(Description, Throwable) - Constructor for class org.junit.runner.notification.Failure
- Constructs a
Failurewith the given description and exception. - Filter - Class in org.junit.runner.manipulation
- The canonical case of filtering is when you want to run a single test method in a class.
- Filter() - Constructor for class org.junit.runner.manipulation.Filter
- filter(Filter) - Method in interface org.junit.runner.manipulation.Filterable
- Remove tests that don't pass the parameter
filter. - filter(Filter) - Method in class org.junit.runners.ParentRunner
- Filterable - Interface in org.junit.runner.manipulation
- Runners that allow filtering should implement this interface.
- filterWith(Filter) - Method in class org.junit.runner.Request
- Returns a Request that only contains those tests that should run when
filteris applied - filterWith(Description) - Method in class org.junit.runner.Request
- Returns a Request that only runs contains tests whose
DescriptionequalsdesiredDescription - fireTestAssumptionFailed(Failure) - Method in class org.junit.runner.notification.RunNotifier
- Invoke to tell listeners that an atomic test flagged that it assumed something false.
- fireTestFailure(Failure) - Method in class org.junit.runner.notification.RunNotifier
- Invoke to tell listeners that an atomic test failed.
- fireTestFinished(Description) - Method in class org.junit.runner.notification.RunNotifier
- Invoke to tell listeners that an atomic test finished.
- fireTestIgnored(Description) - Method in class org.junit.runner.notification.RunNotifier
- Invoke to tell listeners that an atomic test was ignored.
- fireTestRunFinished(Result) - Method in class org.junit.runner.notification.RunNotifier
- Do not invoke.
- fireTestRunStarted(Description) - Method in class org.junit.runner.notification.RunNotifier
- Do not invoke.
- fireTestStarted(Description) - Method in class org.junit.runner.notification.RunNotifier
- Invoke to tell listeners that an atomic test is about to start.
G
- getActual() - Method in error org.junit.ComparisonFailure
- Returns the actual string value
- getAnnotation(Class<T>) - Method in class org.junit.runner.Description
- getAnnotations() - Method in class org.junit.runner.Description
- getChildren() - Method in class org.junit.runner.Description
- getChildren() - Method in class org.junit.runners.BlockJUnit4ClassRunner
- getChildren() - Method in class org.junit.runners.Parameterized
- getChildren() - Method in class org.junit.runners.ParentRunner
- Returns a list of objects that define the children of this Runner.
- getChildren() - Method in class org.junit.runners.Suite
- getClassName() - Method in class org.junit.runner.Description
- getDescription() - Method in interface org.junit.runner.Describable
- getDescription() - Method in class org.junit.runner.notification.Failure
- getDescription() - Method in class org.junit.runner.Runner
- getDescription() - Method in class org.junit.runners.ParentRunner
- getDisplayName() - Method in class org.junit.runner.Description
- getException() - Method in class org.junit.runner.notification.Failure
- getExpected() - Method in error org.junit.ComparisonFailure
- Returns the expected string value
- getFailureCount() - Method in class org.junit.runner.Result
- getFailures() - Method in class org.junit.runner.Result
- getIgnoreCount() - Method in class org.junit.runner.Result
- getMessage() - Method in error org.junit.ComparisonFailure
- Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.
- getMessage() - Method in class org.junit.runner.notification.Failure
- Convenience method
- getMethodName() - Method in class org.junit.runner.Description
- getName() - Method in class org.junit.runners.ParentRunner
- Returns a name used to describe this Runner
- getRunCount() - Method in class org.junit.runner.Result
- getRunner(RunnerBuilder, Class<?>) - Method in class org.junit.runner.Computer
- Create a single-class runner for
testClass, usingbuilder - getRunner() - Method in class org.junit.runner.Request
- Returns a
Runnerfor this Request - getRunTime() - Method in class org.junit.runner.Result
- getSuite(RunnerBuilder, Class<?>[]) - Method in class org.junit.runner.Computer
- Create a suite for
classes, building Runners withbuilder. - getTestClass() - Method in class org.junit.runner.Description
- getTestClass() - Method in class org.junit.runners.ParentRunner
- Returns a
TestClassobject wrapping the class to be executed. - getTestHeader() - Method in class org.junit.runner.notification.Failure
- getTrace() - Method in class org.junit.runner.notification.Failure
- Convenience method
- getVersion() - Method in class org.junit.runner.JUnitCore
H
- hashCode() - Method in class org.junit.runner.Description
- hasItem(T) - Static method in class org.junit.matchers.JUnitMatchers
- hasItem(Matcher<? extends T>) - Static method in class org.junit.matchers.JUnitMatchers
- hasItems(T...) - Static method in class org.junit.matchers.JUnitMatchers
- hasItems(Matcher<? extends T>...) - Static method in class org.junit.matchers.JUnitMatchers
I
- Ignore - Annotation Type in org.junit
- Sometimes you want to temporarily disable a test or a group of tests.
- instanceOf(Class<?>) - Static method in class org.hamcrest.core.IsInstanceOf
- Is the value an instance of a particular type?
- Is<T> - Class in org.hamcrest.core
- Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive.
- Is(Matcher<T>) - Constructor for class org.hamcrest.core.Is
- is(Matcher<T>) - Static method in class org.hamcrest.core.Is
- Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive.
- is(T) - Static method in class org.hamcrest.core.Is
- This is a shortcut to the frequently used is(equalTo(x)).
- is(Class<?>) - Static method in class org.hamcrest.core.Is
- This is a shortcut to the frequently used is(instanceOf(SomeClass.class)).
- IsAnything<T> - Class in org.hamcrest.core
- A matcher that always returns
true. - IsAnything() - Constructor for class org.hamcrest.core.IsAnything
- IsAnything(String) - Constructor for class org.hamcrest.core.IsAnything
- isEmpty() - Method in class org.junit.runner.Description
- IsEqual<T> - Class in org.hamcrest.core
- Is the value equal to another value, as tested by the
Object.equals(java.lang.Object)invokedMethod? - IsEqual(T) - Constructor for class org.hamcrest.core.IsEqual
- IsInstanceOf - Class in org.hamcrest.core
- Tests whether the value is an instance of a class.
- IsInstanceOf(Class<?>) - Constructor for class org.hamcrest.core.IsInstanceOf
- Creates a new instance of IsInstanceOf
- IsNot<T> - Class in org.hamcrest.core
- Calculates the logical negation of a matcher.
- IsNot(Matcher<T>) - Constructor for class org.hamcrest.core.IsNot
- IsNull<T> - Class in org.hamcrest.core
- Is the value null?
- IsNull() - Constructor for class org.hamcrest.core.IsNull
- IsSame<T> - Class in org.hamcrest.core
- Is the value the same object as another value?
- IsSame(T) - Constructor for class org.hamcrest.core.IsSame
- isSuite() - Method in class org.junit.runner.Description
- isTest() - Method in class org.junit.runner.Description
J
- JUnit4 - Class in org.junit.runners
- Aliases the current default JUnit 4 class runner, for future-proofing.
- JUnit4(Class<?>) - Constructor for class org.junit.runners.JUnit4
- Constructs a new instance of the default runner
- JUnitCore - Class in org.junit.runner
JUnitCoreis a facade for running tests.- JUnitCore() - Constructor for class org.junit.runner.JUnitCore
- Create a new
JUnitCoreto run tests. - JUnitMatchers - Class in org.junit.matchers
- 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.
- JUnitMatchers() - Constructor for class org.junit.matchers.JUnitMatchers
M
- main(String...) - Static method in class org.junit.runner.JUnitCore
- Run the tests contained in the classes named in the
args. - matches(Object) - Method in class org.hamcrest.core.AllOf
- matches(Object) - Method in class org.hamcrest.core.AnyOf
- matches(Object) - Method in class org.hamcrest.core.DescribedAs
- matches(Object) - Method in class org.hamcrest.core.Is
- matches(Object) - Method in class org.hamcrest.core.IsAnything
- matches(Object) - Method in class org.hamcrest.core.IsEqual
- matches(Object) - Method in class org.hamcrest.core.IsInstanceOf
- matches(Object) - Method in class org.hamcrest.core.IsNot
- matches(Object) - Method in class org.hamcrest.core.IsNull
- matches(Object) - Method in class org.hamcrest.core.IsSame
- matchMethodDescription(Description) - Static method in class org.junit.runner.manipulation.Filter
- Returns a
Filterthat only runs the single method described bydesiredDescription - method(Class<?>, String) - Static method in class org.junit.runner.Request
- Create a
Requestthat, when processed, will run a single test. - methodBlock(FrameworkMethod) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Returns a Statement that, when executed, either returns normally if
methodpasses, or throws an exception ifmethodfails. - methodInvoker(FrameworkMethod, Object) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Returns a
Statementthat invokesmethodontest
N
- not(Matcher<T>) - Static method in class org.hamcrest.core.IsNot
- Inverts the rule.
- not(T) - Static method in class org.hamcrest.core.IsNot
- This is a shortcut to the frequently used not(equalTo(x)).
- NoTestsRemainException - Exception in org.junit.runner.manipulation
- Thrown when a filter removes all tests from a runner.
- NoTestsRemainException() - Constructor for exception org.junit.runner.manipulation.NoTestsRemainException
- notNullValue() - Static method in class org.hamcrest.core.IsNull
- Matches if value is not null.
- notNullValue(Class<T>) - Static method in class org.hamcrest.core.IsNull
- Matches if value is not null.
- NULL - Static variable in class org.junit.runner.manipulation.Sorter
- NULL is a
Sorterthat leaves elements in an undefined order - nullValue() - Static method in class org.hamcrest.core.IsNull
- Matches if value is null.
- nullValue(Class<T>) - Static method in class org.hamcrest.core.IsNull
- Matches if value is null.
O
- org.hamcrest.core - package org.hamcrest.core
- Fundamental matchers of objects and values, and composite matchers.
- org.junit - package org.junit
- Provides JUnit core classes and annotations.
- org.junit.matchers - package org.junit.matchers
- Provides useful additional
Matchers for use with theAssert.assertThat(Object, org.hamcrest.Matcher)statement - org.junit.runner - package org.junit.runner
- Provides classes used to describe, collect, run and analyze multiple tests.
- org.junit.runner.manipulation - package org.junit.runner.manipulation
- Provides classes to
filterorsorttests. - org.junit.runner.notification - package org.junit.runner.notification
- Provides information about a test run.
- org.junit.runners - package org.junit.runners
- Provides standard
Runnerimplementations.
P
- Parameterized - Class in org.junit.runners
-
The custom runner
Parameterizedimplements parameterized tests. - Parameterized(Class<?>) - Constructor for class org.junit.runners.Parameterized
- Only called reflectively.
- Parameterized.Parameters - Annotation Type in org.junit.runners
- Annotation for a method which provides parameters to be injected into the
test class constructor by
Parameterized - ParentRunner<T> - Class in org.junit.runners
- 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. - ParentRunner(Class<?>) - Constructor for class org.junit.runners.ParentRunner
- Constructs a new
ParentRunnerthat will run@TestClass - pleaseStop() - Method in class org.junit.runner.notification.RunNotifier
- Ask that the tests run stop before starting the next test.
- possiblyExpectingExceptions(FrameworkMethod, Object, Statement) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Deprecated. Will be private soon: use Rules instead
R
- removeListener(RunListener) - Method in class org.junit.runner.JUnitCore
- Remove a listener.
- removeListener(RunListener) - Method in class org.junit.runner.notification.RunNotifier
- Internal use only
- Request - Class in org.junit.runner
- A
Requestis an abstract description of tests to be run. - Request() - Constructor for class org.junit.runner.Request
- Result - Class in org.junit.runner
- A
Resultcollects and summarizes information from running multiple tests. - Result() - Constructor for class org.junit.runner.Result
- Rule - Annotation Type in org.junit
- Annotates fields that contain rules.
- rules(Object) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- run(Class<?>...) - Method in class org.junit.runner.JUnitCore
- Run all the tests in
classes. - run(Computer, Class<?>...) - Method in class org.junit.runner.JUnitCore
- Run all the tests in
classes. - run(Request) - Method in class org.junit.runner.JUnitCore
- Run all the tests contained in
request. - run(Test) - Method in class org.junit.runner.JUnitCore
- Run all the tests contained in JUnit 3.8.x
test. - run(Runner) - Method in class org.junit.runner.JUnitCore
- Do not use.
- run(RunNotifier) - Method in class org.junit.runner.Runner
- Run the tests for this runner.
- run(RunNotifier) - Method in class org.junit.runners.ParentRunner
- runChild(FrameworkMethod, RunNotifier) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- runChild(T, RunNotifier) - Method in class org.junit.runners.ParentRunner
- Runs the test corresponding to
child, which can be assumed to be an element of the list returned byParentRunner.getChildren(). - runChild(Runner, RunNotifier) - Method in class org.junit.runners.Suite
- runClasses(Computer, Class<?>...) - Static method in class org.junit.runner.JUnitCore
- Run the tests contained in
classes. - runClasses(Class<?>...) - Static method in class org.junit.runner.JUnitCore
- Run the tests contained in
classes. - RunListener - Class in org.junit.runner.notification
- If you need to respond to the events during a test run, extend
RunListenerand override the appropriate methods. - RunListener() - Constructor for class org.junit.runner.notification.RunListener
- runMain(JUnitSystem, String...) - Method in class org.junit.runner.JUnitCore
- Do not use.
- runMainAndExit(JUnitSystem, String...) - Static method in class org.junit.runner.JUnitCore
- Do not use.
- runner(Runner) - Static method in class org.junit.runner.Request
- Runner - Class in org.junit.runner
- A
Runnerruns tests and notifies aRunNotifierof significant events as it does so. - Runner() - Constructor for class org.junit.runner.Runner
- RunNotifier - Class in org.junit.runner.notification
- If you write custom runners, you may need to notify JUnit of your progress running tests.
- RunNotifier() - Constructor for class org.junit.runner.notification.RunNotifier
- RunWith - Annotation Type in org.junit.runner
- When a class is annotated with
@RunWithor 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.
S
- sameInstance(T) - Static method in class org.hamcrest.core.IsSame
- Creates a new instance of IsSame
- serial() - Static method in class org.junit.runner.Computer
- Returns a new default computer, which runs tests in serial order
- setScheduler(RunnerScheduler) - Method in class org.junit.runners.ParentRunner
- Sets a scheduler that determines the order and parallelization of children.
- shouldRun(Description) - Method in class org.junit.runner.manipulation.Filter
- sort(Sorter) - Method in interface org.junit.runner.manipulation.Sortable
- Sorts the tests using
sorter - sort(Sorter) - Method in class org.junit.runners.ParentRunner
- Sortable - Interface in org.junit.runner.manipulation
- Interface for runners that allow sorting of tests.
- Sorter - Class in org.junit.runner.manipulation
- A
Sorterorders tests. - Sorter(Comparator<Description>) - Constructor for class org.junit.runner.manipulation.Sorter
- Creates a
Sorterthat usescomparatorto sort tests - sortWith(Comparator<Description>) - Method in class org.junit.runner.Request
- Returns a Request whose Tests can be run in a certain order, defined by
comparatorFor example, here is code to run a test suite in alphabetical order: - StoppedByUserException - Exception in org.junit.runner.notification
- Thrown when a user has requested that the test run stop.
- StoppedByUserException() - Constructor for exception org.junit.runner.notification.StoppedByUserException
- Suite - Class in org.junit.runners
- Using
Suiteas a runner allows you to manually build a suite containing tests from many classes. - Suite(Class<?>, RunnerBuilder) - Constructor for class org.junit.runners.Suite
- Called reflectively on classes annotated with
@RunWith(Suite.class) - Suite(RunnerBuilder, Class<?>[]) - Constructor for class org.junit.runners.Suite
- Call this when there is no single root class (for example, multiple class names
passed on the command line to
JUnitCore - Suite(Class<?>, Class<?>[]) - Constructor for class org.junit.runners.Suite
- Call this when the default builder is good enough.
- Suite(RunnerBuilder, Class<?>, Class<?>[]) - Constructor for class org.junit.runners.Suite
- Called by this class and subclasses once the classes making up the suite have been determined
- Suite(Class<?>, List<Runner>) - Constructor for class org.junit.runners.Suite
- Called by this class and subclasses once the runners making up the suite have been determined
- Suite.SuiteClasses - Annotation Type in org.junit.runners
- The
SuiteClassesannotation specifies the classes to be run when a class annotated with@RunWith(Suite.class)is run.
T
- Test - Annotation Type in org.junit
- The
Testannotation tells JUnit that thepublic voidmethod to which it is attached can be run as a test case. - Test.None - Class in org.junit
- Default empty exception
- TEST_MECHANISM - Static variable in class org.junit.runner.Description
- Describes a step in the test-running mechanism that goes so wrong no other description can be used (for example, an exception thrown from a Runner's constructor
- testAssumptionFailure(Failure) - Method in class org.junit.runner.notification.RunListener
- Called when an atomic test flags that it assumes a condition that is false
- testCount() - Method in class org.junit.runner.Description
- testCount() - Method in class org.junit.runner.Runner
- testFailure(Failure) - Method in class org.junit.runner.notification.RunListener
- Called when an atomic test fails.
- testFinished(Description) - Method in class org.junit.runner.notification.RunListener
- Called when an atomic test has finished, whether the test succeeds or fails.
- testIgnored(Description) - Method in class org.junit.runner.notification.RunListener
- Called when a test will not be run, generally because a test method is annotated
with
Ignore. - testName(FrameworkMethod) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Returns the name that describes
methodforDescriptions. - testRunFinished(Result) - Method in class org.junit.runner.notification.RunListener
- Called when all tests have finished
- testRunStarted(Description) - Method in class org.junit.runner.notification.RunListener
- Called before any tests have been run.
- testStarted(Description) - Method in class org.junit.runner.notification.RunListener
- Called when an atomic test is about to be started.
- toString() - Method in class org.junit.runner.Description
- toString() - Method in class org.junit.runner.notification.Failure
V
- validateConstructor(List<Throwable>) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Adds to
errorsif the test class has more than one constructor, or if the constructor takes parameters. - validateInstanceMethods(List<Throwable>) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Deprecated. unused API, will go away in future version
- validateOnlyOneConstructor(List<Throwable>) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Adds to
errorsif the test class has more than one constructor (do not override) - validatePublicVoidNoArgMethods(Class<? extends Annotation>, boolean, List<Throwable>) - Method in class org.junit.runners.ParentRunner
- Adds to
errorsif any method in this class is annotated withannotation, but: is not public, or takes parameters, or returns something other than void, or is static (givenisStatic is false), or is not static (givenisStatic is true). - validateTestMethods(List<Throwable>) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Adds to
errorsfor each method annotated with@Testthat is not a public, void instance method with no arguments. - validateZeroArgConstructor(List<Throwable>) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Adds to
errorsif the test class's single constructor takes parameters (do not override)
W
- wasSuccessful() - Method in class org.junit.runner.Result
- withAfterClasses(Statement) - Method in class org.junit.runners.ParentRunner
- Returns a
Statement: run all non-overridden@AfterClassmethods on this class and superclasses before executingstatement; all AfterClass methods are always executed: exceptions thrown by previous steps are combined, if necessary, with exceptions from AfterClass methods into aMultipleFailureException. - withAfters(FrameworkMethod, Object, Statement) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Deprecated. Will be private soon: use Rules instead
- withBeforeClasses(Statement) - Method in class org.junit.runners.ParentRunner
- Returns a
Statement: run all non-overridden@BeforeClassmethods on this class and superclasses before executingstatement; if any throws an Exception, stop execution and pass the exception on. - withBefores(FrameworkMethod, Object, Statement) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Deprecated. Will be private soon: use Rules instead
- withPotentialTimeout(FrameworkMethod, Object, Statement) - Method in class org.junit.runners.BlockJUnit4ClassRunner
- Deprecated. Will be private soon: use Rules instead
A B C D E F G H I J M N O P R S T V W
|
|
|||||||||
| 上一个 下一个 | 框架 无框架 | ||||||||