本文整理汇总了Java中org.junit.runners.model.FrameworkMethod.getMethod方法的典型用法代码示例。如果您正苦于以下问题:Java FrameworkMethod.getMethod方法的具体用法?Java FrameworkMethod.getMethod怎么用?Java FrameworkMethod.getMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.runners.model.FrameworkMethod
的用法示例。
在下文中一共展示了FrameworkMethod.getMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeTestMethods
import org.junit.runners.model.FrameworkMethod; //导入方法依赖的package包/类
@Override
protected List<FrameworkMethod> computeTestMethods() {
final List<FrameworkMethod> testMethods = super.computeTestMethods();
final List<FrameworkMethod> spockitoMethods = new ArrayList<>(testMethods.size());
for (final FrameworkMethod testMethod : testMethods) {
if (testMethod.getMethod().getParameterCount() == 0) {
spockitoMethods.add(testMethod);
} else {
final Spockito.UseValueConverter useValueConverter = testMethod.getAnnotation(Spockito.UseValueConverter.class);
final ValueConverter methodValueConverter = Spockito.getValueConverter(useValueConverter, defaultValueConverter);
final UnrolledTestMethod spockitoTestMethod = new UnrolledTestMethod(testMethod.getMethod(), tableRow, methodValueConverter);
spockitoMethods.add(spockitoTestMethod);
}
}
return spockitoMethods;
}
示例2: testJSJVMBackendFrameworkMethod
import org.junit.runners.model.FrameworkMethod; //导入方法依赖的package包/类
private void testJSJVMBackendFrameworkMethod(FrameworkMethod aFrameworkMethod, RunNotifier aRunNotifier) {
Description theDescription = Description.createTestDescription(testClass.getJavaClass(), aFrameworkMethod.getName() + " JVM Target");
aRunNotifier.fireTestStarted(theDescription);
try {
// Simply invoke using reflection
Object theInstance = testClass.getJavaClass().getDeclaredConstructor().newInstance();
Method theMethod = aFrameworkMethod.getMethod();
theMethod.invoke(theInstance);
aRunNotifier.fireTestFinished(theDescription);
} catch (Exception e) {
aRunNotifier.fireTestFailure(new Failure(theDescription, e));
}
}
示例3: MethodResultAssignment
import org.junit.runners.model.FrameworkMethod; //导入方法依赖的package包/类
MethodResultAssignment(Object value, Type type, FrameworkMethod method) {
super(method.getMethod());
this.value = value;
this.type = type;
}