1 /**
2 * Powerunit - A JDK1.8 test framework
3 * Copyright (C) 2014 Mathieu Boretti.
4 *
5 * This file is part of Powerunit
6 *
7 * Powerunit is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * Powerunit is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Powerunit. If not, see <http://www.gnu.org/licenses/>.
19 */
20 package ch.powerunit;
21
22 import java.lang.annotation.Documented;
23 import java.lang.annotation.ElementType;
24 import java.lang.annotation.Retention;
25 import java.lang.annotation.RetentionPolicy;
26 import java.lang.annotation.Target;
27
28 /**
29 * This annotation can be used on a non static, final field in a test class as
30 * providing access to a test framework.
31 * <p>
32 * This annotation can be use to delegate test execution to a provided test
33 * framework. For example, assuming that the exposed interface for the framework
34 * is a class <code>TestFrameworkInterface</code> (which will be required to be
35 * annotated with <code>{@link TestInterface}</code>), this framework can be
36 * used in the following ways :
37 *
38 * <pre>
39 * @TestDelegate
40 * public final TestFrameworkInterface myDelegation = new TestFrameworkInterface(...);
41 * </pre>
42 *
43 * or
44 *
45 * <pre>
46 * @TestDelegate
47 * public final Supplier<TestFrameworkInterface> myDelegation = ()->new TestFrameworkInterface(...);
48 * </pre>
49 *
50 * @author borettim
51 * @since 0.2.0
52 */
53 @Documented
54 @Retention(RetentionPolicy.RUNTIME)
55 @Target(ElementType.FIELD)
56 public @interface TestDelegate {
57
58 }