本文整理汇总了Java中org.spockframework.runtime.extension.IMethodInterceptor类的典型用法代码示例。如果您正苦于以下问题:Java IMethodInterceptor类的具体用法?Java IMethodInterceptor怎么用?Java IMethodInterceptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMethodInterceptor类属于org.spockframework.runtime.extension包,在下文中一共展示了IMethodInterceptor类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasInterceptor
import org.spockframework.runtime.extension.IMethodInterceptor; //导入依赖的package包/类
private static Matcher<MethodInfo> hasInterceptor(final IMethodInterceptor interceptor) {
return new BaseMatcher<MethodInfo>() {
@Override
public void describeTo(Description description) {
description.appendText("has interceptor ").appendText(interceptor.toString());
}
@Override
public boolean matches(Object item) {
if (item instanceof MethodInfo) {
MethodInfo methodInfo = (MethodInfo) item;
return methodInfo.getInterceptors().contains(interceptor);
}
return false;
}
};
}
示例2: ReportableRunListener
import org.spockframework.runtime.extension.IMethodInterceptor; //导入依赖的package包/类
@Inject
public ReportableRunListener(ISpockReporter spockReporter, IMethodInterceptor fixturesInterceptor) {
checkArgument(spockReporter != null, "Spock reporter shouldn't be null");
checkArgument(fixturesInterceptor != null, "Fixture interceptor shouldn't be null");
this.spockReporter = spockReporter;
this.fixturesInterceptor = fixturesInterceptor;
}
示例3: visitSpec
import org.spockframework.runtime.extension.IMethodInterceptor; //导入依赖的package包/类
@Override
public void visitSpec(final SpecInfo spec) {
IMethodInterceptor interceptor = new InjectInterceptor(spec);
spec.addSharedInitializerInterceptor(interceptor);
spec.addInitializerInterceptor(interceptor);
super.visitSpec(spec);
}
示例4: install
import org.spockframework.runtime.extension.IMethodInterceptor; //导入依赖的package包/类
public void install(List<IMethodInterceptor> interceptors) {
if (fields.isEmpty()) return;
interceptors.add(this);
}
示例5: fixturesInterceptor
import org.spockframework.runtime.extension.IMethodInterceptor; //导入依赖的package包/类
@Provides
@Singleton
IMethodInterceptor fixturesInterceptor(ISpockReporter spockReporter) {
return new FixtureInterceptor(spockReporter);
}