Thanks for starting this thread. I have my Junit tests working,
including my datastore tests, but I have a question regarding project
setup. I suppose this is more of an Eclipse question than anything
else, but perhaps you can help. I've worked in NetBeans prior, and I
can setup a 'test' folder
Subclassing LocalServiceTestHelper and overriding newEnvironment() should
work fine. What does your implementation of newEnvironment() look like?
On Wed, Feb 10, 2010 at 7:35 PM, Krishna krishnacal...@gmail.com wrote:
Ok!
But when I'm using transactions I'm getting:
It's the same (attached) I used before update to 1.3.1.
Thanks,
Krishna
2010/2/11 Max Ross (Google) maxr+appeng...@google.com:
Subclassing LocalServiceTestHelper and overriding newEnvironment() should
work fine. What does your implementation of newEnvironment() look like?
On Wed, Feb 10,
Ooops.. missed your question!
It's just:
@Override
protected Environment newEnvironment() {
return new TestEnvironment();
}
Thanks,
Krishna
2010/2/11 Max Ross (Google) maxr+appeng...@google.com:
Subclassing LocalServiceTestHelper and overriding
Your code looks fine. Are you sure you're calling setUp() on the
LocalServiceTestHelper?
On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas krishnacal...@gmail.comwrote:
Ooops.. missed your question!
It's just:
@Override
protected Environment newEnvironment() {
You're right!
I refactored my code and forget to annotate the new setUp method with @Before.
Sorry for taking your time! It works now.
Thanks,
Krishna
2010/2/11 Max Ross (Google) maxr+appeng...@google.com:
Your code looks fine. Are you sure you're calling setUp() on the
Great, glad to hear it! I forgot to add a method to LocalServiceTestHelper
to set a custom app id. My mistake. I'll make sure this gets added for the
next release so you don't need to provide your own Environment
implementation.
Max
On Thu, Feb 11, 2010 at 10:30 AM, Krishna Caldas
Ok!
But when I'm using transactions I'm getting:
java.lang.NullPointerException: No API environment is registered for
this thread.
at
com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
67)
at