if (currRev.getFile().getPath().compareTo(normFileName) == 0) {
assertEquals("Wrong File Version", "15", currRev.getNumber());
SVNRevision ancestor = ((SVNRevision) currRev).getAncestor();
assertEquals("Wrong ancestor", normFileAncestorName, ancestor.getFile().getPath());
ArrayList<String> versionNums = new ArrayList<String>();
versionNums.add("13");
versionNums.add("9");
versionNums.add("8");
versionNums.add("6");
versionNums.add("5");
versionNums.add("3");
for (String version : versionNums) {
assertTrue("Wrong version number for file " + ancestor.getFile().getPath(), version.compareTo(ancestor.getNumber()) == 0);
if (version.compareTo("13") == 0) {
totFilesTested++;
assertTrue("Wrong commit message for version " + version + " of file " + normFileAncestorName + " for release "
+ rel.getName(), ancestor.getReport().getCommitMessage().contains("modified all files"));
assertTrue("Wrong commit author for version " + version + " of file " + normFileAncestorName + " for release "
+ rel.getName(), ancestor.getReport().getAuthor().getFirstName().compareTo("Giacomo") == 0);
for (Role r : ancestor.getReport().getAuthor().getRoles()) {
if (r instanceof CommitterRole) {
assertTrue("Author of " + ancestor.getFile().getName() + ":" + ancestor.getNumber() + " doesn't have it in its artifacts", ((CommitterRole) r).getArtifacts().contains(ancestor));
break;
}
}
assertTrue("Wrong commit date for version " + version + " of file " + normFileAncestorName + " for release "
+ rel.getName(), "Fri Oct 09 13:40:12 CEST 2009".equals(ancestor.getReport().getCreationTime().toString()));
} else if (version.compareTo("3") == 0) {
totFilesTested++;
assertTrue("Wrong commit message for version " + version + " of file " + normFileAncestorName + " for release "
+ rel.getName(), ancestor.getReport().getCommitMessage().contains(""));
assertTrue("Wrong commit author for version " + version + " of file " + normFileAncestorName + " for release "
+ rel.getName(), ancestor.getReport().getAuthor().getFirstName().compareTo("Giacomo") == 0);
for (Role r : ancestor.getReport().getAuthor().getRoles()) {
if (r instanceof CommitterRole) {
assertTrue("Author of " + ancestor.getFile().getName() + ":" + ancestor.getNumber() + " doesn't have it in its artifacts", ((CommitterRole) r).getArtifacts().contains(ancestor));
break;
}
}
assertTrue("Wrong commit date for version " + version + " of file " + normFileAncestorName + " for release "
+ rel.getName(), ancestor.getReport().getCreationTime().toString().equals("Fri Oct 09 11:41:31 CEST 2009"));
// assert ancestor has no more previous versions
assertNull("The number of versions for " + normFileAncestorName + " is more then expected", ancestor.getPreviousRevision());
}
if (ancestor.getPreviousRevision() != null) {
assertEquals(
"Next and PreviousVersion of two successive FileVersions don't match for release "
+ rel.getName(),
ancestor.getPreviousRevision().getNextRevision().getId(),
ancestor.getId());
}
if (ancestor.getPreviousRevision() != null) {
ancestor = sSession.load(SVNRevision.class, ancestor
.getPreviousRevision().getId());
}
}
break;