All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartbear.readyapi.client.teststeps.datasource.ExcelDataSourceBuilder Maven / Gradle / Ivy

Go to download

Java client library for creating and executing test recipes against Ready!API TestServer

The newest version!
package com.smartbear.readyapi.client.teststeps.datasource;

import com.smartbear.readyapi.client.model.DataSource;
import com.smartbear.readyapi.client.model.ExcelDataSource;

import java.util.ArrayList;
import java.util.List;

public class ExcelDataSourceBuilder implements DataSourceBuilder {
    private ExcelDataSource excelDataSource = new ExcelDataSource();
    private List properties = new ArrayList<>();

    public ExcelDataSourceBuilder addProperty(String propertyName) {
        properties.add(propertyName);
        return this;
    }

    public ExcelDataSourceBuilder withFilePath(String filePath) {
        excelDataSource.setFile(filePath);
        return this;
    }

    public ExcelDataSourceBuilder withWorksheet(String worksheet) {
        excelDataSource.setWorksheet(worksheet);
        return this;
    }

    public ExcelDataSourceBuilder startAtCell(String cell) {
        excelDataSource.setStartAtCell(cell);
        return this;
    }

    public ExcelDataSourceBuilder ignoreEmpty() {
        excelDataSource.setIgnoreEmpty(true);
        return this;
    }

    @Override
    public DataSource build() {
        DataSource dataSource = new DataSource();
        dataSource.setProperties(properties);
        dataSource.setExcel(excelDataSource);
        return dataSource;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy