课前带信息
public abstract @interface BeforeClassWithInfo
implements Annotation
com.android.tradefed.testtype.junit4.BeforeClassWithInfo |
与BeforeClass
类似的保证,但带注释的方法必须需要TestInformation
参数。在 beforeClass 方法之前运行。
使用TestInformation#properties()
可以帮助在静态和非静态上下文之间传递信息。
例子:
@BeforeClassWithInfo public static void beforeClassWithInfo(TestInformation testInfo) {assertNotNull(device); }
也可以看看: