Java 类org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ImportAutoConfigurationImportSelectorTests.java   
@Test
public void importsAreSelected() throws Exception {
    AnnotationMetadata annotationMetadata = new SimpleMetadataReaderFactory()
            .getMetadataReader(ImportFreemarker.class.getName())
            .getAnnotationMetadata();
    String[] imports = this.importSelector.selectImports(annotationMetadata);
    assertThat(imports).containsExactly(FreeMarkerAutoConfiguration.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ImportAutoConfigurationImportSelectorTests.java   
@Test
public void multipleImportsAreFound() throws Exception {
    AnnotationMetadata annotationMetadata = new SimpleMetadataReaderFactory()
            .getMetadataReader(MultipleImports.class.getName())
            .getAnnotationMetadata();
    String[] imports = this.importSelector.selectImports(annotationMetadata);
    assertThat(imports).containsOnly(FreeMarkerAutoConfiguration.class.getName(),
            ThymeleafAutoConfiguration.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DeviceDelegatingViewResolverAutoConfigurationTests.java   
@Test
public void deviceDelegatingFreemarkerViewResolver() throws Exception {
    load(Collections.<Class<?>>singletonList(FreeMarkerAutoConfiguration.class),
            "spring.mobile.devicedelegatingviewresolver.enabled:true");
    assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class))
            .hasSize(2);
    assertLiteDeviceDelegatingViewResolver(
            this.context.getBean(FreeMarkerViewResolver.class),
            "deviceDelegatingFreemarkerViewResolver");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DeviceDelegatingViewResolverAutoConfigurationTests.java   
@Test
public void deviceDelegatingViewResolverDisabled() throws Exception {
    load(Arrays.asList(FreeMarkerAutoConfiguration.class,
            GroovyTemplateAutoConfiguration.class, MustacheAutoConfiguration.class,
            ThymeleafAutoConfiguration.class),
            "spring.mobile.devicedelegatingviewresolver.enabled:false");
    assertThat(this.context.getBeansOfType(LiteDeviceDelegatingViewResolver.class))
            .hasSize(0);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void classExclusionsAreApplied() {
    configureExclusions(new String[] { FreeMarkerAutoConfiguration.class.getName() },
            new String[0], new String[0]);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 1);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void propertyExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0],
            new String[] { FreeMarkerAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 1);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void severalPropertyExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0],
            new String[] { FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void severalPropertyYamlExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0], new String[0]);
    this.environment.setProperty("spring.autoconfigure.exclude[0]",
            FreeMarkerAutoConfiguration.class.getName());
    this.environment.setProperty("spring.autoconfigure.exclude[1]",
            VelocityAutoConfiguration.class.getName());
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void combinedExclusionsAreApplied() {
    configureExclusions(new String[] { VelocityAutoConfiguration.class.getName() },
            new String[] { FreeMarkerAutoConfiguration.class.getName() },
            new String[] { ThymeleafAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 3);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName(),
                    ThymeleafAutoConfiguration.class.getName());
}
项目:spring-boot-concourse    文件:ImportAutoConfigurationImportSelectorTests.java   
@Test
public void importsAreSelected() throws Exception {
    AnnotationMetadata annotationMetadata = new SimpleMetadataReaderFactory()
            .getMetadataReader(ImportFreemarker.class.getName())
            .getAnnotationMetadata();
    String[] imports = this.importSelector.selectImports(annotationMetadata);
    assertThat(imports).containsExactly(FreeMarkerAutoConfiguration.class.getName());
}
项目:spring-boot-concourse    文件:ImportAutoConfigurationImportSelectorTests.java   
@Test
public void multipleImportsAreFound() throws Exception {
    AnnotationMetadata annotationMetadata = new SimpleMetadataReaderFactory()
            .getMetadataReader(MultipleImports.class.getName())
            .getAnnotationMetadata();
    String[] imports = this.importSelector.selectImports(annotationMetadata);
    assertThat(imports).containsOnly(FreeMarkerAutoConfiguration.class.getName(),
            ThymeleafAutoConfiguration.class.getName());
}
项目:spring-boot-concourse    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void classExclusionsAreApplied() {
    configureExclusions(new String[] { FreeMarkerAutoConfiguration.class.getName() },
            new String[0], new String[0]);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 1);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName());
}
项目:spring-boot-concourse    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void propertyExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0],
            new String[] { FreeMarkerAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 1);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName());
}
项目:spring-boot-concourse    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void severalPropertyExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0],
            new String[] { FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName());
}
项目:spring-boot-concourse    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void severalPropertyYamlExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0], new String[0]);
    this.environment.setProperty("spring.autoconfigure.exclude[0]",
            FreeMarkerAutoConfiguration.class.getName());
    this.environment.setProperty("spring.autoconfigure.exclude[1]",
            VelocityAutoConfiguration.class.getName());
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName());
}
项目:spring-boot-concourse    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void combinedExclusionsAreApplied() {
    configureExclusions(new String[] { VelocityAutoConfiguration.class.getName() },
            new String[] { FreeMarkerAutoConfiguration.class.getName() },
            new String[] { ThymeleafAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 3);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName(),
                    ThymeleafAutoConfiguration.class.getName());
}
项目:contestparser    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void classExclusionsAreApplied() {
    configureExclusions(new String[] { FreeMarkerAutoConfiguration.class.getName() },
            new String[0], new String[0]);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports.length,
            is(equalTo(getAutoConfigurationClassNames().size() - 1)));
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions(),
            contains(FreeMarkerAutoConfiguration.class.getName()));
}
项目:contestparser    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void propertyExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0],
            new String[] { FreeMarkerAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports.length,
            is(equalTo(getAutoConfigurationClassNames().size() - 1)));
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions(),
            contains(FreeMarkerAutoConfiguration.class.getName()));
}
项目:contestparser    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void severalPropertyExclusionsAreApplied() {
    configureExclusions(new String[0], new String[0],
            new String[] { FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName() });

    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports.length,
            is(equalTo(getAutoConfigurationClassNames().size() - 2)));
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions(),
            containsInAnyOrder(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName()));
}
项目:contestparser    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void combinedExclusionsAreApplied() {
    configureExclusions(new String[] { VelocityAutoConfiguration.class.getName() },
            new String[] { FreeMarkerAutoConfiguration.class.getName() },
            new String[] { ThymeleafAutoConfiguration.class.getName() });
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports.length,
            is(equalTo(getAutoConfigurationClassNames().size() - 3)));
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions(),
            containsInAnyOrder(FreeMarkerAutoConfiguration.class.getName(),
                    VelocityAutoConfiguration.class.getName(),
                    ThymeleafAutoConfiguration.class.getName()));
}
项目:contestparser    文件:ImportAutoConfigurationImportSelectorTests.java   
@Test
public void importsAreSelected() {
    String[] value = new String[] { FreeMarkerAutoConfiguration.class.getName() };
    configureValue(value);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports, equalTo(value));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcTestAutoConfigurationIntegrationTests.java   
@Test
public void freemarkerAutoConfigurationWasImported() {
    assertThat(this.applicationContext)
            .has(importedAutoConfiguration(FreeMarkerAutoConfiguration.class));
}
项目:spring-boot-concourse    文件:WebMvcTestAutoConfigurationIntegrationTests.java   
@Test
public void freemarkerAutoConfigurationWasImported() {
    assertThat(this.applicationContext)
            .has(importedAutoConfiguration(FreeMarkerAutoConfiguration.class));
}
项目:contestparser    文件:ImportAutoConfigurationImportSelectorTests.java   
@Test
public void propertyExclusionsAreNotApplied() {
    configureValue(new String[] { FreeMarkerAutoConfiguration.class.getName() });
    this.importSelector.selectImports(this.annotationMetadata);
    verifyZeroInteractions(this.environment);
}