Hello.

I have implemented a method that does a few datastore queries. For
performance I decided to cache the results of the queries and use the
cache on every next method call.

Now I would like to test whether my cache works within a JUnit test.
But for this I must count the datastore queries and compare them. Is
there a way to do this?

I think about such solution:

int countBefore = ds.countQueries()
doSomething(); // 1st time without cache
assertEquals(10, ds.countQueries() - countBefore);
doSomething(); // 2nd time with cache
assertEquals(10, ds.countQueries() - countBefore);

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to