Package org.dbunit.dataset

Examples of org.dbunit.dataset.ReplacementDataSet


    private IDataSet decorateDataSetIfNeeded(IDataSet dataSet, Class<? extends DataSetDecorator>[] decorators) {
        if (decorators == null || decorators.length == 0)
            return dataSet;

        ReplacementDataSet decoratedSet = new ReplacementDataSet(dataSet);

        for (Class<? extends DataSetDecorator> decoratorClass : decorators) {
            try {
                DataSetDecorator decorator = decoratorClass.newInstance();
                decoratedSet.addReplacementSubstring(decorator.getStringToReplace(), decorator.getStringReplacement());
            } catch (InstantiationException e) {
                LOGGER.error("Could not instantiate DataSetDecorator {}" + decoratorClass, e);
            } catch (IllegalAccessException e) {
                LOGGER.error("Could not instantiate DataSetDecorator {}" + decoratorClass, e);
            }
View Full Code Here


      return new Yaml().load(inputStream) == null;
   }

   private IDataSet defineReplaceableExpressions(IDataSet dataSet)
   {
      final ReplacementDataSet replacementDataSet = new ReplacementDataSet(dataSet);
      replacementDataSet.addReplacementObject("[null]", null);
      replacementDataSet.addReplacementObject("[NULL]", null);
      return replacementDataSet;
   }
View Full Code Here

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

public class DefaultDbUnitDataSetResolver implements DbUnitDataSetResolver {

  @Override
  public IDataSet resolve(DataSetSource source) {
    FlatXmlDataSet dataSet = buildDataSet(source);
    ReplacementDataSet replacement = configureReplacement(dataSet);
    return replacement;
  }
View Full Code Here

    ReplacementDataSet replacement = configureReplacement(dataSet);
    return replacement;
  }

  protected ReplacementDataSet configureReplacement(FlatXmlDataSet dataSet) {
    ReplacementDataSet replacement = new ReplacementDataSet(dataSet);
    replacement.addReplacementObject("[NULL]", null);
    return replacement;
  }
View Full Code Here

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

      return isEmpty;
   }

   private IDataSet defineReplaceableExpressions(IDataSet dataSet)
   {
      final ReplacementDataSet replacementDataSet = new ReplacementDataSet(dataSet);
      replacementDataSet.addReplacementObject("[null]", null);
      replacementDataSet.addReplacementObject("[NULL]", null);
      return replacementDataSet;
   }
View Full Code Here

      return isEmpty;
   }

   private IDataSet defineReplaceableExpressions(IDataSet dataSet)
   {
      final ReplacementDataSet replacementDataSet = new ReplacementDataSet(dataSet);
      replacementDataSet.addReplacementObject("[null]", null);
      replacementDataSet.addReplacementObject("[NULL]", null);
      return replacementDataSet;
   }
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 new Yaml().load(inputStream) == null;
   }

   private IDataSet defineReplaceableExpressions(IDataSet dataSet)
   {
      final ReplacementDataSet replacementDataSet = new ReplacementDataSet(dataSet);
      replacementDataSet.addReplacementObject("[null]", null);
      replacementDataSet.addReplacementObject("[NULL]", null);
      return replacementDataSet;
   }
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.