cessationoftime / robolectric-sqlite

Provides the SQLiteMap class to allow use of the SQLite database with Robolectric.
5 stars 2 forks source link

robolectric test "testFailureTransaction" fails in robolectric-sqlite mvn clean test #1

Open davedesro opened 13 years ago

davedesro commented 13 years ago

Hi! thanks a bunch for this jar! It enabled us to use google analytics in our project :) We had to comment out a test in robolectric, though...

Tests in error: testFailureTransaction(com.xtremelabs.robolectric.shadows.SQLiteDatabaseTest)

It likely started breaking with this recent robolectric commit:

https://github.com/pivotal/robolectric/commit/b2a0c4643204a58730caf4e178e6acb36db79a5d#src/test/java/com/xtremelabs/robolectric/shadows/SQLiteDatabaseTest.java

Any idea?

thanks!!

cessationoftime commented 13 years ago

The implementation of transactions in Robolectric is too simple for SQLite. I'm not sure what exactly what to do about it at the moment, it will take more investigation than the 2 hours I put in tonight to understand it. And I currently don't have the time to spare.

cessationoftime commented 13 years ago

I'm glad someone else is using making use of this project though!

cessationoftime commented 13 years ago

it looks as though locking needs to be set up wherever robolectric writes to the database, so multithreading works properly.

davedesro commented 12 years ago

Is this something that needs to be done in robolectric-sqlite or somewhere else?

cessationoftime commented 12 years ago

This would need to be added to the Shadow classes of Robolectric itself, primarily ShadowSQLiteDatabase

Though it would probably be easier\better to just use Robolectric 2.0 (the Reviscerated branch) with the real android jars. Though that branch needs a bit of work before sqlite works on it. Which I intend to do once the Android sourcecode is available again, Currently http://android.git.kernel.org/ is down. See the following post about the reviscerated branch: http://robolectric.blogspot.com/2011/08/using-robolectric-with-real-android.html