pivotal/robolectric — pull request #272 by perlow (2012-06-05 04:58:56+00:00)
Title: Fix various issues in sqlite implementation.

- The lifetime of a database was previously tied to the SQLiteDatabase instance. This
is not the appropriate android behavior and breaks code that opens and closes the
same database path mulitple times. The behavior is changed to cache the database
connection which can then be shared across multiple SQLiteDatabase instances. A
new helper method ShadowSQLiteDatabase.deleteDatabase is added which a test can
use to delete the database. The database now supports the path and name parameter
such that calls with the same path/name reference the same database file.

This is a breaking change for tests. All tests in the project were updated to
handle the new behavior.

- Added missing implementations of various methods in ShadowSQLiteDatabase and
ShadowSQLiteQueryBuilder.

- Fixed nested transactions in ShadowSQLiteDatabase. The android implementation
supports nested transactions such that a transaction is only committed when its
outer-most transaction is ended successfully. I copied the logic from the
Android implementation to match the correct behavior. Also fixed the locking
semantics in this area to mach Android. Because h2/sqlite differ in how
transactions work, I made sqlite match the android behavior and maintained
backwards compatability with how the code was previously using h2.

- Removed some dead code from ShadowSQLiteDatabase.