Package org.jtester.exception

Examples of org.jtester.exception.JTesterException


        String constraintName = resultSet.getString("CONSTRAINT_NAME");
        alterStatement.executeUpdate("alter table " + qualified(tableName) + " disable constraint "
            + quoted(constraintName));
      }
    } catch (Throwable e) {
      throw new JTesterException("Error while disabling value constraints on schema " + getSchemaName(), e);
    } finally {
      closeQuietly(queryStatement);
      closeQuietly(connection, alterStatement, resultSet);
    }
  }
View Full Code Here


        // set back old increment
        getSQLHandler().executeUpdate(
            "alter sequence " + qualified(sequenceName) + " increment by " + incrementBy);
      }
    } catch (SQLException e) {
      throw new JTesterException("Error while incrementing sequence to value", e);
    } finally {
      closeQuietly(connection, statement, resultSet);
    }
  }
View Full Code Here

      try {
        connection = getSQLHandler().getDataSource().getConnection();
        DatabaseMetaData metaData = connection.getMetaData();
        oracleMajorVersionNumber = metaData.getDatabaseMajorVersion();
      } catch (SQLException e) {
        throw new JTesterException("Unable to determine database major version", e);
      } finally {
        closeQuietly(connection);
      }
    }
    return oracleMajorVersionNumber;
View Full Code Here

    OutputStream tempErr = new ByteArrayOutputStream();
    try {
      TestResult o = runTestMethod.invoke(this, new Object[] { test, tempOut, tempErr });
      return o;
    } catch (Exception e) {
      throw new JTesterException("Unable to invoke method[runTest].", e);
    }
  }
View Full Code Here

      connection = dataSource.getConnection();
      statement = connection.createStatement();
      return statement.executeUpdate(sql);

    } catch (Throwable e) {
      throw new JTesterException("Error while performing database update: " + sql, e);
    } finally {
      closeQuietly(connection, statement, null);
    }
  }
View Full Code Here

      connection = dataSource.getConnection();
      statement = connection.createStatement();
      resultSet = statement.executeQuery(sql);

    } catch (Throwable e) {
      throw new JTesterException("Error while performing database update: " + sql, e);
    } finally {
      closeQuietly(connection, statement, resultSet);
    }
  }
View Full Code Here

        connection.commit();
      }
      return nbChanges;

    } catch (Throwable e) {
      throw new JTesterException("Error while performing database update: " + sql, e);
    } finally {
      closeQuietly(connection, statement, null);
    }
  }
View Full Code Here

      resultSet = statement.executeQuery(sql);
      if (resultSet.next()) {
        return resultSet.getLong(1);
      }
    } catch (Throwable e) {
      throw new JTesterException("Error while executing statement: " + sql, e);
    } finally {
      closeQuietly(connection, statement, resultSet);
    }

    // in case no value was found, throw an exception
    throw new JTesterException("No item value found: " + sql);
  }
View Full Code Here

      resultSet = statement.executeQuery(sql);
      if (resultSet.next()) {
        return resultSet.getString(1);
      }
    } catch (Throwable e) {
      throw new JTesterException("Error while executing statement: " + sql, e);
    } finally {
      closeQuietly(connection, statement, resultSet);
    }

    // in case no value was found, throw an exception
    throw new JTesterException("No item value found: " + sql);
  }
View Full Code Here

        result.add(resultSet.getString(1));
      }
      return result;

    } catch (Throwable e) {
      throw new JTesterException("Error while executing statement: " + sql, e);
    } finally {
      closeQuietly(connection, statement, resultSet);
    }
  }
View Full Code Here

TOP

Related Classes of org.jtester.exception.JTesterException

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.