本文整理了Java中cucumber.api.DataTable.create()
方法的一些代码示例,展示了DataTable.create()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataTable.create()
方法的具体详情如下:
包路径:cucumber.api.DataTable
类名称:DataTable
方法名:create
暂无
代码示例来源:origin: se.redmind/rmtest-cucumber-selenium
@Given("^the aliases defined in the file " + QUOTED_CONTENT + "$")
public void the_aliases_defined_in_the_file(String fileName) throws IOException {
Splitter splitter = Splitter.on("|").trimResults().omitEmptyStrings();
List<String> lines = Files.readLines(new File(fileName), Charset.defaultCharset());
List<List<String>> rows = lines.stream().map(splitter::splitToList).collect(Collectors.toList());
these_aliases(DataTable.create(rows).asMaps(String.class, String.class));
}
代码示例来源:origin: serenity-bdd/serenity-cucumber
public void match(List<Map<String, String>> expectedOutcomes) {
DataTable actualOutcomesTable = DataTable.create(actualOutcomes);
DataTable expectedOutcomesTable = DataTable.create(expectedOutcomes);
actualOutcomesTable.diff(expectedOutcomesTable);
}
代码示例来源:origin: serenity-bdd/serenity-cucumber
public void match(DataTable expectedOutcomes) {
DataTable.create(actualOutcomes).diff(expectedOutcomes);
}
}
代码示例来源:origin: alien4cloud/alien4cloud
@Given("^I have applications with names and descriptions and a topology containing a nodeTemplate \"([^\"]*)\" related to \"([^\"]*)\"$")
public void I_have_applications_with_names_and_description_containing_nodetemplate(String nodeName, String componentType,
Map<String, String> applicationRequests) throws Throwable {
CURRENT_APPLICATIONS.clear();
// Prepare a cucumber data table using the node infos.
List<String> nodeData = Lists.newArrayList(nodeName, componentType);
List<List<String>> raw = Lists.newArrayList();
raw.add(nodeData);
DataTable dataTable = DataTable.create(raw);
// Create each application and store in CURRENT_APPS
for (java.util.Map.Entry<String, String> request : applicationRequests.entrySet()) {
I_create_a_new_application_with_name_and_description_and_node_templates(request.getKey(), request.getValue(), dataTable);
CURRENT_APPLICATIONS.put(request.getKey(), CURRENT_APPLICATION);
}
assertEquals(CURRENT_APPLICATIONS.size(), applicationRequests.size());
}
代码示例来源:origin: Appendium/objectlabkit
private static <T> String convertToString(final List<T> actualRowValues, final List<String> propertiesToCompare) {
final List<List<Object>> rawRows = new ArrayList<>();
rawRows.add(propertiesToCompare.stream().collect(Collectors.toList()));
for (final T actualRow : actualRowValues) {
final BeanWrapper src = new BeanWrapperImpl(actualRow);
rawRows.add(propertiesToCompare.stream().map(p -> {
final Object propertyValue = src.getPropertyValue(p);
if (propertyValue == null) {
return "";
} else if (src.getPropertyTypeDescriptor(p).getObjectType().isAssignableFrom(BigDecimal.class)) {
return ((BigDecimal) propertyValue).stripTrailingZeros().toPlainString();
}
return propertyValue;
}).collect(Collectors.toList()));
}
return DataTable.create(rawRows).toString();
}
内容来源于网络,如有侵权,请联系作者删除!