Package org.dbunit

Examples of org.dbunit.DatabaseUnitRuntimeException


        Column[] columns = metaData.getColumns();
        Column[] primaryKeys = metaData.getPrimaryKeys();

        if(columns.length==0){
            throw new DatabaseUnitRuntimeException("At least one column is required to build a valid select statement. "+
                    "Cannot load data for " + metaData);
        }

        // select
        StringBuffer sqlBuffer = new StringBuffer(128);
View Full Code Here


                    if (result != 0) {
                        return result;
                    }
                }
            } catch (DataSetException e) {
                throw new DatabaseUnitRuntimeException(e);
            }

            return 0;
        }
View Full Code Here

        if(factoryObj instanceof String){
            msg += " Ensure not to specify the fully qualified class name as String but the concrete " +
                "instance of the datatype factory (for example 'new OracleDataTypeFactory()').";
        }
        // TODO Would a "DatabaseUnitConfigurationException make more sense?
        throw new DatabaseUnitRuntimeException(msg);
    }
        IDataTypeFactory dataTypeFactory = (IDataTypeFactory)factoryObj;
       
      // Validate, e.g. oracle metaData + oracleDataTypeFactory ==> OK
        Connection jdbcConnection = connection.getConnection();
View Full Code Here

        {
            return correctCase(databaseIdentifier, connection.getMetaData());
        }
        catch (SQLException e)
        {
            throw new DatabaseUnitRuntimeException("Exception while trying to access database metadata", e);
        }
    }
View Full Code Here

            }
            return resultTableName;
        }
        catch (SQLException e)
        {
            throw new DatabaseUnitRuntimeException("Exception while trying to access database metadata", e);
        }
    }
View Full Code Here

            throw new NullPointerException(
                    "The parameter 'escapePattern' must not be null");
        }
        if(escapePattern.trim().equals(""))
        {
            throw new DatabaseUnitRuntimeException("Empty string is an invalid escape pattern!");
        }
   
        int split = name.indexOf(".");
        if (split > 1)
        {
View Full Code Here

        {
            resultSet = statement.executeQuery(sqlBuffer.toString());
            if(resultSet.next()) {
                return resultSet.getInt(1);
            } else {
                throw new DatabaseUnitRuntimeException("Select count did not return any results for table '" +
                        tableName + "'. Statement: " + sqlBuffer.toString());
            }
        }
        finally
        {
View Full Code Here

        } else {
            URL url = this.getClass().getResource(filename);

            if (url == null) {
                final String msg = "Could not find file named=" + filename;
                throw new DatabaseUnitRuntimeException(msg);
            }

            try {
                ds = loadDataSet(url);
                ds = processReplacementTokens(ds);
            } catch (DataSetException e) {
                final String msg =
                        "DataSetException occurred loading data set file name='"
                                + filename + "', msg='"
                                + e.getLocalizedMessage() + "'";
                throw new DatabaseUnitRuntimeException(msg, e);
            } catch (IOException e) {
                final String msg =
                        "IOException occurred loading data set file name='"
                                + filename + '\'' + ", msg='"
                                + e.getLocalizedMessage() + "'";
                throw new DatabaseUnitRuntimeException(msg, e);
            }
        }

        return ds;
    }
View Full Code Here

                    }
                }
            }
            catch (DataSetException e)
            {
                throw new DatabaseUnitRuntimeException(e);
            }

            return 0;
        }
View Full Code Here

                _producer.produce();
//                System.out.println("End of thread! - " + System.currentTimeMillis());
            }
            catch (DataSetException e)
            {
                throw new DatabaseUnitRuntimeException(e);
            }
        }
View Full Code Here

TOP

Related Classes of org.dbunit.DatabaseUnitRuntimeException

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.