FileDocCategorySizeDatePackage
JDBCDriverFunctionalTest.javaAPI DocAndroid 1.5 API3095Wed May 06 22:41:06 BST 2009tests.SQLite

JDBCDriverFunctionalTest

public class JDBCDriverFunctionalTest extends AbstractSqlTest
Tests the SQLite.JDBCDriver.

Fields Summary
private File
dbFile
The SQLite db file.
private String
connectionURL
Constructors Summary
Methods Summary
protected java.lang.StringgetConnectionURL()

        if (connectionURL.equals("empty")) {
            String tmp = System.getProperty("java.io.tmpdir");
            File tmpDir = new File(tmp);
            if (tmpDir.isDirectory()) {
                try {
                    dbFile = File.createTempFile("JDBCDriverFunctionalTest",
                            ".db", tmpDir);
                } catch (IOException e) {
                    System.err.println("error creating temporary DB file.");
                }
                dbFile.deleteOnExit();
            } else {
                System.err.println("java.io.tmpdir does not exist");
            }

            connectionURL = "jdbc:sqlite:/" + dbFile.getPath();

        }

        return connectionURL;
    
protected java.lang.StringgetDriverClassName()

        return "SQLite.JDBCDriver";
    
protected intgetTransactionIsolation()

        return Connection.TRANSACTION_SERIALIZABLE;
    
public voidsetUp()
Sets up an unit test by loading the SQLite.JDBCDriver, getting two connections and calling the setUp method of the super class.

throws
Exception
throws
IllegalAccessException
throws
InstantiationException
throws
Exception
throws
Exception
throws
Exception
throws
Exception
throws
Exception


                                                      
    
              // the Exception class needs to be fully
        // qualified since there is an Exception
        // class in the SQLite package.

        super.setUp();
    
protected voidtearDown()
Tears down an unit test by calling the tearDown method of the super class and deleting the SQLite test db file.

        super.tearDown();
        dbFile.delete();