com.google.appengine.tools.development.testing
Class LocalTaskQueueTestConfig

java.lang.Object
  extended by com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig
All Implemented Interfaces:
LocalServiceTestConfig

public final class LocalTaskQueueTestConfig
extends java.lang.Object
implements LocalServiceTestConfig

Config for accessing the local task queue in tests. Default behavior is to configure the local task queue to not automatically execute any tasks. tearDown() wipes out all in-memory state so all queues are empty at the end of every test.


Constructor Summary
LocalTaskQueueTestConfig()
           
 
Method Summary
static LocalTaskQueue getLocalTaskQueue()
           
 LocalTaskQueueTestConfig setCallbackClass(java.lang.Class<? extends LocalTaskQueueCallback> callbackClass)
          Overrides the callback implementation used by the local task queue for async task execution.
 LocalTaskQueueTestConfig setDisableAutoTaskExecution(boolean disableAutoTaskExecution)
          Disables/enables automatic task execution.
 LocalTaskQueueTestConfig setQueueXmlPath(java.lang.String queueXmlPath)
          Overrides the location of queue.xml.
 void setUp()
          Set up the local service.
 void tearDown()
          Tear down the local service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalTaskQueueTestConfig

public LocalTaskQueueTestConfig()
Method Detail

setDisableAutoTaskExecution

public LocalTaskQueueTestConfig setDisableAutoTaskExecution(boolean disableAutoTaskExecution)
Disables/enables automatic task execution. If you enable automatic task execution, keep in mind that the default behavior is to hit the url that was provided when the TaskOptions was constructed. If you do not have a servlet engine running, this will fail. As an alternative to launching a servlet engine, instead consider providing a LocalTaskQueueCallback via setCallbackClass(Class) so that you can assert on the properties of the URLFetchServicePb.URLFetchRequest.

Parameters:
disableAutoTaskExecution -
Returns:
this (for chaining)

setQueueXmlPath

public LocalTaskQueueTestConfig setQueueXmlPath(java.lang.String queueXmlPath)
Overrides the location of queue.xml. Must be a full path, e.g. /usr/local/dev/myapp/test/queue.xml

Parameters:
queueXmlPath -
Returns:
this (for chaining)

setCallbackClass

public LocalTaskQueueTestConfig setCallbackClass(java.lang.Class<? extends LocalTaskQueueCallback> callbackClass)
Overrides the callback implementation used by the local task queue for async task execution.

Parameters:
callbackClass - fully-qualified name of a class with a public, default constructor that implements LocalTaskQueueCallback.
Returns:
this (for chaining)

setUp

public void setUp()
Description copied from interface: LocalServiceTestConfig
Set up the local service.

Specified by:
setUp in interface LocalServiceTestConfig

tearDown

public void tearDown()
Description copied from interface: LocalServiceTestConfig
Tear down the local service.

Specified by:
tearDown in interface LocalServiceTestConfig

getLocalTaskQueue

public static LocalTaskQueue getLocalTaskQueue()