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


Java Examples类代码示例

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


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

示例1: examples

import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples( Examples arg0 )
{
    addRecordType( currentScenario.getName(), false );
    String[] columnNames = null;
    
    
    for ( ExamplesTableRow e : arg0.getRows() )
    {
        int namePosition = -1;
        if ( columnNames == null )
        {
            
            columnNames = new String[ e.getCells().size() ];
            for ( int i=0; i<e.getCells().size(); i++ )
            {
                columnNames[ i ] = e.getCells().get( i );
                if ( columnNames[ i ].equals( "name" ) )
                    namePosition = i;
            }
        }
        else
        {
            DefaultPageData pageData = new DefaultPageData( currentScenario.getName(), namePosition == -1 ? "" : e.getCells().get( namePosition ), true );
            for ( int i=0; i<e.getCells().size(); i++ )
            {
                pageData.addValue( columnNames[ i ], e.getCells().get( i ) );
            }
            addRecord( pageData );
        }
    }
}
 
开发者ID:xframium,项目名称:xframium-java,代码行数:33,代码来源:XMLFormatter.java

示例2: loadAndReplaceExamples

import gherkin.formatter.model.Examples; //导入依赖的package包/类
private void loadAndReplaceExamples(Examples examples, ExamplesTableRow cells, String filePathFromComment, Resource sourceResource) {
    List<ExamplesTableRow> rows = new ArrayList<ExamplesTableRow>();
    List<ExamplesTableRow> oldrows = examples.getRows();
    ExamplesTableRow tableRowHeader = oldrows.get(0);
    rows.add(tableRowHeader);

    DataReader dataReader;
    try {
        InputStream inputStream = sourceResource.getInputStream();
        dataReader = DataReaderFactory.create(sourceResource.getFilename());
        DataDTO data = dataReader.readExamples(inputStream);
        ExamplesTableRow tableRow;
        int lineNumOffset = 1;
        for (Integer lineNumInResource : data.getValues().keySet()) {
            List<String> values = data.getValues().get(lineNumInResource);
            String valueComment = String.format("# %s:%d", filePathFromComment, lineNumInResource + 1);
            Comment comment = new Comment(valueComment, lineNumInResource);
            List<Comment> comments = Lists.newArrayList(comment);
            int newLineNum = tableRowHeader.getLine() + lineNumOffset;
            if (isPreview) {
                newLineNum += lineOffset;
            }
            tableRow = new ExamplesTableRow(comments, values, newLineNum, cells.getId());
            rows.add(tableRow);

            // newLine + 1 added because of the comment that is inserted
            featureLineOffset.put(tableRowHeader.getLine() + lineNumOffset, newLineNum + 1);

            lineOffset += 1;
            lineNumOffset++;
        }

        // re-calculate lineOffset
        lineOffset = (lineOffset + lineNumOffset) - examples.getRows().size();
        examples.setRows(rows);
    } catch (IOException | InstantiationException | IllegalAccessException e) {
        throw Throwables.propagate(e);
    }
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:40,代码来源:MiniumFeatureBuilder.java

示例3: examples

import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(final Examples exmpls) {
    //Nothing to do with Allure
}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:5,代码来源:AllureCucumberJvm.java

示例4: examples

import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(Examples arg0) {
	currentExamples = arg0.toMap();
	currentScenario.put("examples", currentExamples);
}
 
开发者ID:domgold,项目名称:asciidoctor-gherkin-extension,代码行数:6,代码来源:MapFormatter.java

示例5: setExamples

import gherkin.formatter.model.Examples; //导入依赖的package包/类
public void setExamples(Examples examples) {
    this.examples = examples;
}
 
开发者ID:seize-the-dave,项目名称:jbehave-to-gherkin,代码行数:4,代码来源:ScenarioWrapper.java

示例6: examples

import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(Examples arg0) {
	wrapped.equals(arg0);
}
 
开发者ID:gfk-ba,项目名称:senbot,代码行数:5,代码来源:WrappedJSONFormatter.java

示例7: examples

import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(Examples arg0) {
	getWrapped().examples(arg0);
	
}
 
开发者ID:gfk-ba,项目名称:senbot,代码行数:6,代码来源:ParameterizedCucumber.java


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