Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.


Stay organized with collections Save and categorize content based on your preferences.

Class DevAppServerTestRunner

  • java.lang.Object
    • BlockJUnit4ClassRunner

  • public class DevAppServerTestRunner
    extends BlockJUnit4ClassRunner
    A JUnit4 test runner that runs tests in the isolated classloader of a running app engine app. Test classes that are run with this test runner must also be annotated with DevAppServerTest. For example:
     public void MyTest {
       private final LocalServiceTestHelper testHelper = new LocalServiceTestHelper(
         new LocalURLFetchServiceTestConfig(), new LocalDatastoreServiceTestConfig());
       public static class TestConfig extends BaseDevAppServerTestConfig {
         public File getSdkRoot() {
           return sdkRoot;
         public File getAppDir() {
           return appDir;
         public List getClasspath() {
           return urls;
       public void setUpHelper() {
       public void tearDownHelper() {
       public void testEndToEnd() throws Exception {
         URLFetchService fetchService = URLFetchServiceFactory.getURLFetchService();
         HTTPResponse resp = fetchService.fetch(new URL("http://localhost:" +
           System.getProperty(DevAppServerTest.DEFAULT_PORT_SYSTEM_PROPERTY) + "/insertFoo?id=33"));
         assertEquals(200, resp.getResponseCode());
         DatastoreServiceFactory.getDatastoreService().get(KeyFactory.createKey("foo", 33));
    • Constructor Summary

      Constructor and Description
      DevAppServerTestRunner(java.lang.Class<?> klass) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected void collectInitializationErrors(java.util.List<java.lang.Throwable> errors) 
      protected Statement withAfterClasses(Statement statement) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DevAppServerTestRunner

        public DevAppServerTestRunner(java.lang.Class<?> klass)
                               throws InitializationError
    • Method Detail

      • collectInitializationErrors

        protected void collectInitializationErrors(java.util.List<java.lang.Throwable> errors)
      • withAfterClasses

        protected Statement withAfterClasses(Statement statement)