@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface ContractImpl
For example
@RunWith( ContractSuite.class )
@ContractImpl( FooImpl.class ) public class Foo_Test {...}
Declares FooImpl as the implementation that the contract suite
should be built for.
The value of the annotation (FooImpl.class) in the above example) defines the class that will be scanned for interfaces. The set of contract tests are then scanned looking for tests for those interfaces. Tests from all matching Contract tests are then added to the current test class.
NOTE: In some cases only the interface is known, not the
implementation. In these cases a testing interface may be created and that
class used in the ContractImpl annotation. For example assume that you want
to test an interface A. create an interface:
interface ATester extends A{}; and in the ContractImpl
annotation use ATester.class
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.Class<?> |
value
The Implementation class that should be scanned for interfaces that have
Contract tests defined.
|
public abstract java.lang.Class<?> value
public abstract java.lang.Class<?>[] skip
public abstract java.lang.Class<?>[] ignore
Copyright © 2013-2018 XENEI.com. All Rights Reserved.