Hi, I'm looking for advice on doing unit tests for multi threaded user
access to my server side code.

In particular, I have a section of server-side code that updatse an
entity using JDO that I expect to potentially be executed by multiple
users at the same time.  If this were to happen I except a
JDOCanRetryException to be thrown and the need for code to loop and
retry.  This is all fine and I have written this code, however I've
having a hard time testing it.

It seems as though if I create a LocalServiceTestHelper in one thread
and then call UserService.getCurrentUser() in another thread, it
throws a NullPointerException.  So I tried creating a
LocalServiceTestHelper in each thread and this lets me get the active
user, but then the object I insert in one thread is not visible to
other thread.  The key what I'm trying to test is having two different
threads attempt to update the same entity at the same time so I think
I need multiple threads to share the same LocalServiceTestHelper, but
I'm not sure if this is possible.

I haven't found much out there on this topic so any advice
appreciated.
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to