Package org.dbunit.dataset

Examples of org.dbunit.dataset.DataSetException


            this.logger.debug("Filter.iterator()" );
        }
        try {
            searchPKs(dataSet);
        } catch (SQLException e) {
            throw new DataSetException( e );
        }
        return new FilterIterator(reversed ? dataSet.reverseIterator() : dataSet
                .iterator());
    }
View Full Code Here


            Column column = _metaData.getColumns()[columnIndex];
            return column.getDataType().getSqlValue(columnIndex + 1, _resultSet);
        }
        catch (SQLException e)
        {
            throw new DataSetException(e);
        }
    }
View Full Code Here

          for (Iterator tableIter = tableSpecs.iterator(); tableIter.hasNext();) {
        String table = (String) tableIter.next();
              try {
                  produceFromURL(new URL(base, table + ".csv"));
              } catch (CsvParserException e) {
                  throw new DataSetException("error producing dataset for table '" + table + "'", e);
              }

      }
            _consumer.endDataSet();
        } catch (IOException e) {
          throw new DataSetException("error getting list of tables", e);
        }
  }
View Full Code Here

                }
                _consumer.row(row);
            }
            _consumer.endTable();
        } catch (CsvParserException e) {
          throw new DataSetException("error parsing CSV for URL: '" + url + "'");
    } catch (IOException e) {
          throw new DataSetException("I/O error parsing CSV for URL: '" + url + "'");
    }
  }
View Full Code Here

            xmlReader.setErrorHandler(this);
            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

        if(exception instanceof DataSetException) {
            return (DataSetException) exception;
        }
        else {
            return new DataSetException(message, exception);
        }
    }
View Full Code Here

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

        File dir = new File(_theDirectory);

        if (!dir.isDirectory()) {
            throw new DataSetException("'" + _theDirectory + "' should be a directory");
        }

        _consumer.startDataSet();
        try {
          List tableSpecs = CsvProducer.getTables(dir.toURL(), CsvDataSet.TABLE_ORDERING_FILE);
          for (Iterator tableIter = tableSpecs.iterator(); tableIter.hasNext();) {
        String table = (String) tableIter.next();
              try {
                  produceFromFile(new File(dir, table + ".csv"));
              } catch (CsvParserException e) {
                  throw new DataSetException("error producing dataset for table '" + table + "'", e);
              } catch (DataSetException e) {
                throw new DataSetException("error producing dataset for table '" + table + "'", e);
              }

      }
            _consumer.endDataSet();
        } catch (IOException e) {
          throw new DataSetException("error getting list of tables", e);
        }
    }
View Full Code Here

                }
                _consumer.row(row);
            }
            _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

        try {
          tableList = new LinkedList();
            new File(getTheDirectory()).mkdirs();
        } catch (Exception e) {
            throw new DataSetException("Error while creating the destination directory '" + getTheDirectory() + "'", e);
        }
    }
View Full Code Here

        String file = (String) fileNames.next();
        pw.println(file);
      }
    }
      catch (IOException e) {
      throw new DataSetException("problems writing the table ordering file", e);
    }
      finally {
          if(pw != null){
              pw.close();
          }
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.