Package org.dbunit.dataset.xml

Examples of org.dbunit.dataset.xml.FlatXmlDataSetBuilder


    @Ignore("May fail because of a conflict with the admin uzer (the account created on setUp)")
    @Override
    public void testSave() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/uzer-create_no-id.xml")
                    .openStream());
            Uzer uzer = new Uzer();
            Uzer nuzer;
            Program program = new Program();
            Profile profile = new Profile();
View Full Code Here


    @DatabaseSetup(value = CREATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE_ALL)
    public void testSave2() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/uzer-update_aftersave.xml")
                    .openStream());
            Uzer uzer = new Uzer();
            Uzer nuzer;
            Program program = new Program();
            Profile profile = new Profile();
View Full Code Here

    private void addAdminAccount() {
        try {
            DatabaseConnection connection;
            connection = new DatabaseConnection(dataSource.getConnection());
            URL resource = this.getClass().getResource(DATASET_ADMIN_USER);
            IDataSet dataSet = new FlatXmlDataSetBuilder().build(resource.openStream());
            org.dbunit.operation.DatabaseOperation.INSERT.execute(connection, dataSet);
            connection.close();
        } catch (DatabaseUnitException e) {
            e.printStackTrace();
            fail(e.getLocalizedMessage());
View Full Code Here

    private void removeAdminAccount() {
        try {
            DatabaseConnection connection;
            connection = new DatabaseConnection(dataSource.getConnection());
            URL resource = this.getClass().getResource(DATASET_ADMIN_USER);
            IDataSet dataSet = new FlatXmlDataSetBuilder().build(resource.openStream());
            org.dbunit.operation.DatabaseOperation.DELETE.execute(connection, dataSet);
            connection.close();
        } catch (DatabaseUnitException e) {
            e.printStackTrace();
            fail(e.getLocalizedMessage());
View Full Code Here

     * Imports DB data from the specified XML
     * @param xmlUrl URL to XML file location
     */
    public ImportBuilder from(URL xmlUrl) {
      try {
        flatXmlDataSet = new FlatXmlDataSetBuilder()
          .setColumnSensing(true)
          .setCaseSensitiveTableNames(false)
          .build(xmlUrl);
        this.dataSetUrl = xmlUrl;
        return this;
View Full Code Here

     * @return This builder to allow for chaining
     */
    public AssertBuilder expected(URL xmlUrl) {
      try {
        this.dataSetUrl = xmlUrl;
        flatXmlDataSet = new FlatXmlDataSetBuilder().build(xmlUrl);
        return this;
      } catch (Exception ex) {
        throw new JuDbException("Couldn't import data from XML: xmlUrl", ex);
      }
    }
View Full Code Here

     * Imports DB data from the specified XML
     * @param xmlUrl URL to XML file location
     */
    public ImportBuilder from(URL xmlUrl) {
      try {
        flatXmlDataSet = new FlatXmlDataSetBuilder()
          .setColumnSensing(true)
          .setCaseSensitiveTableNames(false)
          .build(xmlUrl);
        this.dataSetUrl = xmlUrl;
        return this;
View Full Code Here

     * @return This builder to allow for chaining
     */
    public AssertBuilder expected(URL xmlUrl) {
      try {
        this.dataSetUrl = xmlUrl;
        flatXmlDataSet = new FlatXmlDataSetBuilder().build(xmlUrl);
        return this;
      } catch (Exception ex) {
        throw new JuDbException("Couldn't import data from XML: xmlUrl", ex);
      }
    }
View Full Code Here

     * Imports DB data from the specified XML
     * @param xmlUrl URL to XML file location
     */
    public ImportBuilder from(URL xmlUrl) {
      try {
        flatXmlDataSet = new FlatXmlDataSetBuilder()
          .setColumnSensing(true)
          .setCaseSensitiveTableNames(false)
          .build(xmlUrl);
        this.dataSetUrl = xmlUrl;
        return this;
View Full Code Here

     * @return This builder to allow for chaining
     */
    public AssertBuilder expected(URL xmlUrl) {
      try {
        this.dataSetUrl = xmlUrl;
        flatXmlDataSet = new FlatXmlDataSetBuilder().build(xmlUrl);
        return this;
      } catch (Exception ex) {
        throw new JuDbException("Couldn't import data from XML: xmlUrl", ex);
      }
    }
View Full Code Here

TOP

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

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.