Package org.dbunit.operation

Examples of org.dbunit.operation.DatabaseOperation$DummyOperation


        try {

          IDataSet dataSet = op.get();

          DatabaseOperation operacao = op.getOperation();
          DatabaseOperation trx = DatabaseOperation.TRANSACTION(operacao);
          trx.execute(conn, dataSet);

        } catch (Exception e) {

          Throwables.propagateIfInstanceOf(e, DBUnitSetupException.class);
          String msg = String.format("Could not load DBUnit file: %s", op.getFilename());
View Full Code Here


        LOGGER.debug("populating");

        StopWatch sw = new StopWatch("DbUnitDatabasePopulator");

        DatabaseOperation operation = phase.getOperation(dataSetConfiguration);
        try {
            IDataSet dataSet = decorateDataSetIfNeeded(dataSetConfiguration.getDataSet(), dataSetConfiguration.getDecorators());
            String schema = dataSetConfiguration.getSchema();
            DatabaseConnection databaseConnection = getDatabaseConnection(connection, schema, dataSetConfiguration);
            sw.start("populating");
            operation.execute(databaseConnection, dataSet);
            sw.stop();
            LOGGER.debug(sw.prettyPrint());

        } catch (BatchUpdateException e) {
            LOGGER.error("BatchUpdateException while loading dataset", e);
View Full Code Here

        try {

          IDataSet dataSet = op.get();

          DatabaseOperation operacao = op.getOperation();
          DatabaseOperation trx = DatabaseOperation.TRANSACTION(operacao);
          trx.execute(conn, dataSet);

        } catch (Exception e) {

          Throwables.propagateIfInstanceOf(e, DBUnitSetupException.class);
          String msg = String.format("Could not load DBUnit file: %s", op.getFilename());
View Full Code Here

   private DatabaseOperation getSelectedSeedingStrategy()
   {
      final DBUnitConfiguration dbUnitConfiguration = dbunitConfigurationInstance.get();
      final DataSeedStrategy dataSeedStrategy = persistenceExtensionFeatureResolverInstance.get().getDataSeedStrategy();
      final boolean useIdentityInsert = dbUnitConfiguration.isUseIdentityInsert();
      final DatabaseOperation selectedSeedingStrategy = dataSeedStrategy.provide(new DBUnitDataSeedStrategyProvider(
            useIdentityInsert));
      return selectedSeedingStrategy;
   }
View Full Code Here

          conexao.getPassword());

      IDataSet dataSet = getDataSet();
      databaseTester.setDataSet(dataSet);
      IDatabaseConnection conn = databaseTester.getConnection();
      DatabaseOperation operation = getInsertOperation();

      DatabaseOperation insert = DatabaseOperation.TRANSACTION(operation);
      insert.execute(conn, dataSet);
    } catch (ClassNotFoundException e) {
      throw new RuntimeException("It's impossible to load the class");

    } catch (DatabaseUnitException e) {
      throw new RuntimeException("Your connection with DbUnit has been failed" + e);
View Full Code Here

   }

   private void fillDatabase() throws Exception
   {
      final IDataSet initialDataSet = DataSetUtils.mergeDataSets(dataSetRegister.get().getInitial());
      final DatabaseOperation selectedSeedingStrategy = getSelectedSeedingStrategy();
      new TransactionOperation(selectedSeedingStrategy).execute(databaseConnection.get(), initialDataSet);
   }
View Full Code Here

   private DatabaseOperation getSelectedSeedingStrategy()
   {
      final DBUnitConfiguration dbUnitConfiguration = dbunitConfigurationInstance.get();
      final DataSeedStrategy dataSeedStrategy = persistenceExtensionFeatureResolverInstance.get().getDataSeedStrategy();
      final boolean useIdentityInsert = dbUnitConfiguration.isUseIdentityInsert();
      final DatabaseOperation selectedSeedingStrategy = dataSeedStrategy.provide(new DBUnitDataSeedStrategyProvider(
            useIdentityInsert));
      return selectedSeedingStrategy;
   }
View Full Code Here

        {
            return;
        }

        try {
            DatabaseOperation operation = (_transaction ? new TransactionOperation(_operation) : _operation);
            // TODO This is not very nice and the design should be reviewed but it works for now (gommma)
            boolean useForwardOnly = _forwardOperation && ! isOrdered();
            IDataSet dataset = getSrcDataSet(getSrc(), getFormat(), useForwardOnly);
            if (_nullToken != null) {
                dataset = new ReplacementDataSet(dataset);
                ((ReplacementDataSet)dataset).addReplacementObject(_nullToken, null);
            }
            if(isOrdered())
            {
                DatabaseSequenceFilter databaseSequenceFilter = new DatabaseSequenceFilter(connection);
                dataset = new FilteredDataSet(databaseSequenceFilter, dataset);
            }
            operation.execute(connection, dataset);
        }
        catch (SQLException e)
        {
            throw new DatabaseUnitException(e);
        }
View Full Code Here

            return;
        }

        try
        {
              DatabaseOperation operation = (_transaction ? new TransactionOperation(_operation) : _operation);
            IDataSet dataset = getSrcDataSet(getSrc(), getFormat(), _forwardOperation);
            operation.execute(connection, dataset);
        }
        catch (SQLException e)
        {
            throw new DatabaseUnitException(e);
        }
View Full Code Here

TOP

Related Classes of org.dbunit.operation.DatabaseOperation$DummyOperation

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.