当前位置: 首页>>代码示例>>Java>>正文


Java CachingParanamer类代码示例

本文整理汇总了Java中com.thoughtworks.paranamer.CachingParanamer的典型用法代码示例。如果您正苦于以下问题:Java CachingParanamer类的具体用法?Java CachingParanamer怎么用?Java CachingParanamer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CachingParanamer类属于com.thoughtworks.paranamer包,在下文中一共展示了CachingParanamer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldInvokeBeforeOrAfterStepMethodWithMetaUsingParanamer

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
@Test
public void shouldInvokeBeforeOrAfterStepMethodWithMetaUsingParanamer() throws Exception {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());
    stepCreator.useParanamer(new CachingParanamer(new BytecodeReadingParanamer()));
    Properties properties = new Properties();
    properties.put("theme", "shopping cart");

    // When
    Step stepWithMeta = stepCreator.createBeforeOrAfterStep(SomeSteps.methodFor("aMethodWithoutNamedAnnotation"),
            new Meta(properties));
    StepResult stepResult = stepWithMeta.perform(null);

    // Then
    assertThat(stepResult, instanceOf(Skipped.class));
    assertThat((String) stepsInstance.args, is("shopping cart"));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:19,代码来源:StepCreatorBehaviour.java

示例2: shouldInvokeBeforeOrAfterStepMethodWithExpectedConvertedParametersFromMeta

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
@Test
public void shouldInvokeBeforeOrAfterStepMethodWithExpectedConvertedParametersFromMeta() throws Exception {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());
    stepCreator.useParanamer(new CachingParanamer(new BytecodeReadingParanamer()));

    // When
    Date aDate = new Date();
    when(parameterConverters.convert(anyString(), eq(Date.class))).thenReturn(aDate);
    Step stepWithMeta = stepCreator.createBeforeOrAfterStep(SomeSteps.methodFor("aMethodWithDate"), new Meta());
    StepResult stepResult = stepWithMeta.perform(null);

    // Then
    assertThat(stepResult, instanceOf(Skipped.class));
    assertThat((Date) stepsInstance.args, is(aDate));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:18,代码来源:StepCreatorBehaviour.java

示例3: getContext

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
/** Get a context. */
@Override
public ValidationConfig getContext(Class<?> type) {
    final ValidationConfig config = new ValidationConfig();
    config.constraintValidatorFactory(resourceContext.getResource(InjectingConstraintValidatorFactory.class));
    CachingParanamer paranamer = new CachingParanamer(new CustomAnnotationParanamer());
    config.parameterNameProvider(new ParanamerParameterNameProvider(paranamer));
    return config;
}
 
开发者ID:yahoo,项目名称:parsec-libraries,代码行数:10,代码来源:ValidationConfigurationContextResolver.java

示例4: createErrorController

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
protected HttpHandler createErrorController(String error , Class<?> clazz , Class defaultClass){
  clazz = clazz == null ? defaultClass : clazz;
  ControllerMapping controllerMapping = new ControllerMapping( error , error);
  controllerMapping.setControllerClass( clazz );
  try {
    Method handlerError = clazz.getMethod("handleError", OvertownRequest.class);
    PathMapping methodMapping = new PathMapping( error , null , handlerError , getTemplate(handlerError) , handlerError.getAnnotation(JSONResponse.class) != null );
    Paranamer paranamer = new CachingParanamer(new BytecodeReadingParanamer());
    return new MainHttpHandler( controllerMapping , methodMapping , paranamer.lookupParameterNames( handlerError ) );
  } catch (NoSuchMethodException e) {
    e.printStackTrace();
  }
  return null;
}
 
开发者ID:EsmerilProgramming,项目名称:overtown,代码行数:15,代码来源:StartupHandlerImpl.java

示例5: JaxRsParameterNameProvider

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
/**
 * Default constructor using a custom annotation paranmer as first-priority provider.
 */
public JaxRsParameterNameProvider() {
	super(new CachingParanamer(new AdaptiveParanamer(new JaxRsAnnotationParanamer(), new DefaultParanamer(), new BytecodeReadingParanamer())));
}
 
开发者ID:ligoj,项目名称:bootstrap,代码行数:7,代码来源:JaxRsParameterNameProvider.java

示例6: ParameterNameResolverParanamerImpl

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ParameterNameResolverParanamerImpl() {
    paranamer = new CachingParanamer(new BytecodeReadingParanamer());
}
 
开发者ID:sebthom,项目名称:oval,代码行数:4,代码来源:ParameterNameResolverParanamerImpl.java

示例7: ViewParamsMerger

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ViewParamsMerger() {
    this(new CachingParanamer(new AdaptiveParanamer(
            /* new Java8Paranamer(), new AnnotationParanamer(), */new DefaultParanamer(),
            new BytecodeReadingParanamer())));
}
 
开发者ID:rwitzel,项目名称:CouchRepository,代码行数:6,代码来源:ViewParamsMerger.java

示例8: HandlerCreator

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public HandlerCreator() {
  paranamer = new CachingParanamer(new BytecodeReadingParanamer());
}
 
开发者ID:EsmerilProgramming,项目名称:overtown,代码行数:4,代码来源:HandlerCreator.java

示例9: ControllerHandlerCreator

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ControllerHandlerCreator(){
  paranamer = new CachingParanamer(new BytecodeReadingParanamer());
}
 
开发者ID:EsmerilProgramming,项目名称:overtown,代码行数:4,代码来源:ControllerHandlerCreator.java

示例10: ParanamerConfiguration

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ParanamerConfiguration() {
    useParanamer(new CachingParanamer(new BytecodeReadingParanamer()));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:4,代码来源:ParanamerConfiguration.java

示例11: shouldUseCachingParanamer

import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
@Test
public void shouldUseCachingParanamer() {
    assertThat(new ParanamerConfiguration().paranamer(), instanceOf(CachingParanamer.class));
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:5,代码来源:ParanamerConfigurationBehaviour.java


注:本文中的com.thoughtworks.paranamer.CachingParanamer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。