本文整理了Java中com.cognifide.qa.bb.utils.YamlReader.readFromTestResources()
方法的一些代码示例,展示了YamlReader.readFromTestResources()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlReader.readFromTestResources()
方法的具体详情如下:
包路径:com.cognifide.qa.bb.utils.YamlReader
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!