Package org.dbunit.dataset

Examples of org.dbunit.dataset.DataSetException


       
        try {
            this.orderedTableNames = SqlLoaderControlProducer.getTables(controlFilesDir, tableOrderFile);
        }
        catch (IOException e) {
            throw new DataSetException("error getting list of tables from file '" + tableOrderFile + "'", e);
        }
    }
View Full Code Here


            String tableName = _activeMetaData.getTableName();
            setWriter(new FileWriter(getTheDirectory() + File.separator + tableName + ".csv"));
            writeColumnNames();
            getWriter().write(System.getProperty("line.separator"));
        } catch (IOException e) {
            throw new DataSetException(e);
        }

    }
View Full Code Here

        try {
            getWriter().close();
            tableList.add(_activeMetaData.getTableName());
            _activeMetaData = null;
        } catch (IOException e) {
            throw new DataSetException(e);
        }
    }
View Full Code Here

        logger.debug("produce() - start");

        File dir = this.controlFilesDir;

        if (!this.controlFilesDir.isDirectory()) {
            throw new DataSetException("'"
                    + this.controlFilesDir + "' should be a directory of the control files");
        }

        this.consumer.startDataSet();
       
        for (Iterator tableIter = this.orderedTableNames.iterator(); tableIter.hasNext();) {
            String table = (String) tableIter.next();
            try {
                File ctlFile = new File(dir, table + ".ctl");
                produceFromControlFile(ctlFile);
            }
            catch (SqlLoaderControlParserException e) {
                throw new DataSetException("error producing dataset for table '" + table + "'", e);
            }
            catch (DataSetException e) {
                throw new DataSetException("error producing dataset for table '" + table + "'", e);
            }

        }
        this.consumer.endDataSet();
    }
View Full Code Here

                    try {
                        String stringValue = DataType.asString(value);
                        final String quoted = quote(stringValue);
                        getWriter().write(quoted);
                    } catch (TypeCastException e) {
                        throw new DataSetException("table=" +
                                _activeMetaData.getTableName() + ", row=" + i +
                                ", column=" + columnName +
                                ", value=" + value, e);
                    }
                }
                if (i < columns.length - 1) getWriter().write(",");
            }
            getWriter().write(System.getProperty("line.separator"));
        } catch (IOException e) {
            throw new DataSetException(e);
        }
    }
View Full Code Here

                this.consumer.row(row);
            }
            this.consumer.endTable();
        }
        catch (PipelineException e) {
            throw new DataSetException(e);
        }
        catch (IllegalInputCharacterException e) {
            throw new DataSetException(e);
        }
        catch (IOException e) {
            throw new DataSetException(e);
        }
    }
View Full Code Here

            xmlReader.setEntityResolver(_resolver);
            xmlReader.parse(_inputSource);
        }
        catch (ParserConfigurationException e)
        {
            throw new DataSetException(e);
        }
        catch (SAXException e)
        {
            DataSetException exceptionToRethrow = XmlProducer.buildException(e);
            throw exceptionToRethrow;
        }
        catch (IOException e)
        {
            throw new DataSetException(e);
        }
    }
View Full Code Here

    private DataSetException resolveException(InterruptedException cause) throws DataSetException
    {
      String msg = "Current thread was interrupted (Thread=" + Thread.currentThread() + ")";
      if(this._asyncException != null)
      {
            return new DataSetException(msg, this._asyncException);
      }
      else
      {
        return new DataSetException(msg, cause);
      }
  }
View Full Code Here

            {
                _channel.put(EOD);
            }
            catch (InterruptedException e)
            {
                throw new DataSetException("Operation was interrupted");
            }
        }
View Full Code Here

            {
                _channel.put(metaData);
            }
            catch (InterruptedException e)
            {
                throw new DataSetException("Operation was interrupted");
            }
        }
View Full Code Here

TOP

Related Classes of org.dbunit.dataset.DataSetException

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.