Skip to content

Instantly share code, notes, and snippets.

@juven
Created August 18, 2011 13:27
Show Gist options
  • Save juven/1154051 to your computer and use it in GitHub Desktop.
Save juven/1154051 to your computer and use it in GitHub Desktop.
/*
* It's not easy to test the last modified time (mtime), because 1) while checking out the file's mtime changed,
* so you have to set it before testing; 2) on different timezone and different OS, the mtime value might change,
* (I don't have too many details now, but the mtime value of files within zip is different on my machine from on
* CI Linux server).
*
* So, since I did test the mtime on my local machine and we don't care too much about the accuracy, I'm ignoring
* the mtime here.
*/
private void assertAllFilesInfoSetEqualsIgnoreTimestamp( Set<AllFilesInfo> actual, Set<AllFilesInfo> expected )
{
for ( AllFilesInfo info : actual )
{
info.setArchiveTimestamp( 0l );
info.setFileTimestamp( 0l );
}
for ( AllFilesInfo info : expected )
{
info.setArchiveTimestamp( 0l );
info.setFileTimestamp( 0l );
}
Assert.assertEquals( actual, expected );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment