public class DDDriverRestCommands
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RESTCLEANRESPONSEMAP_KEYWORD
"RestCleanResponseMap"
|
static java.lang.String |
RESTDELETERESPONSE_KEYWORD
"RestDeleteResponse"
|
static java.lang.String |
RESTDELETERESPONSESTORE_KEYWORD
"RestDeleteResponseStore"
|
static java.lang.String |
RESTHEADERSLOAD_KEYWORD
"RestHeadersLoad"
|
static java.lang.String |
RESTSTORERESPONSE_KEYWORD
"RestStoreResponse"
|
static java.lang.String |
RESTVERIFYRESPONSE_KEYWORD
"RestVerifyResponse"
|
static java.lang.String |
RESTVERIFYRESPONSECONTAINS_KEYWORD
"RestVerifyResponseContains"
|
Modifier and Type | Method and Description |
---|---|
static DDDriverRestCommands |
getInstance()
public Singleton to access class static methods via instance
|
static DriverCommand |
restCleanResponseMap(java.lang.String responseID)
Delete REST response (and request if it is stored) from the internal Map.
|
static DriverCommand |
restDeleteResponse(java.lang.String responseID)
Delete a REST response (and request if stored) from the persistent storages.
|
static DriverCommand |
restDeleteResponseStore()
Delete ALL REST responses (and requests if stored) from the persistent storages.
|
static DriverCommand |
restHeadersLoad(java.lang.String[] parameters)
Load headers from a file.
|
static DriverCommand |
restHeadersLoad(java.lang.String headersFile,
java.lang.String method,
java.lang.String type)
Load headers from a file.
|
static DriverCommand |
restStoreResponse(java.lang.String[] parameters)
Save a REST response into a persistent storage.
|
static DriverCommand |
restStoreResponse(java.lang.String responseID,
java.lang.String variablePrefix,
java.lang.String storeRequest,
java.lang.String persistenceType,
java.lang.String fileType)
Save a REST response into a persistent storage.
|
static DriverCommand |
restVerifyResponse(java.lang.String[] parameters)
Verify a REST response is what is expected.
|
static DriverCommand |
restVerifyResponse(java.lang.String responseID,
java.lang.String benchFile,
java.lang.String fileType,
java.lang.String result,
java.lang.String verifyRequest,
java.lang.String valueContains,
java.lang.String valueCaseSensitive)
Verify a REST response is what is expected.
|
static DriverCommand |
restVerifyResponseContains(java.lang.String[] parameters)
Verify a REST response contains what is expected.
|
static DriverCommand |
restVerifyResponseContains(java.lang.String responseID,
java.lang.String benchFile,
java.lang.String fileType,
java.lang.String result,
java.lang.String verifyRequest,
java.lang.String valueContains,
java.lang.String valueCaseSensitive)
Verify a REST response contains what is expected.
|
public static final java.lang.String RESTCLEANRESPONSEMAP_KEYWORD
public static final java.lang.String RESTDELETERESPONSE_KEYWORD
public static final java.lang.String RESTDELETERESPONSESTORE_KEYWORD
public static final java.lang.String RESTHEADERSLOAD_KEYWORD
public static final java.lang.String RESTSTORERESPONSE_KEYWORD
public static final java.lang.String RESTVERIFYRESPONSE_KEYWORD
public static final java.lang.String RESTVERIFYRESPONSECONTAINS_KEYWORD
public static DDDriverRestCommands getInstance()
public static DriverCommand restCleanResponseMap(java.lang.String responseID)
Delete REST response (and request if it is stored) from the internal Map. Delete a REST response (and request if it is stored) from the internal Map. The REST response/request is stored internally in a Map of pair (responsID, Response). BE CAREFUL WHNE CALLING THIS KEYWORD! It will clean Response from internal Map, and can cause other keyword failing to work.Supporting Engines:
responseID
- Optional:YES
The ID used to delete Response Object from internal Map.public static DriverCommand restDeleteResponse(java.lang.String responseID)
Delete a REST response (and request if stored) from the persistent storages. Delete a REST response (and request if stored) from the persistent storages. The REST response/request is supposed to be in the persistent storages. The response/request can be in more than one type of persistence storage, and it can be a series of variables, a file or something else, please refer to explanation of parameters of keyword RestStoreResponse. For example, if the Response/Request is stored be in a XML file, a JSON file and "a series of variables" at the same time, then this keyword will delete all of them (XML file, JSON file and variables).Supporting Engines:
responseID
- Optional:NO
The ID of the Response/Request (stored in persistence storages) to be deleted.public static DriverCommand restDeleteResponseStore()
Delete ALL REST responses (and requests if stored) from the persistent storages. Delete ALL REST responses (and requests if stored) from the persistent storages. The REST response/request is supposed to be in the persistent storages. The response/request can be in more than one type of persistence storage, and it can be a series of variables, a file or something else, please refer to explanation of parameters of keyword RestStoreResponse. For example, if there are 2 Responses/Requests have been persisted, one is stored be in a XML file, a JSON file and "a series of variables" at the same time, the other is stored in JSON file and "a series of variables", then this keyword will delete all of them (XML file, JSON file and variables of the first Response/Request, JSON file and "a series of variables" of the second Response/Request).Supporting Engines:
public static DriverCommand restHeadersLoad(java.lang.String headersFile, java.lang.String method, java.lang.String type)
Load headers from a file. This might be called before invoking a REST action, like RESTGetXML etc. And the loaded headers will be used when executing that REST action if no headers are provided as parameter of that REST action.Supporting Engines:
headersFile
- Optional:NO
The path to file holding headers information.method
- Optional:YES
The method is used to load the "headers" from a file.
If this parameter is not provided, then "headers" of all methods will be loaded.type
- Optional:YES
The type is used to load the "headers" from a file.
If this parameter is not provided, then "headers" of all types will be loaded.public static DriverCommand restHeadersLoad(java.lang.String[] parameters)
Load headers from a file. This might be called before invoking a REST action, like RESTGetXML etc. And the loaded headers will be used when executing that REST action if no headers are provided as parameter of that REST action.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand restStoreResponse(java.lang.String responseID, java.lang.String variablePrefix, java.lang.String storeRequest, java.lang.String persistenceType, java.lang.String fileType)
Save a REST response into a persistent storage. Retrieve a REST response according to the responseID, and store the response into a persistent storage. The persistent storage can be a series of variables, a file or something else, please refer to explanation of parameters.Supporting Engines:
responseID
- Optional:NO
The ID used to retrieve Response Object from internal Map.variablePrefix
- Optional:NO
The prefix of the variables to store the information of a REST response/request if parameter persistenceType is VARIABLE.
Or the file name holding the information of a REST response/request if parameter persistenceType is FILE.storeRequest
- Optional:YES DefaultVal:FalseStore the originating Request information if this parameter is true. The default value is false.persistenceType
- Optional:YES DefaultVal:VARIABLEThe type of the persistence storage to save the Response/Request information.fileType
- Optional:YES DefaultVal:JSONThe Type of file to save Response/Request, ONLY useful when persistenceType is "FILE"public static DriverCommand restStoreResponse(java.lang.String[] parameters)
Save a REST response into a persistent storage. Retrieve a REST response according to the responseID, and store the response into a persistent storage. The persistent storage can be a series of variables, a file or something else, please refer to explanation of parameters.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand restVerifyResponse(java.lang.String responseID, java.lang.String benchFile, java.lang.String fileType, java.lang.String result, java.lang.String verifyRequest, java.lang.String valueContains, java.lang.String valueCaseSensitive)
Verify a REST response is what is expected. Retrieve a REST response according to the responseID, and compare the response with the content stored in a bench file. The comparison should be defined by parameter verifyRequest, valueContains and valueCaseSensitive.Supporting Engines:
responseID
- Optional:NO
The ID used to retrieve Response Object from internal Map.benchFile
- Optional:NO
The bench file for verifying a REST response.fileType
- Optional:YES DefaultVal:JSONThe Type of file to save Response/Request, ONLY useful when persistenceType is "FILE"result
- Optional:YES DefaultVal:verifyRequest
- Optional:YES DefaultVal:FALSE
If it is true, then verify also the Request; otherwise only the Response will be verified.
The default value is 'false', which means only the Response will be verified.valueContains
- Optional:YES DefaultVal:FALSE
If true, then verify that Response/Request field's value contains that in benchFile;
Otherwise, then verify that Response/Request field's value matches wholly with that in benchFile;
The default value is false;valueCaseSensitive
- Optional:YES DefaultVal:TRUE
If true, then verify that Response/Request field's value matches case sensitively with that in benchFile;
Otherwise, then verify that Response/Request field's value matches case insensitively with that in benchFile;
The default value is true;public static DriverCommand restVerifyResponse(java.lang.String[] parameters)
Verify a REST response is what is expected. Retrieve a REST response according to the responseID, and compare the response with the content stored in a bench file. The comparison should be defined by parameter verifyRequest, valueContains and valueCaseSensitive.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand restVerifyResponseContains(java.lang.String responseID, java.lang.String benchFile, java.lang.String fileType, java.lang.String result, java.lang.String verifyRequest, java.lang.String valueContains, java.lang.String valueCaseSensitive)
Verify a REST response contains what is expected. Retrieve a REST response according to the responseID, and verify that the response contains the content stored in a bench file. The Contains in keyword RestVerifyResponseContains means the Response/Request contains the fields defined in the bench file, that is to say not all fields of Response/Request should be matched For the field's value, it should be defined by parameter valueContains and valueCaseSensitive.Supporting Engines:
responseID
- Optional:NO
The ID used to retrieve Response Object from internal Map.benchFile
- Optional:NO
The bench file for verifying a REST response.fileType
- Optional:YES DefaultVal:JSONThe Type of file to save Response/Request, ONLY useful when persistenceType is "FILE"result
- Optional:YES DefaultVal:verifyRequest
- Optional:YES DefaultVal:FALSE
If it is true, then verify also the Request; otherwise only the Response will be verified.
The default value is 'false', which means only the Response will be verified.valueContains
- Optional:YES DefaultVal:FALSE
If true, then verify that Response/Request field's value contains that in benchFile;
Otherwise, then verify that Response/Request field's value matches wholly with that in benchFile;
The default value is false;valueCaseSensitive
- Optional:YES DefaultVal:TRUE
If true, then verify that Response/Request field's value matches case sensitively with that in benchFile;
Otherwise, then verify that Response/Request field's value matches case insensitively with that in benchFile;
The default value is true;public static DriverCommand restVerifyResponseContains(java.lang.String[] parameters)
Verify a REST response contains what is expected. Retrieve a REST response according to the responseID, and verify that the response contains the content stored in a bench file. The Contains in keyword RestVerifyResponseContains means the Response/Request contains the fields defined in the bench file, that is to say not all fields of Response/Request should be matched For the field's value, it should be defined by parameter valueContains and valueCaseSensitive.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
Copyright © SAS Institute. All Rights Reserved.