Package org.dbunit.dataset.xml

Examples of org.dbunit.dataset.xml.FlatXmlProducer


            dbConfig.setProperty("http://www.dbunit.org/properties/datatypeFactory", type);
        }
    }

    IDataSet getDataSet() throws Exception {
        FlatXmlProducer xmlProducer = new FlatXmlProducer(new InputSource(getClass().getResourceAsStream(
            getDataSetFile())));
        xmlProducer.setColumnSensing(true);
        return new FlatXmlDataSet(xmlProducer);
    }
View Full Code Here


            dbConfig.setProperty("http://www.dbunit.org/properties/datatypeFactory", type);
        }
    }

    IDataSet getDataSet() throws Exception {
        FlatXmlProducer xmlProducer = new FlatXmlProducer(new InputSource(getClass().getResourceAsStream(
            getDataSetFile())));
        xmlProducer.setColumnSensing(true);
        return new FlatXmlDataSet(xmlProducer);
    }
View Full Code Here

            config.setProperty("http://www.dbunit.org/properties/datatypeFactory", type);
        }
    }

    private IDataSet getDataSet() throws DataSetException {
        FlatXmlProducer xmlProducer = new FlatXmlProducer(new InputSource(getClass().getResourceAsStream(
            getDataSetFile())));
        xmlProducer.setColumnSensing(true);
        return new FlatXmlDataSet(xmlProducer);
    }
View Full Code Here

    }

    public IDataSetProducer getProducer() throws Exception {
        if (producer == null) {
            currentStream = provider.createInputStream();
            producer = new FlatXmlProducer(new InputSource(currentStream));
        }
       
        return producer;
    }
View Full Code Here

            }
        }
    }

    IDataSet getDataSet() throws Exception {
        FlatXmlProducer xmlProducer = new FlatXmlProducer(new InputSource(getClass().getResourceAsStream(
            "AlertManagerBeanTest.xml")));
        xmlProducer.setColumnSensing(true);
        return new FlatXmlDataSet(xmlProducer);
    }
View Full Code Here

      InputStreamReader inReader = new InputStreamReader(Dbunit.class
          .getResourceAsStream(path), "UTF-8");
      // FlatXmlDataSet fxset = new FlatXmlDataSet(inReader, true,
      // enableColumnSensing, false);
      // return fxset;
      return new CachedDataSet(new FlatXmlProducer(new InputSource(
          inReader), true, enableColumnSensing, false));

    } else {
      return new XmlDataSet(Dbunit.class.getResourceAsStream(path));
    }
View Full Code Here

  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

  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

            {
                producer = new CsvProducer(src);
            }
            else if (format.equalsIgnoreCase(FORMAT_FLAT))
            {
                producer = new FlatXmlProducer(getInputSource(src), true, true);
            }
            else if (format.equalsIgnoreCase(FORMAT_DTD))
            {
                producer = new FlatDtdProducer(getInputSource(src));
            }
View Full Code Here

TOP

Related Classes of org.dbunit.dataset.xml.FlatXmlProducer

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.