public class RestDataProvider extends CommonDataProvider implements DataInputProvider, DataOutputProvider
Modifier and Type | Class and Description |
---|---|
static class |
RestDataProvider.types |
CommonDataProvider.ResultColumnNames
DataProvider.type
columns, dataInPath, dataOutPath, indexData, resultColumnName, scenarioName
Constructor and Description |
---|
RestDataProvider(String type,
String host,
String port)
Constructor of REST DataProvider.
|
Modifier and Type | Method and Description |
---|---|
int |
getNbLines()
Gets the number of readable lines of current opened file.
|
void |
prepare(String scenario) |
String[] |
readLine(int line,
boolean readResult) |
String |
readValue(String column,
int line)
Reads a cell of opened input file.
|
protected void |
setHttpService(HttpService httpService)
HttpService setter for mock
|
protected void |
writeValue(String column,
int line,
String value)
Defines how to write values.
|
getIndexData, getModel, getNbGherkinExample, getResultColumnName, isResultColumnNameAuthorized, setDataInPath, setDataOutPath, setIndexData, writeDataResult, writeFailedResult, writeSuccessResult, writeWarningResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeDataResult, writeFailedResult, writeSuccessResult, writeWarningResult
getIndexData, getModel, getNbGherkinExample, getResultColumnName, isResultColumnNameAuthorized, setDataInPath, setDataOutPath, setIndexData
public RestDataProvider(String type, String host, String port) throws WebServicesException
type
- (JSON or XML).host
- is host of REST Web Services.port
- is port of REST Web Services.WebServicesException
- if technical Exception occurred but for a Web Services.public void prepare(String scenario) throws TechnicalException
prepare
in interface DataProvider
TechnicalException
public int getNbLines()
getNbLines
in interface DataInputProvider
public String readValue(String column, int line)
readValue
in interface DataInputProvider
column
- index of the column to readline
- index of the line to readpublic String[] readLine(int line, boolean readResult)
readLine
in interface DataInputProvider
line
- id of the line to read (line=0 for reading headers ; line=1 for reading 1st line, ...)readResult
- true if result must be returned, false otherwiseprotected void writeValue(String column, int line, String value)
writeValue
in class CommonDataProvider
column
- The column nameline
- The line numbervalue
- The value to writeprotected void setHttpService(HttpService httpService)
httpService
- The HTTP ServiceCopyright © 2023 NoraUi. All rights reserved.