Package org.dbunit.dataset

Examples of org.dbunit.dataset.DefaultTableMetaData


                columns[i] = new Column((String) readColumns.get(i), DataType.UNKNOWN);
            }

            String tableName = url.getFile();
            tableName = tableName.substring(tableName.lastIndexOf("/")+1, tableName.indexOf(".csv"));
            ITableMetaData metaData = new DefaultTableMetaData(tableName, columns);
            _consumer.startTable(metaData);
            for (int i = 1 ; i < readData.size(); i++) {
                List rowList = (List)readData.get(i);
                Object[] row = rowList.toArray();
                for(int col = 0; col < row.length; col++) {
View Full Code Here


            for (int i = 0; i < readColumns.size(); i++) {
                columns[i] = new Column((String) readColumns.get(i), DataType.UNKNOWN);
            }

            String tableName = theDataFile.getName().substring(0, theDataFile.getName().indexOf(".csv"));
            ITableMetaData metaData = new DefaultTableMetaData(tableName, columns);
            _consumer.startTable(metaData);
            for (int i = 1 ; i < readData.size(); i++) {
                List rowList = (List)readData.get(i);
                Object[] row = rowList.toArray();
                for(int col = 0; col < row.length; col++) {
View Full Code Here

    }

    public ITableMetaData getTableMetaData() {
        ITableMetaData meta = delegate.getTableMetaData();
        try {
            return new DefaultTableMetaData(tableName, meta.getColumns(), meta.getPrimaryKeys());
        } catch (DataSetException e) {
            throw new QtafException("Don't get the meta info from  " + meta, e);
        }
    }
View Full Code Here

    public XlsTable(HSSFWorkbook workbook, String sheetName, HSSFSheet sheet) throws DataSetException {
        int rowCount = sheet.getLastRowNum();
        if (rowCount >= 0 && sheet.getRow(0) != null) {
            _metaData = createMetaData(sheetName, sheet.getRow(0), workbook);
        } else {
            _metaData = new DefaultTableMetaData(sheetName, new Column[0]);
        }

        _sheet = sheet;

        // Needed for later "BigDecimal"/"Number" conversion
View Full Code Here

        }
        Column[] columns = columnList.toArray(new Column[0]);
       
        if(!primaryKeyList.isEmpty()){
          return new DefaultTableMetaData(tableName, columns,primaryKeyList.toArray(new String[primaryKeyList.size()]));
        }else{
          return new DefaultTableMetaData(tableName, columns);
        }
       
    }
View Full Code Here

        final Column[] columns = new Column[readColumns.size()];
        for (int i = 0; i < readColumns.size(); i++) {
            columns[i] = new Column((String)readColumns.get(i), DataType.UNKNOWN);
        }

        final ITableMetaData metaData = new DefaultTableMetaData(tableName, columns);
        dataSet.startTable(metaData);
        for (int rowIndex = 1; rowIndex < readData.size(); rowIndex++) {
            final List row = (List)readData.get(rowIndex);
            final Object[] values = row.toArray();
            for (int columnIndex = 0; columnIndex < values.length; columnIndex++) {
View Full Code Here

TOP

Related Classes of org.dbunit.dataset.DefaultTableMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.