Class TestTableBuilder


  • public class TestTableBuilder
    extends TableBuilder
    The class is responsible for creating test method tables in excel sheets. Given all necessary data (parameter names and titles, result column description, table being tested and testmethod name) it just creates a new table in the given sheet.
    Author:
    Aliaksandr Antonik, Andrei Astrouski
    • Constructor Detail

      • TestTableBuilder

        public TestTableBuilder​(XlsSheetGridModel gridModel)
        Creates new instance.
        Parameters:
        gridModel - represents interface for operations with excel sheets
    • Method Detail

      • getHeader

        public static String getHeader​(TableSyntaxNode executableNode,
                                       String technicalName)
        Returns table header.
        Parameters:
        executableNode - Executable node
        technicalName - Technical name of the table. If null or empty we get default technical name. It is building with table name and postfix 'Test'.
        Returns:
        table header
      • getDefaultTechnicalName

        public static String getDefaultTechnicalName​(TableSyntaxNode executableNode)
        Gets the default technical name for new test table. At first we get the executable method from TableSyntaxNode and if it is not null calls getDefaultTechnicalName(ExecutableMethod).
        Parameters:
        executableNode - TableSyntaxNode that is executable (see Executable)from which we tries to get the ExecutableRulesMethod.
        Returns:
        Default technical name for new test table. It is build from table name and postfix 'Test'.
      • getParams

        public static Map<String,​String> getParams​(TableSyntaxNode executableNode)
        Returns table parameters.
        Parameters:
        executableNode - Executable node
        Returns:
        table parameters
      • writeParams

        public void writeParams​(Map<String,​String> params,
                                String resultTitle)
        Writes test table parameters.
        Parameters:
        params - test table parameters
        resultTitle - result parameter title
        Throws:
        IllegalArgumentException - if params is null
        IllegalStateException - if method is called without prior beginTable() call