Examples of FilteredDataSet


Examples of org.dbunit.dataset.FilteredDataSet

         conn = new DatabaseConnection(ds.getConnection());
           
         ITableFilter filter = new DatabaseSequenceFilter(conn);
         
         //The dataSet: ie the list of ALL tables name
         IDataSet dataSet = new FilteredDataSet(filter, conn.createDataSet());
       
         ITableIterator iter = dataSet.iterator();
       
         while(iter.next())
         {
           ITable tab = iter.getTable();
           String tableName = tab.getTableMetaData().getTableName();       
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

    private IDataSet getDataSet(IDatabaseConnection conn) throws Exception {
      IDataSet ds = flatXmlDataSet;
     
      // If automated table order is enabled, decorate the table set with a database sequence filter
      if (this.automatedTableOrder) {
        ds = new FilteredDataSet(new DatabaseSequenceFilter(conn), flatXmlDataSet);
      }
     
      return ds;
    }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

      return names;
   }

   public static IDataSet excludeTables(IDataSet dataSet, String ... tablesToExclude)
   {
      return new FilteredDataSet(new ExcludeTableFilter(tablesToExclude), dataSet);
   }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

      {
         IDataSet currentDataSet = databaseConnection.get().createDataSet();
         final String[] excludeTables = dbunitConfigurationInstance.get().getExcludeTablesFromComparisonWhenEmptyExpected();
         if (excludeTables.length != 0)
         {
            currentDataSet = new FilteredDataSet(new ExcludeTableFilter(excludeTables), currentDataSet);
         }
         final IDataSet expectedDataSet = mergeDataSets(dataSetRegister.get().getExpected());
         final DataSetComparator dataSetComparator = new DataSetComparator(compareDataEvent.getSortByColumns(),
               compareDataEvent.getColumnsToExclude(), compareDataEvent.getCustomColumnFilters());
         dataSetComparator.compare(currentDataSet, expectedDataSet, assertionErrorCollector.get());
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

      IDataSet initialDataSet = mergeDataSets(dataSetRegister.get().getInitial());
      if (dbunitConfigurationInstance.get().isFilterTables())
      {
         final TableFilterProvider sequenceFilterProvider = new TableFilterResolver(dbunitConfigurationInstance.get()).resolve();
         final ITableFilter databaseSequenceFilter = sequenceFilterProvider.provide(connection, initialDataSet.getTableNames());
         initialDataSet = new FilteredDataSet(databaseSequenceFilter, initialDataSet);
      }
      seedingStrategy().execute(connection, initialDataSet);
   }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

         IDataSet dataSet = DataSetUtils.excludeTables(mergeDataSets, tablesToExclude);
         if (dbUnitConfiguration.isFilterTables())
         {
            final TableFilterProvider tableFilterProvider = new TableFilterResolver(dbUnitConfiguration).resolve();
            final ITableFilter tableFilter = tableFilterProvider.provide(connection, dataSet.getTableNames());
            dataSet = new FilteredDataSet(tableFilter, dataSet);
         }
         DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

         IDataSet dataSet = DataSetUtils.excludeTables(connection.createDataSet(), tablesToExclude);
         if (dbUnitConfiguration.isFilterTables())
         {
            final TableFilterProvider tableFilterProvider = new TableFilterResolver(dbUnitConfiguration).resolve();
            final ITableFilter tableFilter = tableFilterProvider.provide(connection, dataSet.getTableNames());
            dataSet = new FilteredDataSet(tableFilter, dataSet);
         }
         DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

         IDataSet dataSet = DataSetUtils.excludeTables(mergeDataSets, tablesToExclude);
         if (dbUnitConfiguration.isFilterTables())
         {
            final TableFilterProvider sequenceFilterProvider = new TableFilterResolver(dbUnitConfiguration).resolve();
            final ITableFilter tableFilter = sequenceFilterProvider.provide(connection, dataSet.getTableNames());
            dataSet = new FilteredDataSet(tableFilter, dataSet);
         }
         DatabaseOperation.DELETE.execute(connection, dataSet);
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

   public void compareContent(IDataSet currentDataSet, IDataSet expectedDataSet, AssertionErrorCollector errorCollector)
         throws DataSetException, DatabaseUnitException
   {
      final String[] tableNames = expectedDataSet.getTableNames();
      final FilteredDataSet filteredCurrentDataSet = new FilteredDataSet(new IncludeTableFilter(tableNames), currentDataSet);

      for (String tableName : tableNames)
      {
         final List<String> columnsForSorting = defineColumnsForSorting(filteredCurrentDataSet, expectedDataSet,
               tableName);

         final ITable expectedTable = sort(expectedDataSet, tableName, columnsForSorting);
         final ITable currentTable = sort(filteredCurrentDataSet, tableName, columnsForSorting);

         final List<String> columnsToIgnore = extractColumnsToBeIgnored(expectedDataSet.getTable(tableName),
               filteredCurrentDataSet.getTable(tableName));


         final DiffCollectingFailureHandler diffCollector = new DiffCollectingFailureHandler();

         Assertion.assertEquals(filter(expectedTable, toArray(columnsToIgnore)),
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

      {
         IDataSet currentDataSet = databaseConnection.get().createDataSet();
         final String[] excludeTablesFromComparisonWhenEmptyExpected = dbunitConfigurationInstance.get().getExcludeTablesFromComparisonWhenEmptyExpected();
         if (excludeTablesFromComparisonWhenEmptyExpected.length != 0)
         {
            currentDataSet = new FilteredDataSet(new ExcludeTableFilter(excludeTablesFromComparisonWhenEmptyExpected), currentDataSet);
         }
         final IDataSet expectedDataSet = DataSetUtils.mergeDataSets(dataSetRegister.get().getExpected());
         new DataSetComparator(compareDataEvent.getSortByColumns(), compareDataEvent.getColumnsToExclude()).compare(currentDataSet, expectedDataSet,
               assertionErrorCollector.get());
      }
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.