[appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-03-02 Thread Ed Murphy
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

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Max Ross (Google)
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:

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Krishna Caldas
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,

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Krishna Caldas
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

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Max Ross (Google)
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() {

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Krishna Caldas
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

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Max Ross (Google)
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

[appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-10 Thread Krishna
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