LocalServiceTestHelper

com.google.appengine.tools.development.testing

Class LocalServiceTestHelper

  • java.lang.Object
    • com.google.appengine.tools.development.testing.LocalServiceTestHelper


  • public class LocalServiceTestHelper
    extends java.lang.Object
    Helper class for testing against local app engine services. Construct the helper with one LocalServiceTestConfig instance for each service that you wish to access as part of your test. Then call setUp() before each test executes and tearDown() after each test executes. No specific test-harness is assumed, but here's a JUnit 3 example that uses task queues and the datastore.
     public void MyTest extends TestCase {
    
       private final LocalServiceTestHelper helper = new LocalServiceTestHelper(
         new LocalTaskQueueTestConfig(), new LocalDatastoreServiceTestConfig());
    
       @Override
       public void setUp() {
         super.setUp();
         helper.setUp();
       }
    
       @Override
       public void tearDown() {
         helper.tearDown();
         super.tearDown();
       }
     }