hi devs

i'm writting some htmlunit tests for lenya 1.2.
now i discovered a strange behavior in one of my tests. sometime it was
successful and sometimes not without any obvious pattern.
the really funny thing was that after i run the tests there was a
difference between the source file and the document i've got trough the
lenya gui.

now i found out (thanks to andreas) what the problem is. 
if you create a document it gets its lastmodified entry. now if you call
for editing in the same second as it was created the last modified entry
won't get updated because the lastmodified entry just uses seconds and
not milliseconds. so for the cache the the fresh created document is
still the one with the newest lastmodified entry so the cache won't look
for some changes and delivers the outdated document.

a possible way to get around this would be to add

Packages.java.lang.Thread.currentThread().sleep(1000);

in the editDocument function of edit-document.js.

does anyone have a better idea?


cache           |     new    |     |    still    |      |   still   |   
                |   doc 000  |--¬  |   doc 000   |      |  doc 000  |
----------------------------------------------------------------------   
timeline 000    |     010    |   | |     020     |      |   030     |
----------------------------------------------------------------------
action           create new doc  | request for edit       save doc
                                 |
                                 |
                                 |
                                 |
                                 ------------------------ 
                                                         |
                                                         V            
                                               request some time later.




simon


-- 
Simon Litwan                               [EMAIL PROTECTED]
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to