Hello.
I think these 6 tests is incorrect.
Example: testVersionedReadWrite()
In this test we store one document 2 times with different data, load 1st
version and get version list (versions var.) of documents.
I think versions.length should be 2, but in test:
assertTrue(1==versions.length);
I look why it is work in hibernate (in my XWikiJcrStore versions.length==2)
and found, what versioning updates in saveXWikiDoc run before setting
database : doc.setDatabase(context.getDatabase());
And versioning cache (XWikiContext.get/set DocumentArchive) storing at
key with default database 'xwiki', instead of 'xwikitest'
Because of it first saveXWikiDoc call storing in versioning cache by key
'xwiki:Main.WebHome', second - 'xwikitest:Main.WebHome'
Next, XWikiHibernateVersioningStore.loadXWikiDoc don't set database to
document. And XWikiHibernateVersioningStore.getXWikiDocVersions look at
wrong cache key 'xwiki:Main.WebHome' with only 1 document version.
If this is right, i offer:
XWikiHibernateStore.saveXWikiDoc:
move doc.setDatabase(context.getDatabase()); to begin
XWikiHibernateVersioningStore.loadXWikiDoc:
do doc.setDatabase(basedoc.getDatabase());
StoreTest.versionedReadWrite:
assertEquals(2, versions.length);
With these changes StoreTest passed.
I can commit this with you agree.
--
Artem Melentyev, UralSU, CS401.
Hi all
I am working on the form editor, and I have problem with modifying of some
class.
You have something like this:
#set($classdoc = ...some class doc...)
#set($someXML = $classdoc.getXMLContent())
I want to change the class on the client side in certain way (e.g. add some
property). When I finish, I get the xml of the saved class, generate xml of
the modified version and I should compare them. So, I have to traverse both
xml dom trees and see if there is any difference. The problem is....
When I am doing that in a HTML page, the dom operation
myNode.nodeNamereturns the name of the node with all letters in
UPPERCASE. And the
properties in XWiki are of course case sensitive.
Any suggestion how to do this xml comparison?
Or some other way to compare the saved and the modified version of the
class?
Thanks
Nebojsa