当前位置: 首页>>代码示例>>Java>>正文


Java DataTable.asList方法代码示例

本文整理汇总了Java中cucumber.api.DataTable.asList方法的典型用法代码示例。如果您正苦于以下问题:Java DataTable.asList方法的具体用法?Java DataTable.asList怎么用?Java DataTable.asList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cucumber.api.DataTable的用法示例。


在下文中一共展示了DataTable.asList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: add_items

import cucumber.api.DataTable; //导入方法依赖的package包/类
@When("^I add the following items$")
public void add_items(final DataTable table) throws Throwable {
    for (final String item : table.asList(String.class)) {
        input(item, "itemToAdd");
        click_button("Add");
    }
}
 
开发者ID:dajudge,项目名称:testee.fi-examples,代码行数:8,代码来源:SeleniumSteps.java

示例2: iShouldNotSeeHeaders

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^I should not see headers:$")
public void iShouldNotSeeHeaders(DataTable headersTable) throws Throwable {
    List<String> headers = headersTable.asList(String.class);
    for (String header : headers) {
        assertNull("Header should not be displayed", sitePage.findElementWithText(header));
    }
}
 
开发者ID:NHS-digital-website,项目名称:hippo,代码行数:8,代码来源:SiteSteps.java

示例3: iShouldSeeHeaders

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^I should see headers:$")
public void iShouldSeeHeaders(DataTable headersTable) throws Throwable {
    List<String> headers = headersTable.asList(String.class);
    for (String header : headers) {
        assertNotNull("Header should be displayed: " + header, sitePage.findElementWithText(header));
    }
}
 
开发者ID:NHS-digital-website,项目名称:hippo,代码行数:8,代码来源:SiteSteps.java

示例4: db

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^I have the redis list \"([^\"]*)\"(?: in the db (\\d+))? with values:$")
public void iHaveTheRedisListInTheDbWithValues(final String list, final Integer db,
                                               final DataTable dataTable) throws Throwable {
    final Jedis jedis = RedisUtil.getJedis(db);
    final List<String> table = dataTable.asList(String.class);
    jedis.lpush(list, table.toArray(new String[table.size()]));
    jedis.close();
}
 
开发者ID:tomitribe,项目名称:beryllium,代码行数:9,代码来源:RedisListSteps.java

示例5: lists

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis lists(?: in the db (\\d+))? should exists:$")
public void theRedisListsInTheDbShouldExists(final Integer db, final DataTable dataTable)
        throws Throwable {
    final Jedis jedis = RedisUtil.getJedis(db);
    for (final String key : dataTable.asList(String.class)) {
        assertThat(jedis.exists(key)).isTrue();
    }
    jedis.close();
}
 
开发者ID:tomitribe,项目名称:beryllium,代码行数:10,代码来源:RedisListSteps.java

示例6: keys

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis keys(?: in the db (\\d+))? should exists:$")
public void theRedisKeysInTheDbShouldExistsColon(final Integer db, final DataTable dataTable)
        throws Throwable {
    for (final String key : dataTable.asList(String.class)) {
        this.theRedisKeysInTheDbShouldExists(key, db);
    }
}
 
开发者ID:tomitribe,项目名称:beryllium,代码行数:8,代码来源:RedisKeyValueSteps.java

示例7: theCallToExternalServiceShouldBe

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^The call to external service should be:$")
public void theCallToExternalServiceShouldBe(final DataTable data) throws Throwable {

    final List<Call> calls = data.asList(Call.class);

    for (final Call call : calls) {
        stubHttp.match(call.getHttpMethod(), call.buildQueryParams()).then(
                status(HttpStatus.getHttpStatus(call.getStatusCode())),
                resourceContent(Thread.currentThread().getContextClassLoader()
                                      .getResource("fixtures/" + call.getFilename())));
    }
}
 
开发者ID:tomitribe,项目名称:beryllium,代码行数:13,代码来源:CallsSteps.java

示例8: db

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^I have the redis list \"([^\"]*)\"(?: in the db (\\d+))? with values:$")
public void I_have_the_redis_list_with_values(final String list, final Integer db,
    final DataTable dataTable) throws Throwable {
  final Jedis jedis = getJedis(db);
  final List<String> table = dataTable.asList(String.class);
  jedis.lpush(list, table.toArray(new String[table.size()]));
  jedis.close();
}
 
开发者ID:cchacin,项目名称:cucumber-common-steps,代码行数:9,代码来源:RedisListSteps.java

示例9: lists

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis lists(?: in the db (\\d+))? should exists:$")
public void the_redis_lists_should_exists(final Integer db, final DataTable dataTable)
    throws Throwable {
  final Jedis jedis = getJedis(db);
  for (final String key : dataTable.asList(String.class)) {
    assertThat(jedis.exists(key)).isTrue();
  }
  jedis.close();
}
 
开发者ID:cchacin,项目名称:cucumber-common-steps,代码行数:10,代码来源:RedisListSteps.java

示例10: the_call_to_external_service_should_be

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^The call to external service should be:$")
public void the_call_to_external_service_should_be(final DataTable data) throws Throwable {

  final List<Call> calls = data.asList(Call.class);

  for (final Call call : calls) {
    stubHttp.match(call.getHttpMethod(), call.buildQueryParams()).then(
        status(HttpStatus.getHttpStatus(call.getStatusCode())),
        resourceContent(Thread.currentThread().getContextClassLoader()
            .getResource("fixtures/" + call.getFilename())));
  }
}
 
开发者ID:cchacin,项目名称:cucumber-common-steps,代码行数:13,代码来源:CallsSteps.java

示例11: keys

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis keys(?: in the db (\\d+))? should exists:$")
public void the_redis_keys_should_exists(final Integer db, final DataTable dataTable)
    throws Throwable {
  for (final String key : dataTable.asList(String.class)) {
    this.the_redis_keys_should_exists(key, db);
  }
}
 
开发者ID:cchacin,项目名称:cucumber-common-steps,代码行数:8,代码来源:RedisKeyValueSteps.java

示例12: existingPortfolioImport

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^an existing portfolio for affiliate \"(.*?)\" and partyCode \"(.*?)\" and currency \"(.*?)\" like$")
public void existingPortfolioImport(final String affiliateCode, final String partyCode, final String ccy, final DataTable dataTable)
        throws Throwable {
    portfolio = new BasicPortfolio();
    portfolio.setAffiliateCode(affiliateCode);
    portfolio.setPartyCode(partyCode);
    portfolio.setPortfolioCcy(ccy);

    final List<BasicLine> details = dataTable.asList(BasicLine.class);
    final List<ExistingPortfolioLine> lines = new ArrayList<>();
    lines.addAll(details);
    portfolio.setLines(lines);
    portfolio.setPortfolioValue(lines.stream().map(t -> t.getValueInPortfolioCcy()).reduce(BigDecimal.ZERO, (a, b) -> b != null ? a.add(b) : a));
}
 
开发者ID:Appendium,项目名称:objectlabkit,代码行数:15,代码来源:BasicUcitsSteps.java

示例13: checkMessage

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the following messages should be available$")
public void checkMessage(final DataTable table) {
    final HashSet<String> expected = new HashSet<>(table.asList(String.class));
    final Set<String> actual = messageFacade.getMessages();
    assertThat(actual, is(equalTo(expected)));
}
 
开发者ID:dajudge,项目名称:testee.fi-examples,代码行数:7,代码来源:MessageSteps.java

示例14: The_consumer_should_have_received_the_following_messages

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^The consumer should have received the following messages:$")
public void The_consumer_should_have_received_the_following_messages(DataTable expected) throws Throwable {

    List<String> expectedMessages = expected.asList(String.class);

    RecordingMessageListener recorder = recorderForConsumer(theOnlyConsumerExisting());
    LinkedList<Message<String>> receivedMessages = recorder.getRecordedMessages();

    assertThat(receivedMessages.size(), is(expectedMessages.size()));
    for (String expectedMessage : expectedMessages) {

        List<Message<String>> messages = recorder.extractRecordedMessagesWithContent(expectedMessage);

        assertThat(messages.size(), is(1));
    }
}
 
开发者ID:davidmarquis,项目名称:redisq,代码行数:17,代码来源:ConsumerSteps.java

示例15: a_board_with_messages

import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^a board with messages:$")
public void a_board_with_messages(DataTable table) throws Throwable {
    board.clear();
    for (Object msg : table.asList(String.class))
        board.postMessage((String) msg);
}
 
开发者ID:sgo,项目名称:cucumber-demo,代码行数:7,代码来源:MessageBoardSteps.java


注:本文中的cucumber.api.DataTable.asList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。