JUnit integration test via GWT & Appengine devmodes, with RESTEasy

I want to run a test in which my GWT code sends a request to my AppEngine server and waits for a response. My server uses RESTEasy to configure request paths. My client uses some AutoBean magic that uses GWT.create (), so this test should be GWTTestCase.

What do I need to do to set up a complete simulation of the application development mode for my test? The docs mention ways to configure each of the individual services that appengine relies on, but I want to deploy all of this.

+7
source share
2 answers

Not familiar with GWTTestCase, I do not quite understand what you need here. It would not be simple:

public class LocalDatastoreTest { private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig(), new LocalUserServiceTestConfig(), new LocalTaskQueueTestConfig(), new LocalMemcacheServiceTestConfig(), new LocalAppIdentityServiceTestConfig() // etc.. ); @Before public void setUp() { helper.setUp(); } } 

where can you add additional test configs to the assistant as needed, enough to set full simulation of the appengine development mode ? Could you provide more detailed information about what you need?

(This should probably be taken into account as a comment, but the sample code I tried to write is too large for comments)

0
source

Because in general, programming tests work better through 3 library banks: It is best to do the following:

  • Just write your test cases using jUnit api and get all the necessary objects of your project from the method parameters and never run local objects
  • Create the GWT jar * * plugin from your test cases by including the GWT XML file in it
  • Add the jar to your class-paths
  • Call the jar method by providing parameter objects from within your own project packages
  • Your tests will work charmingly (neatly, reliably and quickly - just a few words in your favor all the way!) With the least effort.

Hope this helps.

0
source

All Articles