本文整理汇总了Java中org.spockframework.runtime.model.MethodInfo类的典型用法代码示例。如果您正苦于以下问题:Java MethodInfo类的具体用法?Java MethodInfo怎么用?Java MethodInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MethodInfo类属于org.spockframework.runtime.model包,在下文中一共展示了MethodInfo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findCorrespondingFeatureMethod
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
private MethodInfo findCorrespondingFeatureMethod(String featureMethodName)
{
MethodInfo methodInfo = NOT_FOUND;
if("setup".equalsIgnoreCase(featureMethodName)) {
return currentSpec.getSetupMethod();
}
if("cleanup".equalsIgnoreCase(featureMethodName)) {
return currentSpec.getCleanupMethod();
}
for (FeatureInfo feature : currentSpec.getAllFeatures())
{
MethodInfo featureMethod = feature.getFeatureMethod();
if (featureMethodName.equals(featureMethod.getName()))
{
methodInfo = featureMethod;
break;
}
}
return methodInfo;
}
示例2: createFixtureMatchPredicate
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
private static Predicate<ReportableItemFootprint<MethodInfo>> createFixtureMatchPredicate(final MethodInfo fixture) {
return new Predicate<ReportableItemFootprint<MethodInfo>>() {
@Override
public boolean apply(@Nullable ReportableItemFootprint<MethodInfo> footprint) {
return footprint != null && fixture.equals(footprint.getItem());
}
};
}
示例3: shouldRun
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
@Override
public boolean shouldRun(Description description)
{
final MethodInfo featureMethod = findCorrespondingFeatureMethod(description.getMethodName());
if (NOT_FOUND.equals(featureMethod))
{
return false;
}
return methodName.equals(featureMethod.getReflection().getName());
}
示例4: visitFixtureAnnotation
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
@Override
public void visitFixtureAnnotation(InheritedTimeout timeout, MethodInfo fixtureMethod) {
fixtureMethod.addInterceptor(new TimeoutInterceptor(adapt(timeout)));
}
示例5: findFixtureFootprint
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
ReportableItemFootprint<MethodInfo> findFixtureFootprint(final MethodInfo fixture) {
Predicate<ReportableItemFootprint<MethodInfo>> criteria = createFixtureMatchPredicate(fixture);
return find(getFixtures(), criteria);
}
示例6: getFixtures
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
private List<ReportableItemFootprint<MethodInfo>> getFixtures() {
return newArrayList(fixtures);
}
示例7: FixtureFootprint
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
FixtureFootprint(MethodInfo item, String id) {
super(item, id);
}
示例8: findUnpublishedFixtureFootprint
import org.spockframework.runtime.model.MethodInfo; //导入依赖的package包/类
/**
* Find unpublished fixture footprint. It used to address an issue, when the node footprint can have multiple fixture
* footprint, wrapping the same {@link MethodInfo}
*
* @param fixture target method info
* @return footprint
*/
ReportableItemFootprint<MethodInfo> findUnpublishedFixtureFootprint(final MethodInfo fixture) {
Predicate<ReportableItemFootprint<MethodInfo>> criteria = and(createFixtureMatchPredicate(fixture), IS_NOT_PUBLISHED);
return find(getFixtures(), criteria);
}