@Test public void isCheckSumValid_invalidCheckSum() { CheckSum checkSum = CheckSum.parse("2:asdf"); ChangeSet changeSet = new ChangeSet("1", "2",false, false, "/test.xml",null, null); assertFalse(changeSet.isCheckSumValid(checkSum)); }
public boolean isCheckSumValid(CheckSum storedCheckSum) { CheckSum currentMd5Sum = generateCheckSum(); if (currentMd5Sum == null) { return true; } if (storedCheckSum == null) { return true; } if (currentMd5Sum.equals(storedCheckSum)) { return true; } for (CheckSum validCheckSum : validCheckSums) { if (validCheckSum.toString().equalsIgnoreCase("1:any")) { return true; } if (currentMd5Sum.equals(validCheckSum)) { return true; } } return false; }
ChangeSet implements Conditional { public boolean isCheckSumValid(CheckSum storedCheckSum) { CheckSum currentMd5Sum = generateCheckSum(); if (currentMd5Sum == null) { return true; } if (storedCheckSum == null) { return true; } if (currentMd5Sum.equals(storedCheckSum)) { return true; } for (CheckSum validCheckSum : validCheckSums) { if (validCheckSum.toString().equalsIgnoreCase("1:any")) { return true; } if (currentMd5Sum.equals(validCheckSum)) { return true; } } return false; } }
ChangeSet implements Conditional { public boolean isCheckSumValid(CheckSum storedCheckSum) { CheckSum currentMd5Sum = generateCheckSum(); if (currentMd5Sum == null) { return true; } if (storedCheckSum == null) { return true; } if (currentMd5Sum.equals(storedCheckSum)) { return true; } for (CheckSum validCheckSum : validCheckSums) { if (validCheckSum.toString().equalsIgnoreCase("1:any")) { return true; } if (currentMd5Sum.equals(validCheckSum)) { return true; } } return false; } ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList);  ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList, boolean runInTransaction); }
ChangeSet implements Conditional { public boolean isCheckSumValid(CheckSum storedCheckSum) { CheckSum currentMd5Sum = generateCheckSum(); if (currentMd5Sum == null) { return true; } if (storedCheckSum == null) { return true; } if (currentMd5Sum.equals(storedCheckSum)) { return true; } for (CheckSum validCheckSum : validCheckSums) { if (validCheckSum.toString().equalsIgnoreCase("1:any")) { return true; } if (currentMd5Sum.equals(validCheckSum)) { return true; } } return false; } ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList);  ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList, boolean runInTransaction); boolean shouldAlwaysRun(); boolean shouldRunOnChange(); String getFilePath(); CheckSum generateCheckSum(); ExecType execute(DatabaseChangeLog databaseChangeLog, Database database); void rollback(Database database); List<Change> getChanges(); void addChange(Change change); String getId(); String getAuthor(); Set<String> getContexts(); Set<String> getDbmsSet(); String toString(boolean includeMD5Sum); @Override String toString(); String getComments(); void setComments(String comments); boolean isAlwaysRun(); boolean isRunOnChange(); boolean isRunInTransaction(); Change[] getRollBackChanges(); void addRollBackSQL(String sql); void addRollbackChange(Change change); boolean supportsRollback(Database database); String getDescription(); Boolean getFailOnError(); void setFailOnError(Boolean failOnError); ValidationFailOption getOnValidationFail(); void setOnValidationFail(ValidationFailOption onValidationFail); void setValidationFailed(boolean validationFailed); void addValidCheckSum(String text); boolean isCheckSumValid(CheckSum storedCheckSum); PreconditionContainer getPreconditions(); void setPreconditions(PreconditionContainer preconditionContainer); void addSqlVisitor(SqlVisitor sqlVisitor); List<SqlVisitor> getSqlVisitors(); }
ChangeSet implements Conditional { public boolean isCheckSumValid(CheckSum storedCheckSum) { CheckSum currentMd5Sum = generateCheckSum(); if (currentMd5Sum == null) { return true; } if (storedCheckSum == null) { return true; } if (currentMd5Sum.equals(storedCheckSum)) { return true; } for (CheckSum validCheckSum : validCheckSums) { if (validCheckSum.toString().equalsIgnoreCase("1:any")) { return true; } if (currentMd5Sum.equals(validCheckSum)) { return true; } } return false; } ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList);  ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList, boolean runInTransaction); boolean shouldAlwaysRun(); boolean shouldRunOnChange(); String getFilePath(); CheckSum generateCheckSum(); ExecType execute(DatabaseChangeLog databaseChangeLog, Database database); void rollback(Database database); List<Change> getChanges(); void addChange(Change change); String getId(); String getAuthor(); Set<String> getContexts(); Set<String> getDbmsSet(); String toString(boolean includeMD5Sum); @Override String toString(); String getComments(); void setComments(String comments); boolean isAlwaysRun(); boolean isRunOnChange(); boolean isRunInTransaction(); Change[] getRollBackChanges(); void addRollBackSQL(String sql); void addRollbackChange(Change change); boolean supportsRollback(Database database); String getDescription(); Boolean getFailOnError(); void setFailOnError(Boolean failOnError); ValidationFailOption getOnValidationFail(); void setOnValidationFail(ValidationFailOption onValidationFail); void setValidationFailed(boolean validationFailed); void addValidCheckSum(String text); boolean isCheckSumValid(CheckSum storedCheckSum); PreconditionContainer getPreconditions(); void setPreconditions(PreconditionContainer preconditionContainer); void addSqlVisitor(SqlVisitor sqlVisitor); List<SqlVisitor> getSqlVisitors();  }