Azure Developer Loadtesting Samples client library for Java
This document explains samples and how to use them.
Examples
Following section document various examples.
Hello World Samples
- HelloWorld.java - Contains samples for following scenarios:
- Authenticate client
- Create Load Test
- Upload Test File
- Clone Load Test
- Create and start Test Run, and get metrics
- Generate and get actionable insights
- Create and start Test Run, and get metrics
List Operations Samples
- ListOperations.java and ListOperationsAsync.java - Contains samples for following scenarios:
- List Load Tests
- List Test Runs
- List Load Test files
- List Triggers
- List Notification Rules
Trigger Operations Samples
- TriggerOperations.java - Contains samples for following scenarios:
- Create or Update a Trigger
- Get a Trigger
- List Triggers
- Delete a Trigger
Notification Rule Operations Samples
- NotificationRuleOperations.java - Contains samples for following scenarios:
- Create or Update a Notification Rule
- Get a Notification Rule
- List Notification Rules
- Delete a Notification Rule
Long Running Operations Samples
- LongRunningOperations.java and LongRunningOperationsAsync.java - Contains samples for following scenarios:
- Upload and validate Load Test file
- Start and monitor Test Run
Troubleshooting
General
Load Testing clients raise exceptions. For example, if you try to get a load test or test run resource after it is deleted a 404 error is returned, indicating resource not found. In the following snippet, the error is handled gracefully by catching the exception and displaying additional information about the error.
try {
testRunClient.getTestRunWithResponse("FAKE_TEST_RUN_ID", null);
} catch (ResourceNotFoundException e) {
System.out.println(e.getMessage());
}