Annotation Type Test
@Deprecated
@Target({ANNOTATION_TYPE,METHOD})
@Retention(RUNTIME)
@ExtendWith(ExpectedExceptionExtension.class) @ExtendWith(TimeoutExtension.class)
@Test
public @interface Test
Deprecated.
@Test is used to signal to JUnit Jupiter that the annotated method is a test method - it is
a drop-in replacement for JUnit 4's @Test.
Like JUnit 4's annotation it offers the possibility to expect exceptions and to
time out long running tests.
Also check
Jupiter's @Test
for more information regarding JUnit Jupiter integration and
Pioneer's documentation on this @Test
for more details and examples.
- Since:
- 0.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.Dummy default class for theexpectedparameter. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDeprecated.Optionally specifyexpected, a Throwable, to cause a test method to succeed if and only if an exception of the specified class is thrown by the method.longDeprecated.Optionally specifytimeoutin milliseconds to cause a test method to fail if it takes longer than that number of milliseconds.
-
Element Details
-
expected
-
timeout
long timeoutDeprecated.Optionally specifytimeoutin milliseconds to cause a test method to fail if it takes longer than that number of milliseconds.If the timeout is exceeded, the test will be abandoned (i.e. the test execution moves on to the next test) and the thread running it is interrupted.
In accordance with JUnit 4, the default value is
0, which means that while configuring 0 milliseconds is possible, it is indistinguishable from the default value and thus ignored. Negative values are rejected with an exception.- Default:
0L
-
@Testto Jupiter's. To emphasize its character as a temporary solution and to reduce risk of accidental use, it's marked as deprecated. Deprecated since v0.4; not intended to be removed.