Skip navigation links
com.auxiliary.http

Class ReadInterfaceFromExcel

    • Constructor Detail

      • ReadInterfaceFromExcel

        public ReadInterfaceFromExcel(File excelFile)
        构造对象,读取模板文件,并初始化各个参数
        Parameters:
        excelFile - 接口模板文件
    • Method Detail

      • getParentInterfaceName

        public List<String> getParentInterfaceName(String interName)
        Description copied from interface: BeforeOperation
        该方法用于返回接口的所有父层接口名称(不包括当前接口名称)
        Specified by:
        getParentInterfaceName in interface BeforeOperation
        Parameters:
        interName - 接口名称
        Returns:
        父层接口名称集合
      • getExtractContent

        public Set<String> getExtractContent(String interName)
        Description copied from interface: ExtractResponse
        该方法用于指定接口的报文提词内容json串集合

        json串的键值可通过静态属性获取,当没有断言内容时,则json中的键都为空值

        Specified by:
        getExtractContent in interface ExtractResponse
        Parameters:
        interName - 接口名称
        Returns:
        接口响应报文提词内容json串集合
      • getAssertContent

        public Set<String> getAssertContent(String interName)
        Description copied from interface: AssertResponse
        该方法用于返回指定接口的断言内容json串

        json串的键值可通过静态属性获取,当没有断言内容时,则json中的键都为空值

        Specified by:
        getAssertContent in interface AssertResponse
        Parameters:
        interName - 接口名称
        Returns:
        接口断言内容json串
      • getInterface

        public InterfaceInfo getInterface(String interName,
                                          String environmentName)
        Description copied from interface: ActionEnvironment
        该方法用于根据接口名称及所在环境,返回接口的信息类对象
        Specified by:
        getInterface in interface ActionEnvironment
        Parameters:
        interName - 接口名称
        environmentName - 环境名称
        Returns:
        接口信息类对象
      • readBodySheetContent

        protected void readBodySheetContent(String interName,
                                            InterfaceInfo inter)
      • readMultirowSheetContent

        protected void readMultirowSheetContent(String interName,
                                                String sheetName,
                                                InterfaceInfo inter,
                                                HashMap<String,Entry<Integer,Integer>> map)
        该方法用于读取一个接口占多行的sheet页内容
        Parameters:
        interName - 接口名称
        sheetName - sheet页名称
        inter - 接口信息类对象
        Since:
        autest 3.7.0
      • readInterSheetContent

        protected void readInterSheetContent(String interName,
                                             InterfaceInfo inter)
        该方法用于读取“接口”sheet页中接口相关的基本信息
        Parameters:
        interName - 接口名称
        inter - 接口信息类对象
        Since:
        autest 3.7.0
      • close

        public void close()
        该方法用于关闭对接口模板的读取
        Since:
        autest 3.7.0
      • getSheetAllRow

        protected List<org.apache.poi.ss.usermodel.Row> getSheetAllRow(org.apache.poi.ss.usermodel.Sheet sheet)
        该方法用于获取当前sheet中所有行对象的集合
        Parameters:
        sheet - sheet对象
        Returns:
        当前sheet所有行对象集合
        Since:
        autest 3.7.0
      • getRowAllCell

        protected List<Optional<org.apache.poi.ss.usermodel.Cell>> getRowAllCell(org.apache.poi.ss.usermodel.Row row,
                                                                                 int columnIndex)
        该方法用于获取当前行中所有单元格对象的集合
        Parameters:
        row - 行对象
        columnIndex - 当前行下的列数
        Returns:
        当前行中所有单元格对象的集合
        Since:
        autest 3.7.0
      • addInterNameRowIndex

        protected void addInterNameRowIndex(HashMap<String,Entry<Integer,Integer>> map,
                                            int fieldIndex,
                                            org.apache.poi.ss.usermodel.Sheet dataSheet)
        该方法用于将sheet所有行中指定下标单元格中不为空的内容进行存储,并记录其内容及行号至指定的map集合中
        Parameters:
        map - 存储内容及下标的集合
        fieldIndex - 指定字段所在的列的下标
        dataSheet - 数据sheet页
        Since:
        autest 3.7.0

Copyright © 2024. All rights reserved.