use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class NullSQLTextTest method baseSuite.
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(NullSQLTextTest.class);
return new CleanDatabaseTestSetup(suite) {
/**
* Creates the tables and the stored procedures used in the test
* cases.
*
* @exception SQLException if a database error occurs
*/
protected void decorateSQL(Statement stmt) throws SQLException {
Connection conn = getConnection();
/**
* Creates the table used in the test cases.
*/
stmt.execute("create table t1 (i int)");
stmt.execute("insert into t1 values 1, 2, 3, 4, 5, 6, 7");
stmt.execute("create procedure za() language java external name " + "'org.apache.derbyTesting.functionTests.tests.jdbcapi.NullSQLTextTest.zeroArg'" + " parameter style java");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class ParameterMetaDataJdbc30Test method baseSuite.
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(ParameterMetaDataJdbc30Test.class);
return new CleanDatabaseTestSetup(suite) {
/**
* Creates the tables and the stored procedures used in the test
* cases.
*
* @exception SQLException if a database error occurs
*/
protected void decorateSQL(Statement stmt) throws SQLException {
Connection conn = getConnection();
// Create procedure used by
// testParameterMetadataWithDECIMALParameters() and
// testParameterMetadataWithLITERALParameters().
stmt.execute("CREATE PROCEDURE PMDD(IN pmdI_1 DECIMAL(5,3), " + "IN pmdI_2 DECIMAL(4,2), INOUT pmdI_3 DECIMAL(9,0), " + "OUT pmdI_4 DECIMAL(10,2)) language java " + "parameter style java external name " + "'org.apache.derbyTesting.functionTests.tests.jdbcapi." + "ParameterMetaDataJdbc30Test.dummyDecimal'");
/**
* Creates the table used in the test cases.
*/
stmt.execute("create table t ( " + /* 1 */
"c char(5), " + /* 2 */
"iNoNull int not null, " + /* 3 */
"i int, " + /* 4 */
"de decimal, " + /* 5 */
"d date)");
stmt.executeUpdate("create function RDB(P1 INT) " + "RETURNS DECIMAL(10,2) " + "language java external name " + "'org.apache.derbyTesting.functionTests." + "tests.lang.outparams30.returnsBigDecimal' " + "parameter style java");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class PrepStmtNullTest method baseSuite.
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(PrepStmtNullTest.class);
return new CleanDatabaseTestSetup(suite) {
/**
* Creates the tables used in the test
* cases.
*
* @exception SQLException if a database error occurs
*/
protected void decorateSQL(Statement stmt) throws SQLException {
/**
* Creates the table used in the test cases.
*/
stmt.execute("create table nullTS(name varchar(10), ts timestamp)");
stmt.executeUpdate("create table nullBlob(name varchar(10), bval blob(16K))");
stmt.executeUpdate("create table ClobBlob(cval clob, bval blob(16K))");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class ProcedureTest method baseSuite.
/**
* Creates the test suite and wraps it in a <code>TestSetup</code>
* instance which sets up and tears down the test environment.
* @return test suite
*/
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
// Need JDBC DriverManager to run these tests
if (!JDBC.vmSupportsJDBC3())
return suite;
suite.addTestSuite(ProcedureTest.class);
return new CleanDatabaseTestSetup(suite) {
/**
* Creates the tables and the stored procedures used in the test
* cases.
* @exception SQLException if a database error occurs
*/
protected void decorateSQL(Statement s) throws SQLException {
for (int i = 0; i < PROCEDURES.length; i++) {
s.execute(PROCEDURES[i]);
}
for (int i = 0; i < TABLES.length; i++) {
s.execute(TABLES[i][1]);
}
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class RelativeTest method baseSuite.
/**
* Base suite of tests that will run in both embedded and client.
*
* @param name
* Name for the suite.
*/
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(RelativeTest.class);
return new CleanDatabaseTestSetup(DatabasePropertyTestSetup.setLockTimeouts(suite, 2, 4)) {
/**
* Creates the tables used in the test cases.
*
* @exception SQLException
* if a database error occurs
*/
protected void decorateSQL(Statement stmt) throws SQLException {
stmt.execute("create table testRelative(" + "name varchar(10), i int)");
stmt.execute("insert into testRelative values (" + "'work1', NULL)");
stmt.execute("insert into testRelative values (" + "'work2', NULL)");
stmt.execute("insert into testRelative values (" + "'work3', NULL)");
stmt.execute("insert into testRelative values (" + "'work4', NULL)");
}
};
}
Aggregations