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


Java Step.getText方法代码示例

本文整理汇总了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;
}
 
开发者ID:qas-guru,项目名称:martini-jmeter-extension,代码行数:26,代码来源:MartiniSamplerClient.java

示例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());
}
 
开发者ID:mauriciotogneri,项目名称:green-coffee,代码行数:19,代码来源:GreenCoffeeConfig.java

示例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()
    );
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:9,代码来源:Compiler.java

示例4: pickleStep

import gherkin.ast.Step; //导入方法依赖的package包/类
private PickleStep pickleStep(Step step) {
    return new PickleStep(
            step.getText(),
            createPickleArguments(step.getArgument()),
            singletonList(pickleStepLocation(step))
    );
}
 
开发者ID:mauriciotogneri,项目名称:green-coffee,代码行数:8,代码来源:Compiler.java

示例5: isTextMatch

import gherkin.ast.Step; //导入方法依赖的package包/类
protected boolean isTextMatch(Step step) {
	String text = step.getText();
	Matcher matcher = pattern.matcher(text);
	return isMatch(matcher);
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:6,代码来源:DefaultStep.java

示例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);
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:6,代码来源:UnimplementedStepException.java

示例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);
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:6,代码来源:AmbiguousStepException.java

示例8: addText

import gherkin.ast.Step; //导入方法依赖的package包/类
protected void addText(Step step) {
	String text = step.getText();
	serialized.addProperty("text", text);
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:5,代码来源:DefaultStepResultSerializer.java

示例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();
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:7,代码来源:BddParser.java


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