Funktionsdiensttests konfigurieren
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mit dem Funktionstest werden Prüfungen am App Engine Entwicklungswebserver vorgenommen. Dabei können Sie den Status von Diensten wie z. B. Datastore oder Blobstore ändern, um festzustellen, ob sich Ihre Anwendung in dem jeweiligen möglichen Status des Dienstes ordnungsgemäß verhält. Wenn Sie beispielsweise den Datastore-Dienststatus in "Deaktiviert" ändern, können Sie testen, ob Ihre Anwendung die Nichtverfügbarkeit des Datenspeichers korrekt verarbeitet.
Es gibt mehrere Möglichkeiten, den Funktionstest zu nutzen:
Status der Funktionen in der Konsole ändern
So ändern Sie Funktionen in der Konsole:
- Während die Anwendung auf dem Entwicklungsserver ausgeführt wird, öffnen Sie die Konsole über die URL
/_ah/admin
des Servers, zum Beispiel: http://localhost:8888/_ah/admin.
- Klicken Sie in der Konsole unten links auf Funktionsstatus.
- Suchen Sie auf der Seite Konfiguration des Funktionsstatus die Dienste, die Ihre Anwendung nutzt und deren Status Sie ändern möchten. Klicken Sie auf das Drop-down-Menü neben dem Dienstnamen und wählen Sie den Status aus, den Sie für diesen Dienst testen möchten:
Beim nächsten Zugriff der Anwendung auf den jeweiligen Dienst arbeitet dieser in dem ausgewählten Status. Führen Sie die Anwendung aus und beobachten Sie ihr Verhalten.
Funktionsstatus über die Befehlszeile ändern
Wenn Sie Eclipse verwenden, können Sie mithilfe der Befehlszeilenoptionen zur Fehlerbehebung eine oder mehrere Funktionen einstellen.
So ändern Sie die Funktionseinstellungen mit VM-Befehlszeilenargumenten in Eclipse:
- Wählen Sie bei geöffnetem Eclipse Ihr Projekt aus, klicken Sie es mit der rechten Maustaste an und wählen Sie im Kontextmenü die Option Fehler beheben als > Konfiguration der Fehlerbehebung.
- Wechseln Sie zur Registerkarte Argumente und geben Sie in das Textfeld VM-Argumente die gewünschte Option ein. Die Option hat das folgende Format:
-Dcapability.status.capabilityname.*=statusname
Dabei wurde capabilityname
durch den Dienstnamen (siehe (Dienst)-Namen von Funktionen) und statusname
durch den Funktionsstatus ersetzt, den Sie verwenden möchten (siehe Funktionsstatuswerte).
Hinweis: Ersetzen Sie bei der Datenspeicher-Schreibfunktion capabilityname
durch datastore_v3
und das Sternchen (*
) durch write
: Dcapability.status.datastore_v3.write
. Lassen Sie das Sternchen bei den anderen Funktionen stehen.
Im nachstehenden Screenshot ist zu sehen, dass zwei Funktionen (Datenspeicher und Bilder) über die Befehlszeile deaktiviert wurden:

- Klicken Sie auf Anwenden, um die Änderungen zu speichern.
- Klicken Sie auf Fehler beheben, um die Anwendung mit diesen Einstellungen auszuführen.
(Dienst)-Namen von Funktionen
Funktionsname in der API |
In der Konsole angezeigter Funktionsname |
Beschreibung |
blobstore |
BLOBSTORE |
Blobstore-Dienst |
datastore_v3 |
DATASTORE |
Datenspeicherdienst für Abfragen |
datastore_v3,write |
DATASTORE_WRITE |
Datenspeicherdienst für Schreibanfragen |
images |
IMAGES |
Bilderdienst |
mail |
MAIL |
E-Mail-Dienst |
memcache |
MEMCACHE |
Memcache-Dienst |
taskqueue |
TASKQUEUE |
TaskQueue-Dienst |
urlfetch |
URLFETCH |
URL-Abrufdienst |
Funktionsstatuswerte
Statuswerte für alle Funktionen |
Beschreibung |
DISABLED |
Die Funktion ist deaktiviert. |
ENABLED |
Die Funktion ist verfügbar und derzeit ist keine Wartung geplant. |
SCHEDULED_MAINTENANCE |
Die Funktion ist verfügbar, aber zur Wartung vorgesehen. |
UNKNOWN |
Der Status dieses Dienstes ist unbekannt. |
Funktionsstatus über die Capabilities API ändern
Verwenden Sie die Klasse LocalCapabilitiesServiceTestConfig, um den Funktionstest für lokale Dienste in der API auszuführen. Weitere Informationen und ein Codebeispiel finden Sie unter Funktionstests für lokale Dienste schreiben.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-09-04 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThe capabilities test feature allows you to modify the status of App Engine services (like datastore and blobstore) on the development web server to test how your application handles different service states.\u003c/p\u003e\n"],["\u003cp\u003eYou can change the status of services using the console by accessing \u003ccode\u003e/_ah/admin\u003c/code\u003e on your development server and navigating to the \u003cstrong\u003eCapabilities Status\u003c/strong\u003e page.\u003c/p\u003e\n"],["\u003cp\u003eEclipse users can adjust capability statuses by adding specific VM arguments in the \u003cstrong\u003eDebug Configurations\u003c/strong\u003e dialog, allowing you to disable or change the status of services such as \u003ccode\u003edatastore_v3.write\u003c/code\u003e or \u003ccode\u003eimages\u003c/code\u003e for testing.\u003c/p\u003e\n"],["\u003cp\u003eThe available capability status values are \u003ccode\u003eDISABLED\u003c/code\u003e, \u003ccode\u003eENABLED\u003c/code\u003e, \u003ccode\u003eSCHEDULED_MAINTENANCE\u003c/code\u003e, and \u003ccode\u003eUNKNOWN\u003c/code\u003e, providing various testing scenarios for service availability.\u003c/p\u003e\n"],["\u003cp\u003eThe LocalCapabilitiesServiceTestConfig class is available in the API to use the local service capabilities test feature.\u003c/p\u003e\n"]]],[],null,["# Capabilities Service Test Configuration\n\nThe capabilities test feature is designed to run against the App Engine [development web server](/appengine/docs/legacy/standard/java/tools/using-local-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.\n\nThere are several ways to use the capabilities test feature:\n\nChange Capabilities Status Using the Console\n--------------------------------------------\n\nTo change capabilities in the console,\n\n1. With your app running on the development server, access the console by visiting the URL `/_ah/admin` on your server, for example: \u003chttp://localhost:8888/_ah/admin\u003e.\n2. In the console, click **Capabilities Status** in the bottom left of the console.\n3. 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:\n\nThe services now reflect the settings you have chosen the next time your app accesses them. Run your app and observe its behavior.\n\nChange Capabilities Status Using the Command Line\n-------------------------------------------------\n\nIf you use Eclipse, you can set one or more capabilities using the debug command line options.\n\nTo change capability settings using the VM command line arguments in Eclipse\n\n1. With Eclipse open, select your project, right-click, then select **Debug As \\\u003e Debug Configurations**.\n2. Go to the **Arguments** tab and enter the desired option in the **VM arguments** textbox. The format of the option is\n\n `-Dcapability.status.`*capabilityname* `.*=`*statusname*\n , where *capabilityname* is replaced by the name of the service (see [Capability (Service) Names](#Capability_(Service)_Names)) and `statusname` is replaced by the capability status you want to use (see [Capability Status Values](#Capability_Status_Values)).\n\n \u003cbr /\u003e\n\n **Note:** For the datastore write capability, replace *capabilityname* with `datastore_v3` and the asterisk (`*`) with `write`, like this: `Dcapability.status.datastore_v3.write`. For the other capabilities, leave the asterisk as shown.\n\n The screen capture below shows two capabilities (datastore and images) being disabled from the command line:\n\n3. Click **Apply** to save your changes\n4. Click **Debug** to run your app with those settings.\n\n### Capability (Service) Names\n\n### Capability Status Values\n\nChange Capabilities Status Using the Capabilities API\n-----------------------------------------------------\n\nTo use the local service capabilities test feature in the API, you use the [LocalCapabilitiesServiceTestConfig](/appengine/docs/legacy/standard/java/tools/localunittesting/javadoc/com/google/appengine/tools/development/testing/LocalCapabilitiesServiceTestConfig) class. For more information and a code sample, see [Writing Local Service Capabilities Tests](/appengine/docs/legacy/standard/java/tools/localunittesting#capabilities-testing)."]]