Java 类org.springframework.web.servlet.view.velocity.VelocityView 实例源码

项目:mev    文件:VelocityViewBuilder.java   
public VelocityView build () {
  VelocityView view = new VelocityView ();
  super.initialize (view);
  view.setCacheTemplate (cacheTemplate);
  if (dateToolAttribute != null)
    view.setDateToolAttribute (dateToolAttribute);
  if (encoding != null)
    view.setEncoding (encoding);
  if (numberToolAttribute != null)
    view.setNumberToolAttribute (numberToolAttribute);
  if (toolAttributes != null)
    view.setToolAttributes (toolAttributes);
  if (velocityEngine != null)
    view.setVelocityEngine (velocityEngine);
  return view;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EmbeddedVelocityViewResolver.java   
@Override
protected void initApplicationContext() {
    if (this.toolboxConfigLocation != null) {
        if (VelocityView.class.equals(getViewClass())) {
            this.logger.info("Using EmbeddedVelocityToolboxView instead of "
                    + "default VelocityView due to specified toolboxConfigLocation");
            setViewClass(EmbeddedVelocityToolboxView.class);
        }
    }
    super.initApplicationContext();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EmbeddedVelocityViewResolverTests.java   
@Test
public void standardViewWithoutToolboxConfig() throws Exception {
    ApplicationContext context = loadContext(WithoutToolboxConfig.class);
    EmbeddedVelocityViewResolver resolver = context
            .getBean(EmbeddedVelocityViewResolver.class);
    Object viewClass = ReflectionTestUtils.getField(resolver, "viewClass");
    assertThat(viewClass).isEqualTo(VelocityView.class);
}
项目:spring-boot-concourse    文件:EmbeddedVelocityViewResolver.java   
@Override
protected void initApplicationContext() {
    if (this.toolboxConfigLocation != null) {
        if (VelocityView.class.equals(getViewClass())) {
            this.logger.info("Using EmbeddedVelocityToolboxView instead of "
                    + "default VelocityView due to specified toolboxConfigLocation");
            setViewClass(EmbeddedVelocityToolboxView.class);
        }
    }
    super.initApplicationContext();
}
项目:spring-boot-concourse    文件:EmbeddedVelocityViewResolverTests.java   
@Test
public void standardViewWithoutToolboxConfig() throws Exception {
    ApplicationContext context = loadContext(WithoutToolboxConfig.class);
    EmbeddedVelocityViewResolver resolver = context
            .getBean(EmbeddedVelocityViewResolver.class);
    Object viewClass = ReflectionTestUtils.getField(resolver, "viewClass");
    assertThat(viewClass).isEqualTo(VelocityView.class);
}
项目:contestparser    文件:EmbeddedVelocityViewResolver.java   
@Override
protected void initApplicationContext() {
    if (this.toolboxConfigLocation != null) {
        if (VelocityView.class.equals(getViewClass())) {
            this.logger.info("Using EmbeddedVelocityToolboxView instead of "
                    + "default VelocityView due to specified toolboxConfigLocation");
            setViewClass(EmbeddedVelocityToolboxView.class);
        }
    }
    super.initApplicationContext();
}
项目:contestparser    文件:EmbeddedVelocityViewResolverTests.java   
@Test
public void standardViewWithoutToolboxConfig() throws Exception {
    ApplicationContext context = loadContext(WithoutToolboxConfig.class);
    EmbeddedVelocityViewResolver resolver = context
            .getBean(EmbeddedVelocityViewResolver.class);
    Object viewClass = ReflectionTestUtils.getField(resolver, "viewClass");
    assertEquals(VelocityView.class, viewClass);
}
项目:class-guard    文件:JasperReportViewResolverTests.java   
public void testSetIncorrectViewClass() {
    try {
        new JasperReportsViewResolver().setViewClass(VelocityView.class);
        fail("Should not be able to set view class to a class that does not extend AbstractJasperReportsView");
    }
    catch (IllegalArgumentException ex) {
        // success
    }
}
项目:spring4-understanding    文件:JasperReportViewResolverTests.java   
@Test(expected = IllegalArgumentException.class)
public void setIncorrectViewClass() {
    // Should not be able to set view class to a class that does not extend
    // AbstractJasperReportsView.
    new JasperReportsViewResolver().setViewClass(VelocityView.class);
}