gpt4 book ai didi

org.springframework.test.context.web.WebMergedContextConfiguration.hasLocations()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 09:39:05 24 4
gpt4 key购买 nike

本文整理了Java中org.springframework.test.context.web.WebMergedContextConfiguration.hasLocations()方法的一些代码示例,展示了WebMergedContextConfiguration.hasLocations()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebMergedContextConfiguration.hasLocations()方法的具体详情如下:
包路径:org.springframework.test.context.web.WebMergedContextConfiguration
类名称:WebMergedContextConfiguration
方法名:hasLocations

WebMergedContextConfiguration.hasLocations介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Ensure that the supplied {@link WebMergedContextConfiguration} does not
 * contain {@link MergedContextConfiguration#getLocations() locations}.
 * @since 4.0.4
 * @see AbstractGenericWebContextLoader#validateMergedContextConfiguration
 */
@Override
protected void validateMergedContextConfiguration(WebMergedContextConfiguration webMergedConfig) {
  if (webMergedConfig.hasLocations()) {
    String msg = String.format("Test class [%s] has been configured with @ContextConfiguration's 'locations' " +
            "(or 'value') attribute %s, but %s does not support resource locations.",
        webMergedConfig.getTestClass().getName(),
        ObjectUtils.nullSafeToString(webMergedConfig.getLocations()), getClass().getSimpleName());
    logger.error(msg);
    throw new IllegalStateException(msg);
  }
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Ensure that the supplied {@link WebMergedContextConfiguration} does not
 * contain {@link MergedContextConfiguration#getLocations() locations}.
 * @since 4.0.4
 * @see AbstractGenericWebContextLoader#validateMergedContextConfiguration
 */
@Override
protected void validateMergedContextConfiguration(WebMergedContextConfiguration webMergedConfig) {
  if (webMergedConfig.hasLocations()) {
    String msg = String.format("Test class [%s] has been configured with @ContextConfiguration's 'locations' " +
            "(or 'value') attribute %s, but %s does not support resource locations.",
        webMergedConfig.getTestClass().getName(),
        ObjectUtils.nullSafeToString(webMergedConfig.getLocations()), getClass().getSimpleName());
    logger.error(msg);
    throw new IllegalStateException(msg);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Ensure that the supplied {@link WebMergedContextConfiguration} does not
 * contain {@link MergedContextConfiguration#getLocations() locations}.
 * @since 4.0.4
 * @see AbstractGenericWebContextLoader#validateMergedContextConfiguration
 */
@Override
protected void validateMergedContextConfiguration(WebMergedContextConfiguration webMergedConfig) {
  if (webMergedConfig.hasLocations()) {
    String msg = String.format("Test class [%s] has been configured with @ContextConfiguration's 'locations' " +
            "(or 'value') attribute %s, but %s does not support resource locations.",
        webMergedConfig.getTestClass().getName(),
        ObjectUtils.nullSafeToString(webMergedConfig.getLocations()), getClass().getSimpleName());
    logger.error(msg);
    throw new IllegalStateException(msg);
  }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com