本文整理汇总了Java中gherkin.ast.Step.getText方法的典型用法代码示例。如果您正苦于以下问题:Java Step.getText方法的具体用法?Java Step.getText怎么用?Java Step.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gherkin.ast.Step
的用法示例。
在下文中一共展示了Step.getText方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getArguments
import gherkin.ast.Step; //导入方法依赖的package包/类
protected Object[] getArguments(Step step, StepImplementation implementation) {
Method method = implementation.getMethod();
Parameter[] parameters = method.getParameters();
Object[] arguments = new Object[parameters.length];
if (parameters.length > 0) {
String text = step.getText();
Pattern pattern = implementation.getPattern();
Matcher matcher = pattern.matcher(text);
checkState(matcher.find(),
"unable to locate substitution parameters for pattern %s with input %s", pattern.pattern(), text);
int groupCount = matcher.groupCount();
ConversionService conversionService = SpringPreProcessor.getBean(ConversionService.class);
for (int i = 0; i < groupCount; i++) {
String parameterAsString = matcher.group(i + 1);
Parameter parameter = parameters[i];
Class<?> parameterType = parameter.getType();
Object converted = conversionService.convert(parameterAsString, parameterType);
arguments[i] = converted;
}
}
return arguments;
}
示例2: concreteStep
import gherkin.ast.Step; //导入方法依赖的package包/类
private Step concreteStep(Step abstractStep, Map<String, String> parameters)
{
String text = abstractStep.getText();
for (Entry<String, String> entry : parameters.entrySet())
{
String target = String.format("<%s>", entry.getKey());
String replacement = entry.getValue();
text = text.replace(target, replacement);
}
return new Step(
abstractStep.getLocation(),
abstractStep.getKeyword(),
text,
abstractStep.getArgument());
}
示例3: pickleStep
import gherkin.ast.Step; //导入方法依赖的package包/类
private PickleStep pickleStep(Step step, String path) {
return new PickleStep(
step.getText(),
createPickleArguments(step.getArgument(), path),
singletonList(pickleStepLocation(step, path)),
step.getKeyword().trim()
);
}
示例4: pickleStep
import gherkin.ast.Step; //导入方法依赖的package包/类
private PickleStep pickleStep(Step step) {
return new PickleStep(
step.getText(),
createPickleArguments(step.getArgument()),
singletonList(pickleStepLocation(step))
);
}
示例5: isTextMatch
import gherkin.ast.Step; //导入方法依赖的package包/类
protected boolean isTextMatch(Step step) {
String text = step.getText();
Matcher matcher = pattern.matcher(text);
return isMatch(matcher);
}
示例6: getMessage
import gherkin.ast.Step; //导入方法依赖的package包/类
protected String getMessage(Step step) {
String keyword = getKeyword(step);
String text = step.getText();
return keyword.isEmpty() ? text : String.format("%s %s", keyword, text);
}
示例7: getStepDescription
import gherkin.ast.Step; //导入方法依赖的package包/类
protected String getStepDescription(Step step) {
String keyword = getKeyword(step);
String text = step.getText();
return keyword.isEmpty() ? text : String.format("%s %s", keyword, text);
}
示例8: addText
import gherkin.ast.Step; //导入方法依赖的package包/类
protected void addText(Step step) {
String text = step.getText();
serialized.addProperty("text", text);
}
示例9: getDescription
import gherkin.ast.Step; //导入方法依赖的package包/类
private String getDescription(Step step) {
if (step.getArgument() != null && step.getArgument() instanceof DocString) {
return ((DocString) step.getArgument()).getContent();
}
return step.getKeyword() + " " + step.getText();
}