本文整理汇总了Java中org.junit.experimental.categories.Category.value方法的典型用法代码示例。如果您正苦于以下问题:Java Category.value方法的具体用法?Java Category.value怎么用?Java Category.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.experimental.categories.Category
的用法示例。
在下文中一共展示了Category.value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withTimeout
import org.junit.experimental.categories.Category; //导入方法依赖的package包/类
public Timeout.Builder withTimeout(Class<?> clazz) {
Annotation annotation = clazz.getAnnotation(Category.class);
if (annotation != null) {
Category category = (Category)annotation;
for (Class<?> c: category.value()) {
if (c == SmallTests.class) {
// See SmallTests. Supposed to run 15 seconds.
return withTimeout(30, TimeUnit.SECONDS);
} else if (c == MediumTests.class) {
// See MediumTests. Supposed to run 50 seconds.
return withTimeout(180, TimeUnit.SECONDS);
} else if (c == LargeTests.class) {
// Let large tests have a ten minute timeout.
return withTimeout(10, TimeUnit.MINUTES);
}
}
}
return this;
}
示例2: getCategoryAnnotations
import org.junit.experimental.categories.Category; //导入方法依赖的package包/类
public static Class<?>[] getCategoryAnnotations(Class<?> c) {
Category category = c.getAnnotation(Category.class);
if (category != null) {
return category.value();
}
return new Class<?>[0];
}