Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
davedesro opened this issue Sep 16, 2011 · 5 comments

Comments

@davedesro
Copy link

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:

robolectric/robolectric@b2a0c46#src/test/java/com/xtremelabs/robolectric/shadows/SQLiteDatabaseTest.java

Any idea?

thanks!!

@cessationoftime
Copy link
Owner

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
Copy link
Owner

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

@cessationoftime
Copy link
Owner

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

@davedesro
Copy link
Author

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

@cessationoftime
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants