Search in sources :

Example 91 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class TestPreStartedSlaveServer method suite.

public static Test suite() throws Exception {
    System.out.println("**** TestPreStartedSlaveServer.suite()");
    initEnvironment();
    // String masterHostName = System.getProperty("test.serverHost", "localhost");
    // int masterPortNo = Integer.parseInt(System.getProperty("test.serverPort", "1527"));
    BaseTestSuite suite = new BaseTestSuite("TestPreStartedSlaveServer");
    suite.addTest(TestPreStartedSlaveServer.suite(slaveServerHost, slaveServerPort));
    System.out.println("*** Done suite.addTest(TestPreStartedSlaveServer.suite())");
    return (Test) suite;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 92 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class _Suite method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("BasicPerf");
    suite.addTest(ValuesTest.suite());
    suite.addTest(CountTest.suite());
    suite.addTest(HeapScan.suite());
    suite.addTest(CoveredIdxScan.suite());
    suite.addTest(SortTest.suite());
    suite.addTest(SelectDistinctTest.suite());
    return suite;
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 93 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class BlobAccessTest method suite.

/**
 * Generates a suite of tests.
 * <p>
 * The required test data will be generated. Note that a subset of the
 * tests can be disabled by using a system property.
 *
 * @return A suite of tests.
 */
public static Test suite() {
    BaseTestSuite mainSuite = new BaseTestSuite("BlobAccessTest suite");
    if (!disableSmallBlobs) {
        int iters = 50;
        int reps = 3;
        println("Adding small Blob tests.");
        BaseTestSuite smallSuite = new BaseTestSuite("Small Blob suite");
        smallSuite.addTest(new BlobAccessTest("testFetchSmallBlobs", iters, reps));
        smallSuite.addTest(new BlobAccessTest("testFetchSmallBlobsInaccurateLength", iters, reps));
        smallSuite.addTest(new BlobAccessTest("testModifySmallBlobs", iters, reps));
        mainSuite.addTest(smallSuite);
    }
    if (!disableLargeBlobs) {
        int iters = 5;
        int reps = 3;
        println("Adding large Blob tests.");
        BaseTestSuite largeSuite = new BaseTestSuite("Large Blob suite");
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlobs", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlobOneByOneByteBaseline", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlobOneByOneByteModified", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlobOneByOneByte", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlob", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlobModified", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlobPieceByPiece", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testFetchLargeBlobPieceByPieceModified", iters, reps));
        largeSuite.addTest(new BlobAccessTest("testLargeBlobGetLength", iters, reps));
        mainSuite.addTest(largeSuite);
    }
    if (!disableConcurrencyTest) {
        mainSuite.addTest(new BlobAccessTest("testConcurrency", 1, 1));
    }
    return new CleanDatabaseTestSetup(mainSuite) {

        protected void decorateSQL(Statement stmt) throws SQLException {
            try {
                initializeBlobData(stmt);
            } catch (UnsupportedEncodingException uee) {
                // Compiled with JDK 1.4, can't use constructor.
                SQLException sqle = new SQLException();
                sqle.initCause(uee);
                throw sqle;
            }
        }
    };
}
Also used : CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) SQLException(java.sql.SQLException) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) UnsupportedEncodingException(java.io.UnsupportedEncodingException) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 94 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class CountTest method suite.

/**
 * Suite of tests to return.
 */
public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("CountTest");
    int iterations = 1200, repeats = 4;
    suite.addTest(new CountTest("Count100", iterations, repeats));
    return new BaseLoad100TestSetup(suite, rowcount, tableName);
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 95 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class CoveredIdxScan method suite.

/**
 * @return suite of tests
 */
public static Test suite() {
    BaseTestSuite scan = new BaseTestSuite("CoveredIdxScanTests");
    int iterations = 700, repeats = 4;
    scan.addTest(new CoveredIdxScan("ScanCoveredIdxInt", iterations, repeats));
    return new BaseLoad100IdxTestSetup(scan, rowcount * 2, tableName);
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Aggregations

BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)476 Test (junit.framework.Test)136 CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)118 Statement (java.sql.Statement)81 PreparedStatement (java.sql.PreparedStatement)68 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)49 Properties (java.util.Properties)43 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)34 CallableStatement (java.sql.CallableStatement)19 Connection (java.sql.Connection)14 SecurityManagerSetup (org.apache.derbyTesting.junit.SecurityManagerSetup)13 DatabasePropertyTestSetup (org.apache.derbyTesting.junit.DatabasePropertyTestSetup)11 TestSetup (junit.extensions.TestSetup)10 SQLException (java.sql.SQLException)7 LocaleTestSetup (org.apache.derbyTesting.junit.LocaleTestSetup)7 Method (java.lang.reflect.Method)5 Locale (java.util.Locale)5 BaseJDBCTestSetup (org.apache.derbyTesting.junit.BaseJDBCTestSetup)4 NetworkServerTestSetup (org.apache.derbyTesting.junit.NetworkServerTestSetup)4 ResultSet (java.sql.ResultSet)3