use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class UpdateLocksTest method suite.
public static Test suite() {
Test suite = TestConfiguration.defaultSuite(UpdateLocksTest.class);
Properties p = new Properties();
p.put("derby.storage.pageSize", "4096");
return new CleanDatabaseTestSetup(new SystemPropertyTestSetup(suite, p, false));
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class ConnectWrongSubprotocolTest method suite.
public static Test suite() {
// Test does not run on J2ME
if (JDBC.vmSupportsJSR169()) {
return new BaseTestSuite("empty: no support for Driver.sql.Manager with jsr 169");
}
if (!Derby.hasTools())
return new BaseTestSuite("empty: no tools support");
Properties props = new Properties();
props.setProperty("ij.connection.wrongSubprotocol", "jdbc:noone:fruitfly;create=true");
Test test = TestConfiguration.embeddedSuite(ConnectWrongSubprotocolTest.class);
return new SystemPropertyTestSetup(test, props);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class IjConnNameTest method suite.
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("IjConnNameTest");
// Test does not run on J2ME
if (JDBC.vmSupportsJSR169())
return suite;
Properties props = new Properties();
props.setProperty("ij.connection.connOne", "jdbc:derby:wombat;create=true");
props.setProperty("ij.connection.connFour", "jdbc:derby:nevercreated");
props.setProperty("ij.showNoConnectionsAtStart", "true");
props.setProperty("ij.showNoCountForSelect", "true");
Test test = new SystemPropertyTestSetup(new IjConnNameTest(test_script), props);
// test = SecurityManagerSetup.noSecurityManager(test);
test = new CleanDatabaseTestSetup(test);
return getIJConfig(test);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class UpdateCursorTest method suite.
/**
* Returns the implemented tests.
*
* @return An instance of <code>Test</code> with the implemented tests to
* run.
*/
public static Test suite() {
Properties props = new Properties();
props.setProperty("derby.language.maxMemoryPerTable", "1");
return new DatabasePropertyTestSetup(new SystemPropertyTestSetup(new CleanDatabaseTestSetup(new BaseTestSuite(UpdateCursorTest.class, "UpdateCursorTest")) {
/**
* @see org.apache.derbyTesting.junit.CleanDatabaseTestSetup#decorateSQL(java.sql.Statement)
*/
protected void decorateSQL(Statement s) throws SQLException {
StringBuffer sb = new StringBuffer(1000);
String largeString;
PreparedStatement pstmt;
assertUpdateCount(s, 0, "create table T1 (" + " c1 int," + " c2 char(50)," + " c3 int," + " c4 char(50)," + " c5 int," + " c6 varchar(1000))");
assertUpdateCount(s, 0, "create index I11 on T1(c3, c1, c5)");
assertUpdateCount(s, 0, "create table T2(" + " c1 int)");
assertUpdateCount(s, 0, "create table T3(" + " c1 char(20) not null primary key)");
assertUpdateCount(s, 0, "create table T4(" + " c1 char(20) references T3(c1) on delete cascade)");
/* fill the newly created tables */
for (int i = 0; i < 1000; i++) {
sb.append('a');
}
pstmt = s.getConnection().prepareStatement("insert into T1 values (?, ?, ?, ?, ?, ?), " + "(?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?), " + "(?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?)");
largeString = new String(sb);
for (int i = 246; i > 0; i = i - 5) {
int k = 0;
for (int j = 0; j < 5; j++) {
pstmt.setInt(1 + k, i + (4 - j));
pstmt.setString(2 + k, Integer.toString(i));
pstmt.setInt(3 + k, i + j);
pstmt.setString(4 + k, Integer.toString(i));
pstmt.setInt(5 + k, i);
pstmt.setString(6 + k, largeString);
k += 6;
}
assertUpdateCount(pstmt, 5);
}
s.executeUpdate("insert into t2 values (1)");
pstmt.close();
}
}, props), props, true);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class BlobImplT method baseSuite.
/**
* Create an instance of the {@code LobLimitsTest} suite.
*
* @param biggestSize the size of the biggest LOB to test
* @param bigSize the size of a typical big LOB to test
* @return a test suite
*/
static Test baseSuite(final int biggestSize, final int bigSize) {
// Run the suite with following properties in case we run into lock
// time out issues. It will help debug the problem if timeouts occur.
Properties sysprops = new Properties();
sysprops.setProperty("derby.locks.deadlockTrace", "true");
sysprops.setProperty("derby.locks.monitor", "true");
// Some of the test cases depend on certain other test cases to run
// first, so force the test cases to run in lexicographical order.
Test suite = new CleanDatabaseTestSetup(new BaseTestSuite(LobLimitsTest.class)) {
@Override
protected void decorateSQL(Statement s) throws SQLException {
setupTables(s, biggestSize, bigSize);
}
};
suite = new SystemPropertyTestSetup(suite, sysprops);
return new SupportFilesSetup(suite);
}
Aggregations