@Override @Test public void getConfirmationMessage() throws Exception { AddColumnChange refactoring = new AddColumnChange(); refactoring.setTableName("TAB"); ColumnConfig column = new ColumnConfig(); column.setName("NEWCOL"); column.setType("TYP"); refactoring.addColumn(column); assertEquals("Columns NEWCOL(TYP) added to TAB", refactoring.getConfirmationMessage()); }
public String getConfirmationMessage() { List<String> names = new ArrayList<String>(columns.size()); for (ColumnConfig col : columns) { names.add(col.getName() + "(" + col.getType() + ")"); } return "Columns " + StringUtils.join(names, ",") + " added to " + tableName; }
AddColumnChange extends AbstractChange implements ChangeWithColumns<ColumnConfig> { public String getConfirmationMessage() { List<String> names = new ArrayList<String>(columns.size()); for (ColumnConfig col : columns) { names.add(col.getName() + "(" + col.getType() + ")"); } return "Columns " + StringUtils.join(names, ",") + " added to " + tableName; } }
AddColumnChange extends AbstractChange implements ChangeWithColumns<ColumnConfig> { public String getConfirmationMessage() { List<String> names = new ArrayList<String>(columns.size()); for (ColumnConfig col : columns) { names.add(col.getName() + "(" + col.getType() + ")"); } return "Columns " + StringUtils.join(names, ",") + " added to " + tableName; } AddColumnChange(); }
AddColumnChange extends AbstractChange implements ChangeWithColumns<ColumnConfig> { public String getConfirmationMessage() { List<String> names = new ArrayList<String>(columns.size()); for (ColumnConfig col : columns) { names.add(col.getName() + "(" + col.getType() + ")"); } return "Columns " + StringUtils.join(names, ",") + " added to " + tableName; } AddColumnChange(); String getSchemaName(); void setSchemaName(String schemaName); String getTableName(); void setTableName(String tableName); List<ColumnConfig> getColumns(); void addColumn(ColumnConfig column); void removeColumn(ColumnConfig column); @Override ValidationErrors validate(Database database); SqlStatement[] generateStatements(Database database); String getConfirmationMessage(); }
AddColumnChange extends AbstractChange implements ChangeWithColumns<ColumnConfig> { public String getConfirmationMessage() { List<String> names = new ArrayList<String>(columns.size()); for (ColumnConfig col : columns) { names.add(col.getName() + "(" + col.getType() + ")"); } return "Columns " + StringUtils.join(names, ",") + " added to " + tableName; } AddColumnChange(); String getSchemaName(); void setSchemaName(String schemaName); String getTableName(); void setTableName(String tableName); List<ColumnConfig> getColumns(); void addColumn(ColumnConfig column); void removeColumn(ColumnConfig column); @Override ValidationErrors validate(Database database); SqlStatement[] generateStatements(Database database); String getConfirmationMessage();  }