The capabilities test feature is designed to run against the App Engine development web server for testing purposes. It enables you to change the status of services, such as datastore, blobstore, etc., to determine whether your application behaves properly when it encounters the various possible statuses of the service. For example, by changing the datastore service status to disabled, you can test whether your app handles datastore unavailability in a graceful manner.
There are several ways to use the capabilities test feature:
- Change Capabilities Status Using the Console
- Change Capabilities Status Using the Command Line
- Change Capabilities Status Using the Capabilities API
Change Capabilities Status Using the Console
To change capabilities in the console,
- With your app running on the development server, access the console by visiting the URL
/_ah/adminon your server, for example: http://localhost:8888/_ah/admin.
- In the console, click Capabilities Status in the bottom left of the console.
- In the Capabilities Status Configuration page, locate the service or services that are used by your app and whose status you wish to change; click the dropdown menu next to the service name and select the status you want to test on that service:
The services now reflect the settings you have chosen the next time your app accesses them. Run your app and observe its behavior.
Change Capabilities Status Using the Command Line
If you use Eclipse, you can set one or more capabilities using the debug command line options.
To change capability settings using the VM command line arguments in Eclipse
- With Eclipse open, select your project, right-click, then select Debug As > Debug Configurations.
- Go to the Arguments tab and enter the desired option in the VM arguments textbox. The format of the option is
capabilitynameis replaced by the name of the service (see Capability (Service) Names) and
statusnameis replaced by the capability status you want to use (see Capability Status Values).
Note: For the datastore write capability, replace
datastore_v3and the asterisk (
write, like this:
Dcapability.status.datastore_v3.write. For the other capabilities, leave the asterisk as shown.
The screen capture below shows two capabilities (datastore and images) being disabled from the command line:
- Click Apply to save your changes
- Click Debug to run your app with those settings.
Capability (Service) Names
|Capability Name in API||Capability Name displayed in Console||Description|
||BLOBSTORE||The blobstore service|
||DATASTORE||The datastore service for queries|
||DATASTORE_WRITE||The datastore service for write requests|
||IMAGES||The images service|
|The mail service|
||MEMCACHE||The memcache service|
||PROSPECTIVE_SEARCH||The memcache service|
||TASKQUEUE||The taskqueue service|
||URLFETCH||The urlfetch service|
||XMPP||The XMPP service|
Capability Status Values
|Status Values for All Capabilities||Description|
||The capability is disabled.|
||The capability is available and no maintenance is currently planned.|
||The capability is available but scheduled for maintenance.|
||The status of this service is unknown.|
Change Capabilities Status Using the Capabilities API
To use the local service capabilities test feature in the API, you use the LocalCapabilitiesServiceTestConfig class. For more information and a code sample, see Writing Local Service Capabilities Tests.