Package org.dbunit.dataset

Examples of org.dbunit.dataset.ReplacementDataSet


     *         <code>ReplacementDataSet</code> and processed with the tokens in
     *         the replacement maps.
     * @since 2.4.8
     */
    protected ReplacementDataSet processReplacementTokens(IDataSet ds) {
        ReplacementDataSet rds =
                new ReplacementDataSet(ds, replacementObjects,
                        replacementSubstrings);

        return rds;
    }
View Full Code Here


            DatabaseOperation operation = (_transaction ? new TransactionOperation(_operation) : _operation);
            // TODO This is not very nice and the design should be reviewed but it works for now (gommma)
            boolean useForwardOnly = _forwardOperation && ! isOrdered();
            IDataSet dataset = getSrcDataSet(getSrc(), getFormat(), useForwardOnly);
            if (_nullToken != null) {
                dataset = new ReplacementDataSet(dataset);
                ((ReplacementDataSet)dataset).addReplacementObject(_nullToken, null);
            }
            if(isOrdered())
            {
                DatabaseSequenceFilter databaseSequenceFilter = new DatabaseSequenceFilter(connection);
View Full Code Here

            log.info("preparing dataset: " + dataSetLocation);

            // Load the base dataset file
            InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(dataSetLocation);
            try {
                this.dataSet = new ReplacementDataSet( new FlatXmlDataSet(input) );
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
            this.dataSet.addReplacementObject("[NULL]", null);
            this.operation = operation;
View Full Code Here

    return Collections.unmodifiableMap(result);
  }

  public IDataSet loadDataSet(Class<?> testClass, String location) throws Exception {
    IDataSet dataSet = this.dataSetLoader.loadDataSet(testClass, location);
    ReplacementDataSet replacementDataSet = new ReplacementDataSet(dataSet, this.objectReplacements,
        this.subStringReplacements);
    return replacementDataSet;
  }
View Full Code Here

    }
  }

  private IDataSet getData(InputStream stream) {
    try {
      ReplacementDataSet dataSet = new ReplacementDataSet(new FlatXmlDataSet(stream));
      dataSet.addReplacementObject("[null]", null);
      dataSet.addReplacementObject("[false]", Boolean.FALSE);
      dataSet.addReplacementObject("[true]", Boolean.TRUE);
      return dataSet;
    } catch (Exception e) {
      throw translateException("Could not read the dataset stream", e);
    }
  }
View Full Code Here

    }
  }

  private IDataSet dbUnitDataSet(InputStream stream) {
    try {
      ReplacementDataSet dataSet = new ReplacementDataSet(new FlatXmlDataSet(stream));
      dataSet.addReplacementObject("[null]", null);
      dataSet.addReplacementObject("[false]", Boolean.FALSE);
      dataSet.addReplacementObject("[true]", Boolean.TRUE);

      return dataSet;
    } catch (Exception e) {
      throw translateException("Could not read the dataset stream", e);
    }
View Full Code Here

    }
  }

  private IDataSet getData(InputStream stream) {
    try {
      ReplacementDataSet dataSet = new ReplacementDataSet(new FlatXmlDataSet(stream));
      dataSet.addReplacementObject("[null]", null);
      dataSet.addReplacementObject("[false]", Boolean.FALSE);
      dataSet.addReplacementObject("[true]", Boolean.TRUE);
      return dataSet;
    } catch (Exception e) {
      throw translateException("Could not read the dataset stream", e);
    }
  }
View Full Code Here

                            Thread.currentThread().getContextClassLoader()
                                    .getResourceAsStream(dtdLocation);
                }
                if (dtdInput == null) {
                    this.dataSet =
                            new ReplacementDataSet(dataSetBuilder.build(input));
                } else {
                    dataSetBuilder.setMetaDataSetFromDtd(dtdInput);
                    this.dataSet =
                            new ReplacementDataSet(dataSetBuilder.build(input));
                }
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
            this.operation = operation;
View Full Code Here

                            Thread.currentThread().getContextClassLoader()
                                    .getResourceAsStream(dtdLocation);
                }
                if (dtdInput == null) {
                    this.dataSet =
                            new ReplacementDataSet(dataSetBuilder.build(input));
                } else {
                    dataSetBuilder.setMetaDataSetFromDtd(dtdInput);
                    this.dataSet =
                            new ReplacementDataSet(dataSetBuilder.build(input));
                }
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
            this.operation = operation;
View Full Code Here

TOP

Related Classes of org.dbunit.dataset.ReplacementDataSet

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.