gpt4 book ai didi

com.cognifide.qa.bb.utils.YamlReader.readFromTestResources()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 18:01:31 26 4
gpt4 key购买 nike

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

YamlReader.readFromTestResources介绍

[英]Reads yaml configuration file under given path in test resources and returns structure defined in TypeReference.
[中]读取测试资源中给定路径下的yaml配置文件,并返回TypeReference中定义的结构。

代码示例

代码示例来源:origin: com.cognifide.qa.bb/bb-core

@Override
protected void configure() {
 String runmodes = System.getProperty("runmode", "default");
 String[] separateRunModes = StringUtils.split(runmodes, ",");
 List<String> modules = new ArrayList<>();
 TypeReference typeReference = new TypeReference<List<String>>() {
 };
 Arrays.stream(separateRunModes).forEach(runmode ->
   modules.addAll(YamlReader.readFromTestResources("runmodes/" + runmode, typeReference))
 );
 modules.stream().forEach(this::installFromName);
}

代码示例来源:origin: Cognifide/bobcat

@Override
protected void configure() {
 String runmodes = System.getProperty("runmode", "default");
 String[] separateRunModes = StringUtils.split(runmodes, ",");
 List<String> modules = new ArrayList<>();
 TypeReference typeReference = new TypeReference<List<String>>() {
 };
 Arrays.stream(separateRunModes).forEach(runmode ->
   modules.addAll(YamlReader.readFromTestResources("runmodes/" + runmode, typeReference))
 );
 modules.stream().forEach(this::installFromName);
}

代码示例来源:origin: com.cognifide.qa.bb/bb-aem-core

/**
 * {@inheritDoc}
 */
@Override
public ComponentConfiguration readConfiguration(ResourceFileLocation resourceFileLocation) {
 TypeReference typeReference = new TypeReference<Map<String, List<FieldConfig>>>() {
 };
 Map<String, List<FieldConfig>> configData = Collections.unmodifiableMap(
   YamlReader.readFromTestResources(resourceFileLocation.getFileName(), typeReference));
 List<TabConfig> tabsConfig = configData.entrySet().stream()
   .map(entry -> new TabConfig(entry.getKey(), entry.getValue()))
   .collect(toList());
 return new ComponentConfiguration(tabsConfig);
}

代码示例来源:origin: Cognifide/bobcat

/**
 * {@inheritDoc}
 */
@Override
public ComponentConfiguration readConfiguration(ResourceFileLocation resourceFileLocation) {
 TypeReference typeReference = new TypeReference<Map<String, List<FieldConfig>>>() {
 };
 Map<String, List<FieldConfig>> configData = Collections.unmodifiableMap(
   YamlReader.readFromTestResources(resourceFileLocation.getFileName(), typeReference));
 List<TabConfig> tabsConfig = configData.entrySet().stream()
   .map(entry -> new TabConfig(entry.getKey(), entry.getValue()))
   .collect(toList());
 return new ComponentConfiguration(tabsConfig);
}

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