Konfigurasi Uji Layanan Kemampuan
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Fitur pengujian kemampuan dirancang untuk dijalankan terhadap server web pengembangan App Engine untuk tujuan pengujian. Dengan alat ini, Anda dapat mengubah status layanan, seperti datastore, blobstore, dll., untuk menentukan apakah aplikasi Anda berperilaku dengan baik saat menemukan berbagai kemungkinan status layanan. Misalnya, dengan mengubah status layanan datastore menjadi nonaktif, Anda dapat menguji apakah aplikasi menangani ketidaktersediaan datastore dengan cara yang baik.
Ada beberapa cara untuk menggunakan fitur pengujian kemampuan:
Mengubah Status Kemampuan Menggunakan Console
Untuk mengubah kemampuan di konsol,
- Saat aplikasi Anda berjalan di server pengembangan, akses konsol dengan mengunjungi URL
/_ah/admin
di server Anda, misalnya: http://localhost:8888/_ah/admin.
- Di konsol, klik Capabilities Status di kiri bawah konsol.
- Di halaman Konfigurasi Status Kemampuan, cari layanan yang digunakan oleh aplikasi Anda dan yang statusnya ingin Anda ubah; klik menu dropdown di samping nama layanan dan pilih status yang ingin Anda uji pada layanan tersebut:
Layanan tersebut kini mencerminkan setelan yang telah Anda pilih saat aplikasi Anda mengaksesnya lagi. Jalankan aplikasi Anda dan amati perilakunya.
Mengubah Status Kemampuan Menggunakan Command Line
Jika menggunakan Eclipse, Anda dapat menyetel satu atau beberapa kemampuan menggunakan opsi command line debug.
Untuk mengubah setelan kemampuan menggunakan argumen command line VM di Eclipse
- Setelah Eclipse terbuka, pilih project Anda, klik kanan, lalu pilih Debug As > Debug Configurations.
- Buka tab Arguments, lalu masukkan opsi yang diinginkan di kotak teks Argumen VM. Format pilihannya adalah
-Dcapability.status.capabilityname.*=statusname
, dengan capabilityname
diganti dengan nama layanan (lihat Nama Kemampuan (Layanan)) dan statusname
diganti dengan status kemampuan yang ingin Anda gunakan (lihat Kemampuan Nilai Status).
Catatan: Untuk kemampuan tulis datastore, ganti capabilityname
dengan datastore_v3
dan tanda bintang (*
) dengan write
, seperti ini: Dcapability.status.datastore_v3.write
. Untuk kemampuan lainnya, biarkan tanda bintang seperti yang ditunjukkan.
Screenshot di bawah ini menunjukkan dua kemampuan (datastore dan gambar) yang dinonaktifkan dari command line:

- Klik Terapkan untuk menyimpan perubahan.
- Klik Debug untuk menjalankan aplikasi dengan setelan tersebut.
Nama Kemampuan (Layanan)
Nama Kemampuan di API |
Nama Kemampuan ditampilkan di Console |
Deskripsi |
blobstore |
BLOBSTORE |
Layanan blobstore |
datastore_v3 |
DATASTORE |
Layanan datastore untuk kueri |
datastore_v3,write |
DATASTORE_WRITE |
Layanan datastore untuk permintaan tulis |
images |
GAMBAR |
Layanan gambar |
mail |
MAIL |
Layanan email |
memcache |
MEMCACHE |
Layanan memcache |
taskqueue |
TASKQUEUE |
Layanan taskqueue |
urlfetch |
URLFETCH |
Layanan urlfetch |
Nilai Status Kemampuan
Nilai Status untuk Semua Kemampuan |
Deskripsi |
DISABLED |
Kemampuan dinonaktifkan. |
ENABLED |
Kemampuan tersedia dan saat ini tidak ada rencana pemeliharaan. |
SCHEDULED_MAINTENANCE |
Kemampuan tersedia, tetapi dijadwalkan untuk pemeliharaan. |
UNKNOWN |
Status layanan ini tidak diketahui. |
Mengubah Status Kemampuan Menggunakan Capabilities API
Untuk menggunakan fitur pengujian kemampuan layanan lokal di API, gunakan class LocalCapabilitiesServiceTestConfig. Untuk mengetahui informasi selengkapnya dan contoh kode, lihat Menulis Pengujian Kemampuan Layanan Lokal.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-09-04 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]