Java 类org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportEndpointTests.java   
@PostConstruct
public void setupAutoConfigurationReport() {
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(this.context.getBeanFactory());
    report.recordConditionEvaluation("a", mock(Condition.class),
            mock(ConditionOutcome.class));
    report.recordExclusions(Arrays.asList("com.foo.Bar"));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportLoggingInitializer.java   
public void logAutoConfigurationReport(boolean isCrashReport) {
    if (this.report == null) {
        if (this.applicationContext == null) {
            this.logger.info("Unable to provide auto-configuration report "
                    + "due to missing ApplicationContext");
            return;
        }
        this.report = ConditionEvaluationReport
                .get(this.applicationContext.getBeanFactory());
    }
    if (!this.report.getConditionAndOutcomesBySource().isEmpty()) {
        if (isCrashReport && this.logger.isInfoEnabled()
                && !this.logger.isDebugEnabled()) {
            this.logger.info(String.format("%n%nError starting ApplicationContext. "
                    + "To display the auto-configuration report enable "
                    + "debug logging (start with --debug)%n%n"));
        }
        if (this.logger.isDebugEnabled()) {
            this.logger.debug(new ConditionEvaluationReportMessage(this.report));
        }
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Test
public void logsOutput() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    this.initializer.initialize(context);
    context.register(Config.class);
    ConditionEvaluationReport.get(context.getBeanFactory())
            .recordExclusions(Arrays.asList("com.foo.Bar"));
    context.refresh();
    this.initializer.onApplicationEvent(new ContextRefreshedEvent(context));
    for (String message : this.debugLog) {
        System.out.println(message);
    }
    // Just basic sanity check, test is for visual inspection
    String l = this.debugLog.get(0);
    assertThat(l).contains("not a web application (OnWebApplicationCondition)");
}
项目:spring-boot-concourse    文件:AutoConfigurationReportLoggingInitializer.java   
public void logAutoConfigurationReport(boolean isCrashReport) {
    if (this.report == null) {
        if (this.applicationContext == null) {
            this.logger.info("Unable to provide auto-configuration report "
                    + "due to missing ApplicationContext");
            return;
        }
        this.report = ConditionEvaluationReport
                .get(this.applicationContext.getBeanFactory());
    }
    if (!this.report.getConditionAndOutcomesBySource().isEmpty()) {
        if (isCrashReport && this.logger.isInfoEnabled()
                && !this.logger.isDebugEnabled()) {
            this.logger.info(String.format("%n%nError starting ApplicationContext. "
                    + "To display the auto-configuration report enable "
                    + "debug logging (start with --debug)%n%n"));
        }
        if (this.logger.isDebugEnabled()) {
            this.logger.debug(new ConditionEvaluationReportMessage(this.report));
        }
    }
}
项目:spring-boot-concourse    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Test
public void logsOutput() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    this.initializer.initialize(context);
    context.register(Config.class);
    ConditionEvaluationReport.get(context.getBeanFactory())
            .recordExclusions(Arrays.asList("com.foo.Bar"));
    context.refresh();
    this.initializer.onApplicationEvent(new ContextRefreshedEvent(context));
    for (String message : this.debugLog) {
        System.out.println(message);
    }
    // Just basic sanity check, test is for visual inspection
    String l = this.debugLog.get(0);
    assertThat(l).contains("not a web application (OnWebApplicationCondition)");
}
项目:contestparser    文件:AutoConfigurationReportLoggingInitializer.java   
public void logAutoConfigurationReport(boolean isCrashReport) {
    if (this.report == null) {
        if (this.applicationContext == null) {
            this.logger.info("Unable to provide auto-configuration report "
                    + "due to missing ApplicationContext");
            return;
        }
        this.report = ConditionEvaluationReport
                .get(this.applicationContext.getBeanFactory());
    }
    if (this.report.getConditionAndOutcomesBySource().size() > 0) {
        if (isCrashReport && this.logger.isInfoEnabled()
                && !this.logger.isDebugEnabled()) {
            this.logger.info("\n\nError starting ApplicationContext. "
                    + "To display the auto-configuration report enable "
                    + "debug logging (start with --debug)\n\n");
        }
        if (this.logger.isDebugEnabled()) {
            this.logger.debug(getLogMessage(this.report));
        }
    }
}
项目:contestparser    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Test
public void logsOutput() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    this.initializer.initialize(context);
    context.register(Config.class);
    ConditionEvaluationReport.get(context.getBeanFactory())
            .recordExclusions(Arrays.asList("com.foo.Bar"));
    context.refresh();
    this.initializer.onApplicationEvent(new ContextRefreshedEvent(context));
    for (String message : this.debugLog) {
        System.out.println(message);
    }
    // Just basic sanity check, test is for visual inspection
    String l = this.debugLog.get(0);
    assertThat(l,
            containsString("not a web application (OnWebApplicationCondition)"));
}
项目:springboot-analysis    文件:TestConditionReport.java   
@Test
public void test01() {
    ConditionEvaluationReport conditionEvaluationReport = beanFactory.getBean("autoConfigurationReport", ConditionEvaluationReport.class);
    Map<String, ConditionEvaluationReport.ConditionAndOutcomes> result = conditionEvaluationReport.getConditionAndOutcomesBySource();
    for(String key : result.keySet()) {
        ConditionEvaluationReport.ConditionAndOutcomes conditionAndOutcomes = result.get(key);
        Iterator<ConditionEvaluationReport.ConditionAndOutcome> iterator = conditionAndOutcomes.iterator();
        while(iterator.hasNext()) {
            ConditionEvaluationReport.ConditionAndOutcome conditionAndOutcome = iterator.next();
            System.out.println(key + " -- " + conditionAndOutcome.getCondition().getClass().getSimpleName() + " -- " + conditionAndOutcome.getOutcome());
        }
    }
}
项目:springboot-analysis    文件:TestController.java   
@RequestMapping("/conditional")
public String conditonal() {
    StringBuilder sb = new StringBuilder();
    ConditionEvaluationReport conditionEvaluationReport = beanFactory.getBean("autoConfigurationReport", ConditionEvaluationReport.class);
    Map<String, ConditionEvaluationReport.ConditionAndOutcomes> result = conditionEvaluationReport.getConditionAndOutcomesBySource();
    for(String key : result.keySet()) {
        ConditionEvaluationReport.ConditionAndOutcomes conditionAndOutcomes = result.get(key);
        Iterator<ConditionEvaluationReport.ConditionAndOutcome> iterator = conditionAndOutcomes.iterator();
        while(iterator.hasNext()) {
            ConditionEvaluationReport.ConditionAndOutcome conditionAndOutcome = iterator.next();
            sb.append(key + " -- " + conditionAndOutcome.getCondition().getClass().getSimpleName() + " -- " + conditionAndOutcome.getOutcome() + "<br/>");
        }
    }
    return sb.toString();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigureReportTestExecutionListener.java   
@Override
public void prepareTestInstance(TestContext testContext) throws Exception {
    try {
        this.delegate.prepareTestInstance(testContext);
    }
    catch (Exception ex) {
        ApplicationContext context = testContext.getApplicationContext();
        if (context instanceof ConfigurableApplicationContext) {
            ConditionEvaluationReport report = ConditionEvaluationReport
                    .get(((ConfigurableApplicationContext) context).getBeanFactory());
            System.err.println(new ConditionEvaluationReportMessage(report));
        }
        throw ex;
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationImportedCondition.java   
@Override
public boolean matches(ApplicationContext context) {
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get((ConfigurableListableBeanFactory) context
                    .getAutowireCapableBeanFactory());
    return report.getConditionAndOutcomesBySource().keySet()
            .contains(this.autoConfigurationClass.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportEndpoint.java   
public Report(ConditionEvaluationReport report) {
    this.positiveMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
    this.negativeMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
    this.exclusions = report.getExclusions();
    for (Map.Entry<String, ConditionAndOutcomes> entry : report
            .getConditionAndOutcomesBySource().entrySet()) {
        add(entry.getValue().isFullMatch() ? this.positiveMatches
                : this.negativeMatches, entry.getKey(), entry.getValue());

    }
    if (report.getParent() != null) {
        this.parent = new Report(report.getParent());
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportLoggingInitializer.java   
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
    this.applicationContext = applicationContext;
    applicationContext.addApplicationListener(new AutoConfigurationReportListener());
    if (applicationContext instanceof GenericApplicationContext) {
        // Get the report early in case the context fails to load
        this.report = ConditionEvaluationReport
                .get(this.applicationContext.getBeanFactory());
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EnableAutoConfigurationImportSelector.java   
private void recordWithConditionEvaluationReport(List<String> configurations,
        Collection<String> exclusions) throws IOException {
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(getBeanFactory());
    report.recordEvaluationCandidates(configurations);
    report.recordExclusions(exclusions);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Test
public void canBeUsedInApplicationContext() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    context.register(Config.class);
    new AutoConfigurationReportLoggingInitializer().initialize(context);
    context.refresh();
    assertThat(context.getBean(ConditionEvaluationReport.class)).isNotNull();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Test
public void canBeUsedInNonGenericApplicationContext() throws Exception {
    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.setServletContext(new MockServletContext());
    context.register(Config.class);
    new AutoConfigurationReportLoggingInitializer().initialize(context);
    context.refresh();
    assertThat(context.getBean(ConditionEvaluationReport.class)).isNotNull();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void importsAreSelected() {
    configureExclusions(new String[0], new String[0], new String[0]);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSameSizeAs(SpringFactoriesLoader.loadFactoryNames(
            EnableAutoConfiguration.class, getClass().getClassLoader()));
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .isEmpty();
}
项目: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 classNamesExclusionsAreApplied() {
    configureExclusions(new String[0],
            new String[] { VelocityAutoConfiguration.class.getName() },
            new String[0]);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 1);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(VelocityAutoConfiguration.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    文件:AutoConfigureReportTestExecutionListener.java   
@Override
public void prepareTestInstance(TestContext testContext) throws Exception {
    try {
        this.delegate.prepareTestInstance(testContext);
    }
    catch (Exception ex) {
        ApplicationContext context = testContext.getApplicationContext();
        if (context instanceof ConfigurableApplicationContext) {
            ConditionEvaluationReport report = ConditionEvaluationReport
                    .get(((ConfigurableApplicationContext) context).getBeanFactory());
            System.err.println(new ConditionEvaluationReportMessage(report));
        }
        throw ex;
    }
}
项目:spring-boot-concourse    文件:AutoConfigurationImportedCondition.java   
@Override
public boolean matches(ApplicationContext context) {
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get((ConfigurableListableBeanFactory) context
                    .getAutowireCapableBeanFactory());
    return report.getConditionAndOutcomesBySource().keySet()
            .contains(this.autoConfigurationClass.getName());
}
项目:spring-boot-concourse    文件:AutoConfigurationReportEndpoint.java   
public Report(ConditionEvaluationReport report) {
    this.positiveMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
    this.negativeMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
    this.exclusions = report.getExclusions();
    for (Map.Entry<String, ConditionAndOutcomes> entry : report
            .getConditionAndOutcomesBySource().entrySet()) {
        add(entry.getValue().isFullMatch() ? this.positiveMatches
                : this.negativeMatches, entry.getKey(), entry.getValue());

    }
    if (report.getParent() != null) {
        this.parent = new Report(report.getParent());
    }
}
项目:spring-boot-concourse    文件:AutoConfigurationReportEndpointTests.java   
@PostConstruct
public void setupAutoConfigurationReport() {
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(this.context.getBeanFactory());
    report.recordConditionEvaluation("a", mock(Condition.class),
            mock(ConditionOutcome.class));
    report.recordExclusions(Arrays.asList("com.foo.Bar"));
}
项目:spring-boot-concourse    文件:AutoConfigurationReportLoggingInitializer.java   
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
    this.applicationContext = applicationContext;
    applicationContext.addApplicationListener(new AutoConfigurationReportListener());
    if (applicationContext instanceof GenericApplicationContext) {
        // Get the report early in case the context fails to load
        this.report = ConditionEvaluationReport
                .get(this.applicationContext.getBeanFactory());
    }
}
项目:spring-boot-concourse    文件:EnableAutoConfigurationImportSelector.java   
private void recordWithConditionEvaluationReport(List<String> configurations,
        Collection<String> exclusions) throws IOException {
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(getBeanFactory());
    report.recordEvaluationCandidates(configurations);
    report.recordExclusions(exclusions);
}
项目:spring-boot-concourse    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Test
public void canBeUsedInApplicationContext() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    context.register(Config.class);
    new AutoConfigurationReportLoggingInitializer().initialize(context);
    context.refresh();
    assertThat(context.getBean(ConditionEvaluationReport.class)).isNotNull();
}
项目:spring-boot-concourse    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Test
public void canBeUsedInNonGenericApplicationContext() throws Exception {
    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.setServletContext(new MockServletContext());
    context.register(Config.class);
    new AutoConfigurationReportLoggingInitializer().initialize(context);
    context.refresh();
    assertThat(context.getBean(ConditionEvaluationReport.class)).isNotNull();
}
项目:spring-boot-concourse    文件:EnableAutoConfigurationImportSelectorTests.java   
@Test
public void importsAreSelected() {
    configureExclusions(new String[0], new String[0], new String[0]);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSameSizeAs(SpringFactoriesLoader.loadFactoryNames(
            EnableAutoConfiguration.class, getClass().getClassLoader()));
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .isEmpty();
}
项目: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 classNamesExclusionsAreApplied() {
    configureExclusions(new String[0],
            new String[] { VelocityAutoConfiguration.class.getName() },
            new String[0]);
    String[] imports = this.importSelector.selectImports(this.annotationMetadata);
    assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 1);
    assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions())
            .contains(VelocityAutoConfiguration.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    文件:AutoConfigurationReportEndpoint.java   
public Report(ConditionEvaluationReport report) {
    this.positiveMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
    this.negativeMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
    this.exclusions = report.getExclusions();
    for (Map.Entry<String, ConditionAndOutcomes> entry : report
            .getConditionAndOutcomesBySource().entrySet()) {
        add(entry.getValue().isFullMatch() ? this.positiveMatches
                : this.negativeMatches, entry.getKey(), entry.getValue());

    }
    if (report.getParent() != null) {
        this.parent = new Report(report.getParent());
    }
}
项目:contestparser    文件:AutoConfigurationReportEndpointTests.java   
@PostConstruct
public void setupAutoConfigurationReport() {
    ConditionEvaluationReport report = ConditionEvaluationReport
            .get(this.context.getBeanFactory());
    report.recordConditionEvaluation("a", mock(Condition.class),
            mock(ConditionOutcome.class));
    report.recordExclusions(Arrays.asList("com.foo.Bar"));
}