Java 类org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DeviceDelegatingViewResolverAutoConfiguration.java   
@Bean
@ConditionalOnBean(GroovyMarkupViewResolver.class)
public LiteDeviceDelegatingViewResolver deviceDelegatingGroovyMarkupViewResolver(
        DeviceDelegatingViewResolverFactory factory,
        GroovyMarkupViewResolver viewResolver) {
    return factory.createViewResolver(viewResolver);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyTemplateAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(name = "groovyMarkupViewResolver")
public GroovyMarkupViewResolver groovyMarkupViewResolver() {
    GroovyMarkupViewResolver resolver = new GroovyMarkupViewResolver();
    this.properties.applyToViewResolver(resolver);
    return resolver;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DeviceDelegatingViewResolverAutoConfigurationTests.java   
@Test
public void deviceDelegatingGroovyMarkupViewResolver() throws Exception {
    load(Collections.<Class<?>>singletonList(GroovyTemplateAutoConfiguration.class),
            "spring.mobile.devicedelegatingviewresolver.enabled:true");
    assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class))
            .hasSize(2);
    assertLiteDeviceDelegatingViewResolver(
            this.context.getBean(GroovyMarkupViewResolver.class),
            "deviceDelegatingGroovyMarkupViewResolver");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyTemplateAutoConfigurationTests.java   
private MockHttpServletResponse render(String viewName, Locale locale)
        throws Exception {
    LocaleContextHolder.setLocale(locale);
    GroovyMarkupViewResolver resolver = this.context
            .getBean(GroovyMarkupViewResolver.class);
    View view = resolver.resolveViewName(viewName, locale);
    assertThat(view).isNotNull();
    HttpServletRequest request = new MockHttpServletRequest();
    request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE,
            this.context);
    MockHttpServletResponse response = new MockHttpServletResponse();
    view.render(null, request, response);
    return response;
}
项目:spring-boot-concourse    文件:GroovyTemplateAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(name = "groovyMarkupViewResolver")
public GroovyMarkupViewResolver groovyMarkupViewResolver() {
    GroovyMarkupViewResolver resolver = new GroovyMarkupViewResolver();
    this.properties.applyToViewResolver(resolver);
    return resolver;
}
项目:spring-boot-concourse    文件:GroovyTemplateAutoConfigurationTests.java   
private MockHttpServletResponse render(String viewName, Locale locale)
        throws Exception {
    LocaleContextHolder.setLocale(locale);
    GroovyMarkupViewResolver resolver = this.context
            .getBean(GroovyMarkupViewResolver.class);
    View view = resolver.resolveViewName(viewName, locale);
    assertThat(view).isNotNull();
    HttpServletRequest request = new MockHttpServletRequest();
    request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE,
            this.context);
    MockHttpServletResponse response = new MockHttpServletResponse();
    view.render(null, request, response);
    return response;
}
项目:contestparser    文件:GroovyTemplateAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(name = "groovyMarkupViewResolver")
public GroovyMarkupViewResolver groovyMarkupViewResolver() {
    GroovyMarkupViewResolver resolver = new GroovyMarkupViewResolver();
    this.properties.applyToViewResolver(resolver);
    return resolver;
}
项目:contestparser    文件:GroovyTemplateAutoConfigurationTests.java   
private MockHttpServletResponse render(String viewName, Locale locale)
        throws Exception {
    LocaleContextHolder.setLocale(locale);
    GroovyMarkupViewResolver resolver = this.context
            .getBean(GroovyMarkupViewResolver.class);
    View view = resolver.resolveViewName(viewName, locale);
    assertThat(view, notNullValue());
    HttpServletRequest request = new MockHttpServletRequest();
    request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE,
            this.context);
    MockHttpServletResponse response = new MockHttpServletResponse();
    view.render(null, request, response);
    return response;
}
项目:onetwo    文件:FixGroovyWebConfiguration.java   
@Bean
@ConditionalOnMissingBean(name = "groovyMarkupViewResolver")
public GroovyMarkupViewResolver groovyMarkupViewResolver() {
    GroovyMarkupViewResolver resolver = super.groovyMarkupViewResolver();
    resolver.setViewClass(FixGroovyMarkupView.class);
    return resolver;
}
项目:spring4-understanding    文件:ViewResolverRegistry.java   
private GroovyMarkupRegistration() {
    super(new GroovyMarkupViewResolver());
    getViewResolver().setSuffix(".tpl");
}
项目:spring4-understanding    文件:ViewResolverRegistryTests.java   
@Test
public void groovyMarkup() {
    this.registry.groovy().prefix("/").suffix(".groovy").cache(true);
    GroovyMarkupViewResolver resolver = checkAndGetResolver(GroovyMarkupViewResolver.class);
    checkPropertyValues(resolver, "prefix", "/", "suffix", ".groovy", "cacheLimit", 1024);
}
项目:spring4-understanding    文件:ViewResolverRegistryTests.java   
@Test
public void groovyMarkupDefaultValues() {
    this.registry.groovy();
    GroovyMarkupViewResolver resolver = checkAndGetResolver(GroovyMarkupViewResolver.class);
    checkPropertyValues(resolver, "prefix", "", "suffix", ".tpl");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyTemplateAutoConfigurationTests.java   
@Test
public void defaultConfiguration() {
    registerAndRefreshContext();
    assertThat(this.context.getBean(GroovyMarkupViewResolver.class)).isNotNull();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyTemplateAutoConfigurationTests.java   
@Test
public void disableCache() {
    registerAndRefreshContext("spring.groovy.template.cache:false");
    assertThat(this.context.getBean(GroovyMarkupViewResolver.class).getCacheLimit())
            .isEqualTo(0);
}
项目:spring-boot-concourse    文件:GroovyTemplateAutoConfigurationTests.java   
@Test
public void defaultConfiguration() {
    registerAndRefreshContext();
    assertThat(this.context.getBean(GroovyMarkupViewResolver.class)).isNotNull();
}
项目:spring-boot-concourse    文件:GroovyTemplateAutoConfigurationTests.java   
@Test
public void disableCache() {
    registerAndRefreshContext("spring.groovy.template.cache:false");
    assertThat(this.context.getBean(GroovyMarkupViewResolver.class).getCacheLimit())
            .isEqualTo(0);
}
项目:contestparser    文件:GroovyTemplateAutoConfigurationTests.java   
@Test
public void defaultConfiguration() {
    registerAndRefreshContext();
    assertThat(this.context.getBean(GroovyMarkupViewResolver.class), notNullValue());
}
项目:contestparser    文件:GroovyTemplateAutoConfigurationTests.java   
@Test
public void disableCache() {
    registerAndRefreshContext("spring.groovy.template.cache:false");
    assertThat(this.context.getBean(GroovyMarkupViewResolver.class).getCacheLimit(),
            equalTo(0));
}