@Test(expected = RecipeException.class) public void testEmptySetColumnsDirectiveAtEnd1() throws Exception { String[] directives = { "set-header A,B,D," }; TestingRig.execute(directives, new ArrayList<Row>()); Assert.assertTrue(true); }
@Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { int idx = 0; for (String name : columns) { if (idx < row.width()) { row.setColumn(idx, name.trim()); } idx++; } } return rows; }
SetHeader implements Directive, Lineage { @Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { int idx = 0; for (String name : columns) { if (idx < row.width()) { row.setColumn(idx, name.trim()); } idx++; } } return rows; } }
SetHeader implements Directive, Lineage { @Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { int idx = 0; for (String name : columns) { if (idx < row.width()) { row.setColumn(idx, name.trim()); } idx++; } } return rows; }  }
SetHeader implements Directive, Lineage { @Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { int idx = 0; for (String name : columns) { if (idx < row.width()) { row.setColumn(idx, name.trim()); } idx++; } } return rows; }  @Override UsageDefinition define(); @Override void initialize(Arguments args); @Override void destroy(); @Override List<Row> execute(List<Row> rows, ExecutorContext context); @Override Mutation lineage(); }
SetHeader implements Directive, Lineage { @Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { int idx = 0; for (String name : columns) { if (idx < row.width()) { row.setColumn(idx, name.trim()); } idx++; } } return rows; }  @Override UsageDefinition define(); @Override void initialize(Arguments args); @Override void destroy(); @Override List<Row> execute(List<Row> rows, ExecutorContext context); @Override Mutation lineage(); static final String NAME; }