Class DevAppServerTestRunner
java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
com.google.appengine.tools.development.testing.DevAppServerTestRunner
- All Implemented Interfaces:
org.junit.runner.Describable,org.junit.runner.manipulation.Filterable,org.junit.runner.manipulation.Orderable,org.junit.runner.manipulation.Sortable
public class DevAppServerTestRunner
extends org.junit.runners.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:
invalid input: '@'RunWith(DevAppServerTestRunner.class) invalid input: '@'DevAppServerTest(MyTest.TestConfig.class) 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 ListgetClasspath() { return urls; } } invalid input: '@'Before public void setUpHelper() { testHelper.setUp(); } invalid input: '@'After public void tearDownHelper() { testHelper.tearDown(); } invalid input: '@'Test 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcollectInitializationErrors(List<Throwable> errors) protected org.junit.runners.model.StatementwithAfterClasses(org.junit.runners.model.Statement statement) Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
computeTestMethods, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeoutMethods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withBeforeClasses, withInterruptIsolationMethods inherited from class org.junit.runner.Runner
testCount
-
Constructor Details
-
DevAppServerTestRunner
- Throws:
org.junit.runners.model.InitializationError
-
-
Method Details
-
collectInitializationErrors
- Overrides:
collectInitializationErrorsin classorg.junit.runners.BlockJUnit4ClassRunner
-
withAfterClasses
protected org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement) - Overrides:
withAfterClassesin classorg.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
-