Examples of IDataSetProducer


Examples of org.dbunit.dataset.stream.IDataSetProducer

  public void refreshData(final String flatXmlDataFile) {
    new DbUnitTemplate(dataSource).execute(new DbUnitCallback() {
      @Override
      public void doInDbUnit(IDatabaseConnection connection) throws Exception {
        InputStream in = getClass().getResourceAsStream(flatXmlDataFile);
        IDataSetProducer producer = new FlatXmlProducer(new InputSource(in), false);
        IDataSet dataSet = new StreamingDataSet(producer);
        DatabaseOperation.REFRESH.execute(connection, dataSet);
      }
    });
  }
View Full Code Here

Examples of org.dbunit.dataset.stream.IDataSetProducer

  private IDataSet getDatasetFromFile(String flatXmlDataFile) {
    return getDatasetFromInputStream(getClass().getResourceAsStream(flatXmlDataFile));
  }

  private IDataSet getDatasetFromInputStream(InputStream in) {
    IDataSetProducer producer = new FlatXmlProducer(new InputSource(in), false);
    try {
      return new CachedDataSet(producer);
    } catch (DataSetException e) {
      throw new RuntimeException("Cannot get dataset.", e);
    }
View Full Code Here

Examples of org.dbunit.dataset.stream.IDataSetProducer

          new Object[]{ src, format, String.valueOf(forwardonly) });
    }

        try
        {
            IDataSetProducer producer = null;
            if (format.equalsIgnoreCase(FORMAT_XML))
            {
                producer = new XmlProducer(getInputSource(src));
            }
            else if (format.equalsIgnoreCase(FORMAT_CSV))
View Full Code Here

Examples of org.dbunit.dataset.stream.IDataSetProducer

  protected IDataSet getSrcDataSet(File src, String format,
            boolean forwardonly) throws DatabaseUnitException
    {
        try
        {
            IDataSetProducer producer = null;
            if (format.equalsIgnoreCase(FORMAT_XML))
            {
                producer = new XmlProducer(new InputSource(src.toURL().toString()));
            }
            else if (format.equalsIgnoreCase(FORMAT_CSV))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.