Hey Thomas,

Good find! I thought there was something funny with finishTestAndReset, but
I wouldn't have spotted that :).

Replies inline:

On Fri May 04 22:08:03 GMT-400 2012, <[email protected]> wrote:

> OK, found it: the issue in EditorTest is that the SimpleBar that the
> setUserName is applied to and the one in the SimpleFoo's barField are
> not the same instances!
>
> The instances are initialized in response to the finishTestAndReset call
> from RequestBatcherTest, which explains the differing behavior when this
> test is commented out (or moved to run later): in this case, everything
> is initialized from the call to findSimpleFooById at the beginning of
> EditorTest#test.
>

Ok, I see.


>
> The real issue is actually that finisTestAndReset resets SimpleFoo
> before resetting SimpleBar, so when SimpleFoo asks for
> SimpleBar.getSingleton() it gets the "previous instance", and then the
> SimpleBars are reinitialized.
> When everything is initialized in EditorTest#test() through
> findSimpleFooById, the SimpleFoo's barField and SimpleBar are the same
> instances. It might be that they differ in subsequent tests but that
> just does not seem to be an issue then.
>

Ugh, that sucks - fortunately, it's just an artifact of testing. A better
fix might be to change the reset(...) in SimpleFoo to automatically reset
the SimpleBar entity? What do you think?


>
> Inverting the order of the reset calls in finishAndResetTest fixes the
> issue.
>
> I also simplified the changes to AbstractRequestContext (adding a
> "diff'ing" state to the AbstractRequestContext/RequestState that's then
> used in the various AutoBean Categories to
> a) avoid auto-editing proxies (what was done by temporarily locking the
> context in patchsets 1 to 6)
> b) change the equals() behavior for EntityProxies (fixing issue 5952)
>

Ok, I'll take a detailed look.


>
> http://gwt-code-reviews.appspot.com/1601806/<https://www.google.com/url?sa=D&q=http://gwt-code-reviews.appspot.com/1601806/>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to