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


Java Location类代码示例

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


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


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