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

2010-02-10 Thread 时空之蕊
I found the class
com.google.appengine.tools.development.ApiProxyLocalImpl is not
public,but before 1.3.1 it's public!
In the JUnit document:

import java.io.File;
import com.google.appengine.tools.development.ApiProxyLocalImpl;
import com.google.apphosting.api.ApiProxy;

ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});

So I can't new a ApiProxyLocalImpl instance!
Any body know how to use JUnit?
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.



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

2010-02-10 Thread Ikai L (Google)
We've got a more simple interface for you now. Take a look:

http://code.google.com/appengine/docs/java/tools/localunittesting.html

2010/2/10 时空之蕊 

> I found the class
> com.google.appengine.tools.development.ApiProxyLocalImpl is not
> public,but before 1.3.1 it's public!
> In the JUnit document:
>
> import java.io.File;
> import com.google.appengine.tools.development.ApiProxyLocalImpl;
> import com.google.apphosting.api.ApiProxy;
>
> ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
>
> So I can't new a ApiProxyLocalImpl instance!
> Any body know how to use JUnit?
> 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.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
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.



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

2010-02-11 Thread 杨浩
Thanks for your help! ^ ^

It's OK!

Where's the download of the  appengine-testing.jar sources?
It's a security?

Thanks!


在 2010年2月11日 上午8:25,Ikai L (Google) 写道:

> We've got a more simple interface for you now. Take a look:
>
> http://code.google.com/appengine/docs/java/tools/localunittesting.html
>
> 2010/2/10 时空之蕊 
>
> I found the class
>> com.google.appengine.tools.development.ApiProxyLocalImpl is not
>> public,but before 1.3.1 it's public!
>> In the JUnit document:
>>
>> import java.io.File;
>> import com.google.appengine.tools.development.ApiProxyLocalImpl;
>> import com.google.apphosting.api.ApiProxy;
>>
>> ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
>>
>> So I can't new a ApiProxyLocalImpl instance!
>> Any body know how to use JUnit?
>> 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.



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

2010-02-11 Thread 杨浩
Hello Ikai L(Google)!
Thank you!

In the demo:
http://code.google.com/appengine/docs/java/tools/localunittesting.html

I have a idea about the JUnit4 testcase!

defined a Basic TestCase:

public class *GAETestCase* {
protected final LocalServiceTestHelper gaeHelper = new
LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
@Before
public *final* void *setUpForGAEEvn*() throws Exception {
gaeHelper.setUp();
}

@After
public *final* void *tearDownForGAEEvn*() throws Exception {
gaeHelper.tearDown();
}
}

public class OtherTestCase extends *GAETestCase* {
……
@Test
public void myTest() {
……
}
}

the another testcase OtherTestCase extends GAETestCase,
so It's will never forget invoke the *LocalServiceTestHelper.setUp* and *
LocalServiceTestHelper.tearDown* method!
(Krishna Caldas  forgot to invoke *
LocalServiceTestHelper.setUp and **LocalServiceTestHelper.tearDown*,others
may be will forget invoke it!)



在 2010年2月11日 上午8:25,Ikai L (Google) 写道:

> We've got a more simple interface for you now. Take a look:
>
> http://code.google.com/appengine/docs/java/tools/localunittesting.html
>

-- 
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.