本文整理汇总了Java中cucumber.api.DataTable.asMaps方法的典型用法代码示例。如果您正苦于以下问题:Java DataTable.asMaps方法的具体用法?Java DataTable.asMaps怎么用?Java DataTable.asMaps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cucumber.api.DataTable
的用法示例。
在下文中一共展示了DataTable.asMaps方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: he_has_added_the_following_reporters
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^he has added the following match-reporters:$")
public void he_has_added_the_following_reporters(DataTable reporterDefTable) throws Throwable {
List<Reporter> reps = new ArrayList<>();
for (Map<String,String> repDef:reporterDefTable.asMaps(String.class, String.class)) {
Reporter rep = new Reporter();
rep.setName(repDef.get("name"));
rep.setFileName(repDef.get("fileName"));
rep.setPackageName(repDef.get("packageName"));
rep.setClassName(repDef.get("className"));
rep.setParams(repDef.get("params"));
rep.setConfig(this.config);
rep.persist();
reps.add(rep);
}
config.setReporters(reps);
}
示例2: I_expect_to_see_movie_posters
import cucumber.api.DataTable; //导入方法依赖的package包/类
@When("^I expect to see the following movie posters$")
public void I_expect_to_see_movie_posters(final DataTable dataTable) {
for (Map<String, String> row : dataTable.asMaps(String.class, String.class)) {
int position = Integer.valueOf(row.get("position"));
String posterPath = row.get("posterPath");
popularMoviesRobot.checkPosterWithPathIsDisplayedAtPosition(position, posterPath);
}
}
示例3: setJmsSubscribeData
import cucumber.api.DataTable; //导入方法依赖的package包/类
@And("^sets jms subscribe inputs source data$")
public void setJmsSubscribeData(DataTable sourceMappingData) {
for (Map<String, String> source : sourceMappingData.asMaps(String.class, String.class)) {
for (String field : source.keySet()) {
SelenideElement element = editPage.getJmsSubscribeComponent().checkAndGetFieldType(field);
assertThat(element, notNullValue());
editPage.getJmsSubscribeComponent().setElementValue(source.get(field), element);
}
}
}
示例4: verifyListRowData
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^(?:I should see |)the (first|last) (?:row|item) of the \"(.*)\" (?:list|table) contains the following data:$")
public void verifyListRowData(String firstLast, String list, DataTable data) throws Throwable {
int index = 0;
TableView control = (TableView) verifyElementExists(list);
if (firstLast.equals("last")) {
index = control.getItemsCount() - 1;
}
List<Map<String, String>> content = data.asMaps(String.class,
String.class);
for (Map<String, String> row : content) {
for (Entry<String, String> entry : row.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
Assert.assertEquals(String.format("The %s row element '%s' has unexpected value", firstLast, key),
value, control.getSubItem(key, index).getText());
}
}
}
示例5: he_has_added_two_matchers
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^he has added two matchers:$")
public void he_has_added_two_matchers(DataTable matcherDefTable) throws Throwable {
for (Map<String,String> matcherDef:matcherDefTable.asMaps(String.class, String.class)) {
Matcher matcher = new Matcher();
matcher.setName(matcherDef.get("name"));
matcher.setPackageName(matcherDef.get("packageName"));
matcher.setClassName(matcherDef.get("className"));
matcher.setParams(matcherDef.get("params"));
matcher.setConfiguration(config);
matcher.persist();
matchers.put(matcher.getName(), matcher);
config.getMatchers().add(matcher);
config.setVersion(config.getVersion() + 1);
assert (Matcher.findMatcher(matcher.getId()) != null);
}
}
示例6: he_has_added_a_matcher_for_the_second_column
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^he has added a matcher for the second column:$")
public void he_has_added_a_matcher_for_the_second_column(DataTable matcherDefTable) throws Throwable {
List<Map<String,String>> matcherDef = matcherDefTable.asMaps(String.class, String.class);
matcher = new Matcher();
matcher.setName(matcherDef.get(0).get("name"));
matcher.setPackageName(matcherDef.get(0).get("packageName"));
matcher.setClassName(matcherDef.get(0).get("className"));
matcher.setParams(matcherDef.get(0).get("params"));
matcher.setConfiguration(config);
matcher.persist();
List<Matcher> matchers = new ArrayList<>();
matchers.add(matcher);
config.getMatchers().add(matcher);
config.setVersion(config.getVersion() + 1);
assert (Matcher.findMatcher(this.matcher.getId()) != null);
}
示例7: he_has_added_the_following_reporters
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^he has added the following reporters:$")
public void he_has_added_the_following_reporters(DataTable reporterDefTable) throws Throwable {
List<Reporter> reps = new ArrayList<>();
for (Map<String,String> repDef:reporterDefTable.asMaps(String.class, String.class)) {
Reporter rep = new Reporter();
rep.setName(repDef.get("name"));
rep.setFileName(repDef.get("fileName"));
rep.setPackageName(repDef.get("packageName"));
rep.setClassName(repDef.get("className"));
rep.setParams(repDef.get("params"));
rep.setConfig(this.config);
rep.persist();
reps.add(rep);
}
config.setReporters(reps);
}
示例8: setJmsRequestData
import cucumber.api.DataTable; //导入方法依赖的package包/类
@And("^sets jms request inputs source data$")
public void setJmsRequestData(DataTable sourceMappingData) {
for (Map<String, String> source : sourceMappingData.asMaps(String.class, String.class)) {
for (String field : source.keySet()) {
SelenideElement element = editPage.getJmsSubscribeComponent().checkAndGetFieldType(field);
assertThat(element, notNullValue());
editPage.getJmsSubscribeComponent().setElementValue(source.get(field), element);
}
}
}
示例9: setJmsPublishData
import cucumber.api.DataTable; //导入方法依赖的package包/类
@And("^sets jms publish inputs source data$")
public void setJmsPublishData(DataTable sourceMappingData) {
for (Map<String, String> source : sourceMappingData.asMaps(String.class, String.class)) {
for (String field : source.keySet()) {
SelenideElement element = editPage.getJmsPublishComponent().checkAndGetFieldType(field);
assertThat(element, notNullValue());
editPage.getJmsPublishComponent().setElementValue(source.get(field), element);
}
}
}
示例10: replace
import cucumber.api.DataTable; //导入方法依赖的package包/类
@When("^replace (\\w+)$")
public void replace(String name, DataTable table) {
name = name.trim();
String text = getVarAsString(name);
List<Map<String, String>> list = table.asMaps(String.class, String.class);
String replaced = Script.replacePlaceholders(text, list, context);
context.vars.put(name, replaced);
}
示例11: populatePageWithData
import cucumber.api.DataTable; //导入方法依赖的package包/类
@When("^(?:I |)populate current page with the following data:$")
public void populatePageWithData(DataTable data) throws Throwable {
List<Map<String, String>> content = data.asMaps(String.class,
String.class);
for (Map<String, String> row : content) {
enterValue(row.get("Value"), row.get("Field"));
}
}
示例12: pageContainsData
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^(?:I should see |)the page contains the following data:$")
public void pageContainsData(DataTable data) throws Throwable {
List<Map<String, String>> content = data.asMaps(String.class,
String.class);
for (Map<String, String> row : content) {
verifyFieldText(row.get("Field"), row.get("Value"));
}
}
示例13: extractPostersFromDataTable
import cucumber.api.DataTable; //导入方法依赖的package包/类
private void extractPostersFromDataTable(DataTable dataTable) {
ConfigurableBackend configurableBackend = getConfigurableBackend();
for (final Map<String, String> row : dataTable.asMaps(String.class, String.class)) {
Long movieId = Long.valueOf(row.get("movieId"));
String posterPath = row.get("posterPath");
configurableBackend.addToPopularStream(createApiMoviePoster(movieId, posterPath));
}
}
示例14: extractMovieDetailsFromDataTable
import cucumber.api.DataTable; //导入方法依赖的package包/类
private void extractMovieDetailsFromDataTable(DataTable dataTable) {
ConfigurableBackend configurableBackend = getConfigurableBackend();
for (final Map<String, String> row : dataTable.asMaps(String.class, String.class)) {
Long movieId = Long.valueOf(row.get("movieId"));
String posterPath = row.get("posterPath");
String title = row.get("title");
String description = row.get("description");
String releaseDate = row.get("releaseDate");
configurableBackend.addMovieDetails(createMovieDetails(movieId, title, description, posterPath, releaseDate));
}
}
示例15: catalogMovies
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("the catalog has the following movies:")
public void catalogMovies(DataTable movieData) {
List<Map<String,String>> movieRows = movieData.asMaps(String.class, String.class);
List<Movie> movies = movieRows.stream()
.map(SearchSteps::convertStringDataToMovie)
.collect(Collectors.toList());
theMovieCatalog.hasTheFollowingMovies(movies);
}