• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Location类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中gherkin.ast.Location的典型用法代码示例。如果您正苦于以下问题:Java Location类的具体用法?Java Location怎么用?Java Location使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: getRangeMap

import gherkin.ast.Location; //导入依赖的package包/类
protected RangeMap<Integer, ScenarioDefinition> getRangeMap(FeatureWrapper feature) {
	List<ScenarioDefinition> children = Lists.newArrayList(feature.getChildren());

	ImmutableRangeMap.Builder<Integer, ScenarioDefinition> builder = ImmutableRangeMap.builder();
	while (!children.isEmpty()) {
		ScenarioDefinition child = children.remove(0);
		Location location = child.getLocation();
		Integer childStart = location.getLine();

		ScenarioDefinition sibling = children.isEmpty() ? null : children.get(0);
		Location siblingLocation = null == sibling ? null : sibling.getLocation();
		Integer siblingStart = null == siblingLocation ? null : siblingLocation.getLine();

		Range<Integer> range = null == siblingStart ? Range.atLeast(childStart) : Range.closedOpen(childStart, siblingStart);
		builder.put(range, child);
	}
	return builder.build();
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:19,代码来源:DefaultMixology.java


示例2: convertGherkinStepsToCucableStepsTest

import gherkin.ast.Location; //导入依赖的package包/类
@Test
public void convertGherkinStepsToCucableStepsTest() {
    List<Step> gherkinSteps = Arrays.asList(
            new Step(new Location(1, 1),
                    "Given ", "this is a test step", null),
            new Step(new Location(2, 1),
                    "Then ", "I get a test result", null)
    );

    List<com.trivago.rta.vo.Step> steps = gherkinToCucableConverter.convertGherkinStepsToCucableSteps(gherkinSteps);
    assertThat(steps.size(), is(gherkinSteps.size()));
    com.trivago.rta.vo.Step firstStep = steps.get(0);
    assertThat(firstStep.getName(), is("Given this is a test step"));
    com.trivago.rta.vo.Step secondStep = steps.get(1);
    assertThat(secondStep.getName(), is("Then I get a test result"));
}
 
开发者ID:trivago,项目名称:cucable-plugin,代码行数:17,代码来源:GherkinToCucableConverterTest.java


示例3: setTokenMatched

import gherkin.ast.Location; //导入依赖的package包/类
protected void setTokenMatched(Token token, TokenType matchedType, String text, String keyword, Integer indent, List<GherkinLineSpan> items) {
    token.matchedType = matchedType;
    token.matchedKeyword = keyword;
    token.matchedText = text;
    token.mathcedItems = items;
    token.matchedGherkinDialect = getCurrentDialect();
    token.matchedIndent = indent != null ? indent : (token.line == null ? 0 : token.line.indent());
    token.location = new Location(token.location.getLine(), token.matchedIndent + 1);
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:10,代码来源:TokenMatcher.java


示例4: getDialect

import gherkin.ast.Location; //导入依赖的package包/类
@Override
public GherkinDialect getDialect(String language, Location location) {
    Map map = (Map)dialects.get(language);
    if (map == null) {
        throw new ParserException.NoSuchLanguageException(language, location);
    }

    return new GherkinDialect(language, map);
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:10,代码来源:GherkinDialectProvider.java


示例5: read

import gherkin.ast.Location; //导入依赖的package包/类
@Override
public Token read() {
    try {
        String line = reader.readLine();
        Location location = new Location(++lineNumber, 0);
        return line == null ? new Token(null, location) : new Token(new GherkinLine(line), location);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:11,代码来源:TokenScanner.java


示例6: getDialect

import gherkin.ast.Location; //导入依赖的package包/类
@Override
public GherkinDialect getDialect(String language, Location location) {
    Map<String, List<String>> map = DIALECTS.get(language);
    if (map == null) {
        throw new ParserException.NoSuchLanguageException(language, location);
    }

    return new GherkinDialect(language, map);
}
 
开发者ID:mauriciotogneri,项目名称:green-coffee,代码行数:10,代码来源:GherkinDialectProvider.java


示例7: addLocation

import gherkin.ast.Location; //导入依赖的package包/类
protected void addLocation(Step step) {
	Location location = step.getLocation();
	int line = location.getLine();
	serialized.addProperty("line", line);
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:6,代码来源:DefaultStepResultSerializer.java


示例8: ParserException

import gherkin.ast.Location; //导入依赖的package包/类
protected ParserException(String message, Location location) {
    super(getMessage(message, location));
    this.location = location;
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:5,代码来源:ParserException.java


示例9: getMessage

import gherkin.ast.Location; //导入依赖的package包/类
private static String getMessage(String message, Location location) {
    return String.format("(%s:%s): %s", location.getLine(), location.getColumn(), message);
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:4,代码来源:ParserException.java


示例10: AstBuilderException

import gherkin.ast.Location; //导入依赖的package包/类
public AstBuilderException(String message, Location location) {
    super(message, location);
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:4,代码来源:ParserException.java


示例11: NoSuchLanguageException

import gherkin.ast.Location; //导入依赖的package包/类
public NoSuchLanguageException(String language, Location location) {
    super("Language not supported: " + language, location);
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:4,代码来源:ParserException.java


示例12: getLocation

import gherkin.ast.Location; //导入依赖的package包/类
private static Location getLocation(Token receivedToken) {
    return receivedToken.location.getColumn() > 1 
        ? receivedToken.location
        : new Location(receivedToken.location.getLine(), receivedToken.line.indent() + 1);
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:6,代码来源:ParserException.java


示例13: pickleLocation

import gherkin.ast.Location; //导入依赖的package包/类
private PickleLocation pickleLocation(Location location, String path) {
    return new PickleLocation(path, location.getLine(), location.getColumn());
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:4,代码来源:Compiler.java


示例14: getLocation

import gherkin.ast.Location; //导入依赖的package包/类
private Location getLocation(Token token, int column) {
    return column == 0 ? token.location : new Location(token.location.getLine(), column);
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:4,代码来源:AstBuilder.java


示例15: Token

import gherkin.ast.Location; //导入依赖的package包/类
public Token(IGherkinLine line, Location location) {
    this.line = line;
    this.location = location;
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:5,代码来源:Token.java


示例16: getLocation

import gherkin.ast.Location; //导入依赖的package包/类
private static Location getLocation(Token receivedToken) {
    return receivedToken.location.getColumn() > 1
            ? receivedToken.location
            : new Location(receivedToken.location.getLine(), receivedToken.line.indent() + 1);
}
 
开发者ID:mauriciotogneri,项目名称:green-coffee,代码行数:6,代码来源:ParserException.java


示例17: pickleLocation

import gherkin.ast.Location; //导入依赖的package包/类
private PickleLocation pickleLocation(Location location) {
    return new PickleLocation(location.getLine(), location.getColumn());
}
 
开发者ID:mauriciotogneri,项目名称:green-coffee,代码行数:4,代码来源:Compiler.java


示例18: ScenarioAndLocation

import gherkin.ast.Location; //导入依赖的package包/类
public ScenarioAndLocation(ScenarioDefinition scenarioDefinition, Location location) {
    this.scenarioDefinition = scenarioDefinition;
    this.location = location;
}
 
开发者ID:temyers,项目名称:cucumber-jvm-parallel-plugin,代码行数:5,代码来源:ScenarioAndLocation.java


示例19: getLocation

import gherkin.ast.Location; //导入依赖的package包/类
public Location getLocation() {
    return location;
}
 
开发者ID:temyers,项目名称:cucumber-jvm-parallel-plugin,代码行数:4,代码来源:ScenarioAndLocation.java


示例20: setFeatureFileLocation

import gherkin.ast.Location; //导入依赖的package包/类
/**
 * Sets the feature file location based on the given file. The full file path is trimmed to only include the
 * featuresDirectory. E.g. /myproject/src/test/resources/features/feature1.feature will be saved as
 * features/feature1.feature
 *
 * @param file The feature file
 */
private void setFeatureFileLocation(final File file, final Location location) {
    featureFileLocation = normalizePathSeparator(file).concat(":" + location.getLine());
}
 
开发者ID:temyers,项目名称:cucumber-jvm-parallel-plugin,代码行数:11,代码来源:CucumberITGeneratorByScenario.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TimestampFieldMapper类代码示例发布时间:2022-05-22
下一篇:
Java ExecutionResult类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap