org.easetech.easytest.loader
Interface Loader

All Known Implementing Classes:
CSVDataLoader, EmptyLoader, ExcelDataLoader, XMLDataLoader

public interface Loader

An interface for different types of loader. This would ultimately be used by the users of EasyTest as well to provide their custom Loaders. Currently, EasyTest supports three Loaders internally :

  • ExcelDataLoader - To load data from XLS files
  • XMLDataLoader - To load data from XML files. Look at the Schema for XML at : https://github.com/EaseTech/easytest-core/blob/master/src/main/resources/testDataSchema.xsd
  • CSVDataLoader - To load data from a CSV file In addition users can define their own custom Loaders and use them in their test classes by specifying the LoaderType.CUSTOM loader type in their DataLoader annotation

    Author:
    Anuj Kumar

    Field Summary
    static String ACTUAL_RESULT
              The key identifying the actual output result that needs to be written to the file.
    static String AMPERSAND
              The ampersand sign
    static String COMMA
              Comma
    static String DOUBLE_QUOTE
              Double Quote String
    static String DURATION
              The key identifying the Test Duration in milli seconds
    static String EMPTY_STRING
              Constant for empty string
    static String EXPECTED_RESULT
              The key identifying the expected output that needs to be compared with actual result
    static String SINGLE_QUOTE
              Single Quote
    static String TEST_FAILED
               
    static String TEST_PASSED
              The constants for test status PASSED/FAILED
    static String TEST_STATUS
              The key identifying the Test Status either PASSED/FAILED determined after comparing expected and actual results, and written to the file.
     
    Method Summary
     Map<String,List<Map<String,Object>>> loadData(Resource resource)
              Method responsible to Load the test data from the list of files passed as parameter
     void writeData(Resource resource, Map<String,List<Map<String,Object>>> actualData, String... methodNames)
              Method responsible for writing the test data and actual result back to the file
     

    Field Detail

    ACTUAL_RESULT

    static final String ACTUAL_RESULT
    The key identifying the actual output result that needs to be written to the file.

    See Also:
    Constant Field Values

    EXPECTED_RESULT

    static final String EXPECTED_RESULT
    The key identifying the expected output that needs to be compared with actual result

    See Also:
    Constant Field Values

    EMPTY_STRING

    static final String EMPTY_STRING
    Constant for empty string

    See Also:
    Constant Field Values

    DOUBLE_QUOTE

    static final String DOUBLE_QUOTE
    Double Quote String

    See Also:
    Constant Field Values

    SINGLE_QUOTE

    static final String SINGLE_QUOTE
    Single Quote

    See Also:
    Constant Field Values

    AMPERSAND

    static final String AMPERSAND
    The ampersand sign

    See Also:
    Constant Field Values

    COMMA

    static final String COMMA
    Comma

    See Also:
    Constant Field Values

    TEST_STATUS

    static final String TEST_STATUS
    The key identifying the Test Status either PASSED/FAILED determined after comparing expected and actual results, and written to the file.

    See Also:
    Constant Field Values

    DURATION

    static final String DURATION
    The key identifying the Test Duration in milli seconds

    See Also:
    Constant Field Values

    TEST_PASSED

    static final String TEST_PASSED
    The constants for test status PASSED/FAILED

    See Also:
    Constant Field Values

    TEST_FAILED

    static final String TEST_FAILED
    See Also:
    Constant Field Values
    Method Detail

    loadData

    Map<String,List<Map<String,Object>>> loadData(Resource resource)
    Method responsible to Load the test data from the list of files passed as parameter

    Parameters:
    resource - from which to load the data
    Returns:
    a Map consisting of the methodName as key and a List of Key/value pairs as the value of the Map. This is currently not a user friendly way of exposing the test data.

    writeData

    void writeData(Resource resource,
                   Map<String,List<Map<String,Object>>> actualData,
                   String... methodNames)
    Method responsible for writing the test data and actual result back to the file

    Parameters:
    resource - the resource to which data needs to be written
    methodNames - the names of the method to write the data for
    actualData - a Map consisting of the methodName as key and a List of Key/value pairs as the value of the Map. This Map contains the input as well as output data This is currently not a user friendly way of exposing the test data.


    Copyright © 2013. All Rights Reserved.