Class TestTableBuilder
- java.lang.Object
-
- org.openl.rules.table.xls.builder.TableBuilder
-
- org.openl.rules.table.xls.builder.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
-
-
Field Summary
-
Fields inherited from class org.openl.rules.table.xls.builder.TableBuilder
HEADER_HEIGHT, PROPERTIES_MIN_WIDTH, TABLE_PROPERTIES
-
-
Constructor Summary
Constructors Constructor Description TestTableBuilder(XlsSheetGridModel gridModel)Creates new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetDefaultTechnicalName(TableSyntaxNode executableNode)Gets the default technical name for new test table.static StringgetHeader(TableSyntaxNode executableNode, String technicalName)Returns table header.static Map<String,String>getParams(TableSyntaxNode executableNode)Returns table parameters.voidwriteParams(Map<String,String> params, String resultTitle)Writes test table parameters.-
Methods inherited from class org.openl.rules.table.xls.builder.TableBuilder
beginTable, beginTable, endTable, getCurrentRow, getDefaultCellStyle, getDefaultDateCellStyle, getGridModel, getHeight, getTableRegion, getWidth, incCurrentRow, incCurrentRow, save, writeCell, writeCell, writeCell, writeGridTable, writeHeader, writeProperties
-
-
-
-
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 nodetechnicalName- Technical name of the table. Ifnullor 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 fromTableSyntaxNodeand if it is notnullcallsgetDefaultTechnicalName(ExecutableMethod).- Parameters:
executableNode-TableSyntaxNodethat is executable (seeExecutable)from which we tries to get theExecutableRulesMethod.- 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 parametersresultTitle- result parameter title- Throws:
IllegalArgumentException- if params is nullIllegalStateException- if method is called without priorbeginTable()call
-
-