Examples of XmlDataSet


Examples of org.dbunit.dataset.xml.XmlDataSet

    }
    dbUnitCon.getConfig().setProperty(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, Boolean.TRUE);
    dbUnitCon.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MySqlDataTypeFactory());
    IDataSet dataSet = null;
    try {
      dataSet = new XmlDataSet(new FileInputStream("data/load.xml"));
    } catch (IOException e) {
      System.out.println(e);
    } catch (DataSetException e) {
      System.out.println(e);
    }
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

    }
    dbUnitCon.getConfig().setProperty(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, Boolean.TRUE);
    dbUnitCon.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
    IDataSet dataSet = null;
    try {
      dataSet = new XmlDataSet(new FileInputStream("data/load.xml"));
    } catch (IOException e) {
      System.out.println(e);
    } catch (DataSetException e) {
      System.out.println(e);
    }
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

        this.datasource = datasource;
       

        // prepare the database
        IDatabaseConnection connection = new DatabaseConnection(datasource.getConnection());
        IDataSet dataSet = new XmlDataSet(new FileInputStream("conf/dataset.xml"));

        try
        {
            DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet);
        }
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

  }

  private IDataSet getDataSetObject(String path) throws Exception {
    if (getDataSetStrategy().equals(DataSetStrategy.Xml)) {
      return new XmlDataSet(Dbunit.class.getResourceAsStream(path));
    } else if (getDataSetStrategy().equals(DataSetStrategy.FlatXml)) {
      boolean enableColumnSensing = true;
      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

Examples of org.dbunit.dataset.xml.XmlDataSet

        try {
            final InputStream in = new FileInputStream(getFile(fixtureName));
            try {
                if (in != null) {
                    if (fixtureName.endsWith(".xml")) {
                        dataSet = new XmlDataSet(in);
                    }
                }
            } finally {
                in.close();
            }
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

        try {
            final InputStream in = ClassLoader.getSystemResourceAsStream(fixtureName);
            try {
                if (in != null) {
                    if (fixtureName.endsWith(".xml")) {
                        dataSet = new XmlDataSet(in);
                    }
                }
            } finally {
                in.close();
            }
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

        this.datasource = datasource;


        // prepare the database
        IDatabaseConnection connection = new DatabaseConnection(datasource.getConnection());
        IDataSet dataSet = new XmlDataSet(new FileInputStream("conf/dataset.xml"));

        try
        {
            DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet);
        }
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

    protected IDataSet loadDataSet(final File source) throws DataSetException,
            IOException {
        assert source != null;

        final FileInputStream inputStream = new FileInputStream(source);
        return new XmlDataSet(inputStream);
    }
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

        ds.setDefaultAutoCommit(isAutoCommit());

        // prepare the database
        Connection conn = ds.getConnection();
        IDatabaseConnection connection = new DatabaseConnection(conn);
        IDataSet dataSet = new XmlDataSet(new FileInputStream(
                ConfigurationAssert.getTestFile("dataset.xml")));

        try
        {
            DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet);
View Full Code Here

Examples of org.dbunit.dataset.xml.XmlDataSet

     * {@inheritDoc}
     */
    protected IDataSet loadDataSet(URL url) throws DataSetException,
            IOException {
        InputStream in = url.openStream();
        IDataSet ds = new XmlDataSet(in);

        return ds;
    }
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.