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)

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

App Engine standard environment for Java