forked from junit-team/junit-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassTemplate.java
More file actions
72 lines (67 loc) · 2.6 KB
/
ClassTemplate.java
File metadata and controls
72 lines (67 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Copyright 2015-2025 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* https://www.eclipse.org/legal/epl-v20.html
*/
package org.junit.jupiter.api;
import static org.apiguardian.api.API.Status.EXPERIMENTAL;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.apiguardian.api.API;
import org.junit.jupiter.api.extension.AfterClassTemplateInvocationCallback;
import org.junit.jupiter.api.extension.BeforeClassTemplateInvocationCallback;
import org.junit.jupiter.api.extension.ClassTemplateInvocationContext;
import org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider;
import org.junit.platform.commons.annotation.Testable;
/**
* {@code @ClassTemplate} is used to signal that the annotated class is a
* <em>class template</em>.
*
* <p>In contrast to regular test classes, a class template is not directly
* a test class but rather a template for a set of test cases. As such, it is
* designed to be invoked multiple times depending on the number of {@linkplain
* ClassTemplateInvocationContext invocation
* contexts} returned by the registered {@linkplain
* ClassTemplateInvocationContextProvider
* providers}. Must be used together with at least one provider. Otherwise,
* execution will fail.
*
* <p>Each invocation of a class template method behaves like the execution
* of a regular test class with full support for the same lifecycle callbacks
* and extensions.
*
* <p>{@code @ClassTemplate} may be combined with {@link Nested @Nested} and
* a class template may contain regular nested test classes or nested
* class templates.
*
* <p>{@code @ClassTemplate} may also be used as a meta-annotation in order
* to create a custom <em>composed annotation</em> that inherits the semantics
* of {@code @ClassTemplate}.
*
* <h2>Inheritance</h2>
*
* <p>This annotation is inherited to subclasses.
*
* @since 5.13
* @see TestTemplate
* @see ClassTemplateInvocationContext
* @see ClassTemplateInvocationContextProvider
* @see BeforeClassTemplateInvocationCallback
* @see AfterClassTemplateInvocationCallback
*/
@API(status = EXPERIMENTAL, since = "6.0")
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.ANNOTATION_TYPE, ElementType.TYPE })
@Testable
public @interface ClassTemplate {
}