001/**
002 * Powerunit - A JDK1.8 test framework
003 * Copyright (C) 2014 Mathieu Boretti.
004 *
005 * This file is part of Powerunit
006 *
007 * Powerunit is free software: you can redistribute it and/or modify
008 * it under the terms of the GNU General Public License as published by
009 * the Free Software Foundation, either version 3 of the License, or
010 * (at your option) any later version.
011 *
012 * Powerunit is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015 * GNU General Public License for more details.
016 * 
017 * You should have received a copy of the GNU General Public License
018 * along with Powerunit. If not, see <http://www.gnu.org/licenses/>.
019 */
020package ch.powerunit;
021
022import java.lang.annotation.Documented;
023import java.lang.annotation.ElementType;
024import java.lang.annotation.Retention;
025import java.lang.annotation.RetentionPolicy;
026import java.lang.annotation.Target;
027
028/**
029 * This annotation can be used on a non static, final field in a test class as
030 * providing access to a test framework.
031 * <p>
032 * This annotation can be use to delegate test execution to a provided test
033 * framework. For example, assuming that the exposed interface for the framework
034 * is a class <code>TestFrameworkInterface</code> (which will be required to be
035 * annotated with <code>{@link TestInterface}</code>), this framework can be
036 * used in the following ways :
037 * 
038 * <pre>
039 * &#064;TestDelegate
040 * public final TestFrameworkInterface myDelegation = new TestFrameworkInterface(...);
041 * </pre>
042 * 
043 * or
044 * 
045 * <pre>
046 * &#064;TestDelegate
047 * public final Supplier&lt;TestFrameworkInterface&gt; myDelegation = ()-&gt;new TestFrameworkInterface(...);
048 * </pre>
049 * 
050 * @author borettim
051 * @since 0.2.0
052 */
053@Documented
054@Retention(RetentionPolicy.RUNTIME)
055@Target(ElementType.FIELD)
056public @interface TestDelegate {
057
058}