本文整理汇总了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 );
}
}
}
示例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);
}
}
示例3: examples
import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(final Examples exmpls) {
//Nothing to do with Allure
}
示例4: examples
import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(Examples arg0) {
currentExamples = arg0.toMap();
currentScenario.put("examples", currentExamples);
}
示例5: setExamples
import gherkin.formatter.model.Examples; //导入依赖的package包/类
public void setExamples(Examples examples) {
this.examples = examples;
}
示例6: examples
import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(Examples arg0) {
wrapped.equals(arg0);
}
示例7: examples
import gherkin.formatter.model.Examples; //导入依赖的package包/类
@Override
public void examples(Examples arg0) {
getWrapped().examples(arg0);
}