- 0.64.0 (latest)
- 0.63.0
- 0.62.0
- 0.60.0
- 0.59.0
- 0.58.0
- 0.57.0
- 0.56.0
- 0.55.0
- 0.54.0
- 0.53.0
- 0.52.0
- 0.51.0
- 0.50.0
- 0.48.0
- 0.47.0
- 0.46.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.41.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.7
- 0.13.1
- 0.12.1
- 0.11.5
public class TestCasesClient implements BackgroundResource
Service Description: Service for managing Test Cases and Test Case Results.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
testCasesClient.batchDeleteTestCases(parent);
}
Note: close() needs to be called on the TestCasesClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of TestCasesSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
TestCasesSettings testCasesSettings =
TestCasesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TestCasesClient testCasesClient = TestCasesClient.create(testCasesSettings);
To customize the endpoint:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
TestCasesSettings testCasesSettings =
TestCasesSettings.newBuilder().setEndpoint(myEndpoint).build();
TestCasesClient testCasesClient = TestCasesClient.create(testCasesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final TestCasesClient create()
Constructs an instance of TestCasesClient with default settings.
Type | Description |
TestCasesClient |
Type | Description |
IOException |
create(TestCasesSettings settings)
public static final TestCasesClient create(TestCasesSettings settings)
Constructs an instance of TestCasesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | TestCasesSettings |
Type | Description |
TestCasesClient |
Type | Description |
IOException |
create(TestCasesStub stub)
public static final TestCasesClient create(TestCasesStub stub)
Constructs an instance of TestCasesClient, using the given stub for making calls. This is for advanced usage - prefer using create(TestCasesSettings).
Name | Description |
stub | TestCasesStub |
Type | Description |
TestCasesClient |
Constructors
TestCasesClient(TestCasesSettings settings)
protected TestCasesClient(TestCasesSettings settings)
Constructs an instance of TestCasesClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings | TestCasesSettings |
TestCasesClient(TestCasesStub stub)
protected TestCasesClient(TestCasesStub stub)
Name | Description |
stub | TestCasesStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
batchDeleteTestCases(AgentName parent)
public final void batchDeleteTestCases(AgentName parent)
Batch deletes test cases.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
testCasesClient.batchDeleteTestCases(parent);
}
Name | Description |
parent | AgentName Required. The agent to delete test cases from. Format: |
batchDeleteTestCases(BatchDeleteTestCasesRequest request)
public final void batchDeleteTestCases(BatchDeleteTestCasesRequest request)
Batch deletes test cases.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchDeleteTestCasesRequest request =
BatchDeleteTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.addAllNames(new ArrayList<String>())
.build();
testCasesClient.batchDeleteTestCases(request);
}
Name | Description |
request | BatchDeleteTestCasesRequest The request object containing all of the parameters for the API call. |
batchDeleteTestCases(String parent)
public final void batchDeleteTestCases(String parent)
Batch deletes test cases.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
testCasesClient.batchDeleteTestCases(parent);
}
Name | Description |
parent | String Required. The agent to delete test cases from. Format: |
batchDeleteTestCasesCallable()
public final UnaryCallable<BatchDeleteTestCasesRequest,Empty> batchDeleteTestCasesCallable()
Batch deletes test cases.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchDeleteTestCasesRequest request =
BatchDeleteTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<Empty> future = testCasesClient.batchDeleteTestCasesCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<BatchDeleteTestCasesRequest,Empty> |
batchRunTestCasesAsync(BatchRunTestCasesRequest request)
public final OperationFuture<BatchRunTestCasesResponse,BatchRunTestCasesMetadata> batchRunTestCasesAsync(BatchRunTestCasesRequest request)
Kicks off a batch run of test cases.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
BatchRunTestCasesMetadata -
response
:
BatchRunTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchRunTestCasesRequest request =
BatchRunTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.addAllTestCases(new ArrayList<String>())
.build();
BatchRunTestCasesResponse response = testCasesClient.batchRunTestCasesAsync(request).get();
}
Name | Description |
request | BatchRunTestCasesRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<BatchRunTestCasesResponse,BatchRunTestCasesMetadata> |
batchRunTestCasesCallable()
public final UnaryCallable<BatchRunTestCasesRequest,Operation> batchRunTestCasesCallable()
Kicks off a batch run of test cases.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
BatchRunTestCasesMetadata -
response
:
BatchRunTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchRunTestCasesRequest request =
BatchRunTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.addAllTestCases(new ArrayList<String>())
.build();
ApiFuture<Operation> future = testCasesClient.batchRunTestCasesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<BatchRunTestCasesRequest,Operation> |
batchRunTestCasesOperationCallable()
public final OperationCallable<BatchRunTestCasesRequest,BatchRunTestCasesResponse,BatchRunTestCasesMetadata> batchRunTestCasesOperationCallable()
Kicks off a batch run of test cases.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
BatchRunTestCasesMetadata -
response
:
BatchRunTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchRunTestCasesRequest request =
BatchRunTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.addAllTestCases(new ArrayList<String>())
.build();
OperationFuture<BatchRunTestCasesResponse, BatchRunTestCasesMetadata> future =
testCasesClient.batchRunTestCasesOperationCallable().futureCall(request);
// Do something.
BatchRunTestCasesResponse response = future.get();
}
Type | Description |
OperationCallable<BatchRunTestCasesRequest,BatchRunTestCasesResponse,BatchRunTestCasesMetadata> |
calculateCoverage(CalculateCoverageRequest request)
public final CalculateCoverageResponse calculateCoverage(CalculateCoverageRequest request)
Calculates the test coverage for an agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
CalculateCoverageRequest request =
CalculateCoverageRequest.newBuilder()
.setAgent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
CalculateCoverageResponse response = testCasesClient.calculateCoverage(request);
}
Name | Description |
request | CalculateCoverageRequest The request object containing all of the parameters for the API call. |
Type | Description |
CalculateCoverageResponse |
calculateCoverageCallable()
public final UnaryCallable<CalculateCoverageRequest,CalculateCoverageResponse> calculateCoverageCallable()
Calculates the test coverage for an agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
CalculateCoverageRequest request =
CalculateCoverageRequest.newBuilder()
.setAgent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
ApiFuture<CalculateCoverageResponse> future =
testCasesClient.calculateCoverageCallable().futureCall(request);
// Do something.
CalculateCoverageResponse response = future.get();
}
Type | Description |
UnaryCallable<CalculateCoverageRequest,CalculateCoverageResponse> |
close()
public final void close()
createTestCase(AgentName parent, TestCase testCase)
public final TestCase createTestCase(AgentName parent, TestCase testCase)
Creates a test case for the given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
TestCase testCase = TestCase.newBuilder().build();
TestCase response = testCasesClient.createTestCase(parent, testCase);
}
Name | Description |
parent | AgentName Required. The agent to create the test case for. Format: |
testCase | TestCase Required. The test case to create. |
Type | Description |
TestCase |
createTestCase(CreateTestCaseRequest request)
public final TestCase createTestCase(CreateTestCaseRequest request)
Creates a test case for the given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
CreateTestCaseRequest request =
CreateTestCaseRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setTestCase(TestCase.newBuilder().build())
.build();
TestCase response = testCasesClient.createTestCase(request);
}
Name | Description |
request | CreateTestCaseRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestCase |
createTestCase(String parent, TestCase testCase)
public final TestCase createTestCase(String parent, TestCase testCase)
Creates a test case for the given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
TestCase testCase = TestCase.newBuilder().build();
TestCase response = testCasesClient.createTestCase(parent, testCase);
}
Name | Description |
parent | String Required. The agent to create the test case for. Format: |
testCase | TestCase Required. The test case to create. |
Type | Description |
TestCase |
createTestCaseCallable()
public final UnaryCallable<CreateTestCaseRequest,TestCase> createTestCaseCallable()
Creates a test case for the given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
CreateTestCaseRequest request =
CreateTestCaseRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setTestCase(TestCase.newBuilder().build())
.build();
ApiFuture<TestCase> future = testCasesClient.createTestCaseCallable().futureCall(request);
// Do something.
TestCase response = future.get();
}
Type | Description |
UnaryCallable<CreateTestCaseRequest,TestCase> |
exportTestCasesAsync(ExportTestCasesRequest request)
public final OperationFuture<ExportTestCasesResponse,ExportTestCasesMetadata> exportTestCasesAsync(ExportTestCasesRequest request)
Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
ExportTestCasesMetadata -
response
:
ExportTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ExportTestCasesRequest request =
ExportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setFilter("filter-1274492040")
.build();
ExportTestCasesResponse response = testCasesClient.exportTestCasesAsync(request).get();
}
Name | Description |
request | ExportTestCasesRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<ExportTestCasesResponse,ExportTestCasesMetadata> |
exportTestCasesCallable()
public final UnaryCallable<ExportTestCasesRequest,Operation> exportTestCasesCallable()
Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
ExportTestCasesMetadata -
response
:
ExportTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ExportTestCasesRequest request =
ExportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setFilter("filter-1274492040")
.build();
ApiFuture<Operation> future = testCasesClient.exportTestCasesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<ExportTestCasesRequest,Operation> |
exportTestCasesOperationCallable()
public final OperationCallable<ExportTestCasesRequest,ExportTestCasesResponse,ExportTestCasesMetadata> exportTestCasesOperationCallable()
Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
ExportTestCasesMetadata -
response
:
ExportTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ExportTestCasesRequest request =
ExportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setFilter("filter-1274492040")
.build();
OperationFuture<ExportTestCasesResponse, ExportTestCasesMetadata> future =
testCasesClient.exportTestCasesOperationCallable().futureCall(request);
// Do something.
ExportTestCasesResponse response = future.get();
}
Type | Description |
OperationCallable<ExportTestCasesRequest,ExportTestCasesResponse,ExportTestCasesMetadata> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getSettings()
public final TestCasesSettings getSettings()
Type | Description |
TestCasesSettings |
getStub()
public TestCasesStub getStub()
Type | Description |
TestCasesStub |
getTestCase(GetTestCaseRequest request)
public final TestCase getTestCase(GetTestCaseRequest request)
Gets a test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseRequest request =
GetTestCaseRequest.newBuilder()
.setName(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.build();
TestCase response = testCasesClient.getTestCase(request);
}
Name | Description |
request | GetTestCaseRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestCase |
getTestCase(TestCaseName name)
public final TestCase getTestCase(TestCaseName name)
Gets a test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCaseName name = TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]");
TestCase response = testCasesClient.getTestCase(name);
}
Name | Description |
name | TestCaseName Required. The name of the testcase. Format: |
Type | Description |
TestCase |
getTestCase(String name)
public final TestCase getTestCase(String name)
Gets a test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
String name = TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString();
TestCase response = testCasesClient.getTestCase(name);
}
Name | Description |
name | String Required. The name of the testcase. Format: |
Type | Description |
TestCase |
getTestCaseCallable()
public final UnaryCallable<GetTestCaseRequest,TestCase> getTestCaseCallable()
Gets a test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseRequest request =
GetTestCaseRequest.newBuilder()
.setName(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.build();
ApiFuture<TestCase> future = testCasesClient.getTestCaseCallable().futureCall(request);
// Do something.
TestCase response = future.get();
}
Type | Description |
UnaryCallable<GetTestCaseRequest,TestCase> |
getTestCaseResult(GetTestCaseResultRequest request)
public final TestCaseResult getTestCaseResult(GetTestCaseResultRequest request)
Gets a test case result.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseResultRequest request =
GetTestCaseResultRequest.newBuilder()
.setName(
TestCaseResultName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]")
.toString())
.build();
TestCaseResult response = testCasesClient.getTestCaseResult(request);
}
Name | Description |
request | GetTestCaseResultRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestCaseResult |
getTestCaseResult(TestCaseResultName name)
public final TestCaseResult getTestCaseResult(TestCaseResultName name)
Gets a test case result.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCaseResultName name =
TestCaseResultName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]");
TestCaseResult response = testCasesClient.getTestCaseResult(name);
}
Name | Description |
name | TestCaseResultName Required. The name of the testcase. Format: |
Type | Description |
TestCaseResult |
getTestCaseResult(String name)
public final TestCaseResult getTestCaseResult(String name)
Gets a test case result.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
String name =
TestCaseResultName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]")
.toString();
TestCaseResult response = testCasesClient.getTestCaseResult(name);
}
Name | Description |
name | String Required. The name of the testcase. Format: |
Type | Description |
TestCaseResult |
getTestCaseResultCallable()
public final UnaryCallable<GetTestCaseResultRequest,TestCaseResult> getTestCaseResultCallable()
Gets a test case result.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseResultRequest request =
GetTestCaseResultRequest.newBuilder()
.setName(
TestCaseResultName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]")
.toString())
.build();
ApiFuture<TestCaseResult> future =
testCasesClient.getTestCaseResultCallable().futureCall(request);
// Do something.
TestCaseResult response = future.get();
}
Type | Description |
UnaryCallable<GetTestCaseResultRequest,TestCaseResult> |
importTestCasesAsync(ImportTestCasesRequest request)
public final OperationFuture<ImportTestCasesResponse,ImportTestCasesMetadata> importTestCasesAsync(ImportTestCasesRequest request)
Imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
ImportTestCasesMetadata -
response
:
ImportTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ImportTestCasesRequest request =
ImportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
ImportTestCasesResponse response = testCasesClient.importTestCasesAsync(request).get();
}
Name | Description |
request | ImportTestCasesRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<ImportTestCasesResponse,ImportTestCasesMetadata> |
importTestCasesCallable()
public final UnaryCallable<ImportTestCasesRequest,Operation> importTestCasesCallable()
Imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
ImportTestCasesMetadata -
response
:
ImportTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ImportTestCasesRequest request =
ImportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
ApiFuture<Operation> future = testCasesClient.importTestCasesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<ImportTestCasesRequest,Operation> |
importTestCasesOperationCallable()
public final OperationCallable<ImportTestCasesRequest,ImportTestCasesResponse,ImportTestCasesMetadata> importTestCasesOperationCallable()
Imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
:
ImportTestCasesMetadata -
response
:
ImportTestCasesResponse
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ImportTestCasesRequest request =
ImportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
OperationFuture<ImportTestCasesResponse, ImportTestCasesMetadata> future =
testCasesClient.importTestCasesOperationCallable().futureCall(request);
// Do something.
ImportTestCasesResponse response = future.get();
}
Type | Description |
OperationCallable<ImportTestCasesRequest,ImportTestCasesResponse,ImportTestCasesMetadata> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listTestCaseResults(ListTestCaseResultsRequest request)
public final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(ListTestCaseResultsRequest request)
Fetches a list of results for a given test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCaseResultsRequest request =
ListTestCaseResultsRequest.newBuilder()
.setParent(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (TestCaseResult element : testCasesClient.listTestCaseResults(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListTestCaseResultsRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestCasesClient.ListTestCaseResultsPagedResponse |
listTestCaseResults(TestCaseName parent)
public final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(TestCaseName parent)
Fetches a list of results for a given test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCaseName parent = TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]");
for (TestCaseResult element : testCasesClient.listTestCaseResults(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | TestCaseName Required. The test case to list results for. Format: |
Type | Description |
TestCasesClient.ListTestCaseResultsPagedResponse |
listTestCaseResults(String parent)
public final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(String parent)
Fetches a list of results for a given test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent =
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString();
for (TestCaseResult element : testCasesClient.listTestCaseResults(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The test case to list results for. Format: |
Type | Description |
TestCasesClient.ListTestCaseResultsPagedResponse |
listTestCaseResultsCallable()
public final UnaryCallable<ListTestCaseResultsRequest,ListTestCaseResultsResponse> listTestCaseResultsCallable()
Fetches a list of results for a given test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCaseResultsRequest request =
ListTestCaseResultsRequest.newBuilder()
.setParent(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListTestCaseResultsResponse response =
testCasesClient.listTestCaseResultsCallable().call(request);
for (TestCaseResult element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListTestCaseResultsRequest,ListTestCaseResultsResponse> |
listTestCaseResultsPagedCallable()
public final UnaryCallable<ListTestCaseResultsRequest,TestCasesClient.ListTestCaseResultsPagedResponse> listTestCaseResultsPagedCallable()
Fetches a list of results for a given test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCaseResultsRequest request =
ListTestCaseResultsRequest.newBuilder()
.setParent(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<TestCaseResult> future =
testCasesClient.listTestCaseResultsPagedCallable().futureCall(request);
// Do something.
for (TestCaseResult element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListTestCaseResultsRequest,ListTestCaseResultsPagedResponse> |
listTestCases(AgentName parent)
public final TestCasesClient.ListTestCasesPagedResponse listTestCases(AgentName parent)
Fetches a list of test cases for a given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
for (TestCase element : testCasesClient.listTestCases(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | AgentName Required. The agent to list all pages for. Format: |
Type | Description |
TestCasesClient.ListTestCasesPagedResponse |
listTestCases(ListTestCasesRequest request)
public final TestCasesClient.ListTestCasesPagedResponse listTestCases(ListTestCasesRequest request)
Fetches a list of test cases for a given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCasesRequest request =
ListTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (TestCase element : testCasesClient.listTestCases(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListTestCasesRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestCasesClient.ListTestCasesPagedResponse |
listTestCases(String parent)
public final TestCasesClient.ListTestCasesPagedResponse listTestCases(String parent)
Fetches a list of test cases for a given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
for (TestCase element : testCasesClient.listTestCases(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The agent to list all pages for. Format: |
Type | Description |
TestCasesClient.ListTestCasesPagedResponse |
listTestCasesCallable()
public final UnaryCallable<ListTestCasesRequest,ListTestCasesResponse> listTestCasesCallable()
Fetches a list of test cases for a given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCasesRequest request =
ListTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListTestCasesResponse response = testCasesClient.listTestCasesCallable().call(request);
for (TestCase element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListTestCasesRequest,ListTestCasesResponse> |
listTestCasesPagedCallable()
public final UnaryCallable<ListTestCasesRequest,TestCasesClient.ListTestCasesPagedResponse> listTestCasesPagedCallable()
Fetches a list of test cases for a given agent.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCasesRequest request =
ListTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<TestCase> future = testCasesClient.listTestCasesPagedCallable().futureCall(request);
// Do something.
for (TestCase element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListTestCasesRequest,ListTestCasesPagedResponse> |
runTestCaseAsync(RunTestCaseRequest request)
public final OperationFuture<RunTestCaseResponse,RunTestCaseMetadata> runTestCaseAsync(RunTestCaseRequest request)
Kicks off a test case run.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: RunTestCaseMetadata
response
: RunTestCaseResponseSample code:
// This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (TestCasesClient testCasesClient = TestCasesClient.create()) { RunTestCaseRequest request = RunTestCaseRequest.newBuilder() .setName( TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) .setEnvironment( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) .build(); RunTestCaseResponse response = testCasesClient.runTestCaseAsync(request).get(); }
Name | Description |
request | RunTestCaseRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<RunTestCaseResponse,RunTestCaseMetadata> |
runTestCaseCallable()
public final UnaryCallable<RunTestCaseRequest,Operation> runTestCaseCallable()
Kicks off a test case run.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: RunTestCaseMetadata
response
: RunTestCaseResponseSample code:
// This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (TestCasesClient testCasesClient = TestCasesClient.create()) { RunTestCaseRequest request = RunTestCaseRequest.newBuilder() .setName( TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) .setEnvironment( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) .build(); ApiFuture<Operation> future = testCasesClient.runTestCaseCallable().futureCall(request); // Do something. Operation response = future.get(); }
Type | Description |
UnaryCallable<RunTestCaseRequest,Operation> |
runTestCaseOperationCallable()
public final OperationCallable<RunTestCaseRequest,RunTestCaseResponse,RunTestCaseMetadata> runTestCaseOperationCallable()
Kicks off a test case run.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: RunTestCaseMetadata
response
: RunTestCaseResponseSample code:
// This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (TestCasesClient testCasesClient = TestCasesClient.create()) { RunTestCaseRequest request = RunTestCaseRequest.newBuilder() .setName( TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) .setEnvironment( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) .build(); OperationFuture<RunTestCaseResponse, RunTestCaseMetadata> future = testCasesClient.runTestCaseOperationCallable().futureCall(request); // Do something. RunTestCaseResponse response = future.get(); }
Type | Description |
OperationCallable<RunTestCaseRequest,RunTestCaseResponse,RunTestCaseMetadata> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateTestCase(TestCase testCase, FieldMask updateMask)
public final TestCase updateTestCase(TestCase testCase, FieldMask updateMask)
Updates the specified test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCase testCase = TestCase.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
TestCase response = testCasesClient.updateTestCase(testCase, updateMask);
}
Name | Description |
testCase | TestCase Required. The test case to update. |
updateMask | FieldMask Required. The mask to specify which fields should be updated. The
|
Type | Description |
TestCase |
updateTestCase(UpdateTestCaseRequest request)
public final TestCase updateTestCase(UpdateTestCaseRequest request)
Updates the specified test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
UpdateTestCaseRequest request =
UpdateTestCaseRequest.newBuilder()
.setTestCase(TestCase.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
TestCase response = testCasesClient.updateTestCase(request);
}
Name | Description |
request | UpdateTestCaseRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestCase |
updateTestCaseCallable()
public final UnaryCallable<UpdateTestCaseRequest,TestCase> updateTestCaseCallable()
Updates the specified test case.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (TestCasesClient testCasesClient = TestCasesClient.create()) {
UpdateTestCaseRequest request =
UpdateTestCaseRequest.newBuilder()
.setTestCase(TestCase.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<TestCase> future = testCasesClient.updateTestCaseCallable().futureCall(request);
// Do something.
TestCase response = future.get();
}
Type | Description |
UnaryCallable<UpdateTestCaseRequest,TestCase> |