*/
@Test
public void testChangeSets() throws ParseException {
int totCs = Integer.parseInt(props.getProperty("testChangeSets"));
for (int i = 1; i <= totCs; i++) {
Transaction cs = getTransaction(props.getProperty("changeSet" + i + ".date"));
if (cs != null) {
ArrayList<String> modified = new ArrayList<String>();
ArrayList<String> deleted = new ArrayList<String>();
ArrayList<String> added = new ArrayList<String>();
ArrayList<String> moved = new ArrayList<String>();
if (props.getProperty("changeSet" + i + ".modifiedFiles") != null
&& props.getProperty("changeSet" + i + ".modifiedFiles").compareTo("") != 0) {
StringTokenizer tokenizer =
new StringTokenizer(props.getProperty("changeSet" + i + ".modifiedFiles"), ",");
while (tokenizer.hasMoreTokens()) {
modified.add(tokenizer.nextToken());
}
}
if (props.getProperty("changeSet" + i + ".deletedFiles") != null
&& props.getProperty("changeSet" + i + ".deletedFiles").compareTo("") != 0) {
StringTokenizer tokenizer =
new StringTokenizer(props.getProperty("changeSet" + i + ".deletedFiles"), ",");
while (tokenizer.hasMoreTokens()) {
deleted.add(tokenizer.nextToken());
}
}
if (props.getProperty("changeSet" + i + ".addedFiles") != null
&& props.getProperty("changeSet" + i + ".addedFiles").compareTo("") != 0) {
StringTokenizer tokenizer =
new StringTokenizer(props.getProperty("changeSet" + i + ".addedFiles"), ",");
while (tokenizer.hasMoreTokens()) {
added.add(tokenizer.nextToken());
}
}
if (props.getProperty("changeSet" + i + ".movedFiles") != null
&& props.getProperty("changeSet" + i + ".movedFiles").compareTo("") != 0) {
StringTokenizer tokenizer =
new StringTokenizer(props.getProperty("changeSet" + i + ".movedFiles"), ",");
while (tokenizer.hasMoreTokens()) {
moved.add(tokenizer.nextToken());
}
}
assertEquals(
"Erroneous number of involved file versions for ChangeSet at date " + cs.getStarted(),
modified.size() + deleted.size() + added.size() + moved.size(),
cs.getInvolvedRevisions().size());
for (Revision ver : cs.getInvolvedRevisions()) {
String fileVersionId = ver.getFile().getPath() + ":" + ver.getNumber();
assertEquals(
"FileVersion " + fileVersionId + " has not the number of associated to the change set",
(Long) Long.parseLong(props.getProperty("changeSet" + i)),
(Long) Long.parseLong(ver.getNumber()));