public void testVersioningComments() throws RegistryException {
assertEquals(StaticConfiguration.isVersioningComments(), false);
Resource r = registry.newResource();
registry.put("/testComments", r);
Comment c1 = new Comment("comment1");
registry.addComment("/testComments", c1);
registry.createVersion("/testComments");
Comment c2 = new Comment("comment2");
registry.addComment("/testComments", c2);
// to create the version
registry.createVersion("/testComments");
// retrieve versions
String []versionPaths = registry.getVersions("/testComments");
assertEquals(versionPaths.length, 2);
// still there should be the comments
registry.restoreVersion(versionPaths[1]);
Comment[] cs = registry.getComments("/testComments");
assertEquals(cs.length, 2);
assertEquals(cs[1].getText(), "comment2");
Resource c = registry.newCollection();
registry.put("/testCommentsC", c);
c1 = new Comment("comment1");
registry.addComment("/testCommentsC", c1);
registry.createVersion("/testCommentsC");
c2 = new Comment("comment2");
registry.addComment("/testCommentsC", c2);
// to create the version
registry.createVersion("/testCommentsC");
// retrieve versions