@Override @Test public void generateCheckSum() throws Exception { LoadDataChange refactoring = new LoadDataChange(); refactoring.setSchemaName("SCHEMA_NAME"); refactoring.setTableName("TABLE_NAME"); refactoring.setFile("liquibase/change/core/sample.data1.csv"); refactoring.setResourceAccessor(new ClassLoaderResourceAccessor()); String md5sum1 = refactoring.generateCheckSum().toString(); refactoring.setFile("liquibase/change/core/sample.data2.csv"); String md5sum2 = refactoring.generateCheckSum().toString(); assertTrue(!md5sum1.equals(md5sum2)); assertEquals(md5sum2, refactoring.generateCheckSum().toString()); }
@Override public CheckSum generateCheckSum() { InputStream stream = null; try { stream = getResourceAccessor().getResourceAsStream(getFile()); if (stream == null) { throw new RuntimeException(getFile() + " could not be found"); } return CheckSum.compute(stream); } catch (IOException e) { throw new RuntimeException(e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) { ; } } } }
LoadDataChange extends AbstractChange implements ChangeWithColumns<LoadDataColumnConfig> { @Override public CheckSum generateCheckSum() { InputStream stream = null; try { stream = getResourceAccessor().getResourceAsStream(getFile()); if (stream == null) { throw new RuntimeException(getFile() + " could not be found"); } return CheckSum.compute(stream); } catch (IOException e) { throw new RuntimeException(e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) { ; } } } } }
LoadDataChange extends AbstractChange implements ChangeWithColumns<LoadDataColumnConfig> { @Override public CheckSum generateCheckSum() { InputStream stream = null; try { stream = getResourceAccessor().getResourceAsStream(getFile()); if (stream == null) { throw new RuntimeException(getFile() + " could not be found"); } return CheckSum.compute(stream); } catch (IOException e) { throw new RuntimeException(e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) { ; } } } } LoadDataChange(); protected  LoadDataChange(String changeName, String changeDescription); }
LoadDataChange extends AbstractChange implements ChangeWithColumns<LoadDataColumnConfig> { @Override public CheckSum generateCheckSum() { InputStream stream = null; try { stream = getResourceAccessor().getResourceAsStream(getFile()); if (stream == null) { throw new RuntimeException(getFile() + " could not be found"); } return CheckSum.compute(stream); } catch (IOException e) { throw new RuntimeException(e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) { ; } } } } LoadDataChange(); protected  LoadDataChange(String changeName, String changeDescription); String getSchemaName(); void setSchemaName(String schemaName); String getTableName(); void setTableName(String tableName); String getFile(); void setFile(String file); String getEncoding(); void setEncoding(String encoding); String getSeparator(); void setSeparator(String separator); String getQuotchar(); void setQuotchar(String quotchar); void addColumn(LoadDataColumnConfig column); List<LoadDataColumnConfig> getColumns(); SqlStatement[] generateStatements(Database database); String getConfirmationMessage(); @Override CheckSum generateCheckSum(); }
LoadDataChange extends AbstractChange implements ChangeWithColumns<LoadDataColumnConfig> { @Override public CheckSum generateCheckSum() { InputStream stream = null; try { stream = getResourceAccessor().getResourceAsStream(getFile()); if (stream == null) { throw new RuntimeException(getFile() + " could not be found"); } return CheckSum.compute(stream); } catch (IOException e) { throw new RuntimeException(e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) { ; } } } } LoadDataChange(); protected  LoadDataChange(String changeName, String changeDescription); String getSchemaName(); void setSchemaName(String schemaName); String getTableName(); void setTableName(String tableName); String getFile(); void setFile(String file); String getEncoding(); void setEncoding(String encoding); String getSeparator(); void setSeparator(String separator); String getQuotchar(); void setQuotchar(String quotchar); void addColumn(LoadDataColumnConfig column); List<LoadDataColumnConfig> getColumns(); SqlStatement[] generateStatements(Database database); String getConfirmationMessage(); @Override CheckSum generateCheckSum();  }