FileUtils.deleteDirectory(LOCAL_REPO);
FileUtils.deleteDirectory(WORKING_COPY);
}
public void testConversion() throws SVNException, IOException {
SVNClientManager ourClientManager = SVNClientManager.newInstance();
// checkout working copy
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
updateClient.doCheckout(tgtURL, WORKING_COPY, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.INFINITY, true);
// add file under version control
int id1 = 45;
create(ourClientManager, id1);
modify(ourClientManager, id1);
int id2 = 2;
create(ourClientManager, id2);
modify(ourClientManager, id2);
delete(ourClientManager, id1);
delete(ourClientManager, id2);
final SVNRepository repository = SVNRepositoryFactory.create(tgtURL);
MyLogEntryHandler logEntryHandler = new MyLogEntryHandler();
repository.log(new String[]{""}, 0, -1, true, true, logEntryHandler);
final List<MetadataAction> metadataActionList = logEntryHandler.getMetadataActionList();
// only partial assertion of entered data
for (MetadataAction metadataAction : metadataActionList) {
Assert.assertEquals("admin", metadataAction.getUsername());
Assert.assertEquals("0:0:0:0:0:0:0:1", metadataAction.getIp());
}
final MetadataAction firstEntry = metadataActionList.get(0);
Assert.assertEquals("all", firstEntry.getSubject());
Assert.assertEquals(id1, firstEntry.getId());
Assert.assertEquals('A', firstEntry.getAction());
Assert.assertNotNull(firstEntry.getDate());
final MetadataAction lastEntry = metadataActionList.get(metadataActionList.size() - 1);
Assert.assertEquals('D', lastEntry.getAction());
Assert.assertEquals("all", lastEntry.getSubject());
ourClientManager.dispose();
}