ACCUMULO-3398 Set exit value for a quick pass/fail assertion.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/67a42627 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/67a42627 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/67a42627 Branch: refs/heads/master Commit: 67a426277cec072cbbbec76bebb11a780559fcc0 Parents: 851583e Author: Josh Elser <els...@apache.org> Authored: Wed Dec 10 16:09:26 2014 -0500 Committer: Josh Elser <els...@apache.org> Committed: Wed Dec 10 16:09:26 2014 -0500 ---------------------------------------------------------------------- .../test/replication/merkle/cli/CompareTables.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/67a42627/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java index 5ac5b68..44a5a3b 100644 --- a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java +++ b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/CompareTables.java @@ -157,8 +157,20 @@ public class CompareTables { CompareTables compareTables = new CompareTables(opts); Map<String,String> tableToHashes = compareTables.computeAllHashes(); + boolean hashesEqual = true; + String previousHash = null; for (Entry<String,String> entry : tableToHashes.entrySet()) { + // Set the previous hash if we dont' have one + if (null == previousHash) { + previousHash = entry.getValue(); + } else if (hashesEqual) { + // If the hashes are still equal, check that the new hash is also equal + hashesEqual = previousHash.equals(entry.getValue()); + } + System.out.println(entry.getKey() + " " + entry.getValue()); } + + System.exit(hashesEqual ? 0 : 1); } }