public TestFile assertIsCopyOf(TestFile other) { assertIsFile(); other.assertIsFile(); assertEquals( String.format("%s is not the same length as %s", this, other), other.length(), this.length()); assertTrue( String.format("%s does not have the same content as %s", this, other), Arrays.equals(getHash("MD5"), other.getHash("MD5"))); return this; }
public void assertContentsHaveChangedSince(Snapshot snapshot) { Snapshot now = snapshot(); assertTrue( String.format("contents of %s have not changed", this), !Arrays.equals(now.hash, snapshot.hash)); }
public void assertHasChangedSince(Snapshot snapshot) { Snapshot now = snapshot(); assertTrue(now.modTime != snapshot.modTime || !Arrays.equals(now.hash, snapshot.hash)); }