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

Failed to generate coverage report for test cases #182

Open
davidyoung8906 opened this issue May 31, 2012 · 1 comment
Open

Failed to generate coverage report for test cases #182

davidyoung8906 opened this issue May 31, 2012 · 1 comment

Comments

@davidyoung8906
Copy link

I'm running well with all the test cases with Junit. But when I use "ant coverage" trying to generate test cases report, The error below appears:

[exec] com.todoroo.astrid.dao.TaskDaoTests:.....INSTRUMENTATION_RESULT: shortMsg=java.lang.IllegalStateException
[exec] INSTRUMENTATION_RESULT: longMsg=java.lang.IllegalStateException: database /data/data/com.timsu.astrid/databases/databasetest (conn# 0) already closed
[exec] INSTRUMENTATION_CODE: 0
[echo] Downloading coverage file into project directory...
[exec] remote object '/data/data/com.timsu.astrid/coverage.ec' does not exist

BUILD FAILED

On the logcat, it shows that:

05-30 18:19:20.287: E/AndroidRuntime(8656): FATAL EXCEPTION: Thread-351
05-30 18:19:20.287: E/AndroidRuntime(8656): java.lang.IllegalStateException: database /data/data/com.timsu.astrid/databases/databasetest (conn# 0) already closed
05-30 18:19:20.287: E/AndroidRuntime(8656): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
05-30 18:19:20.287: E/AndroidRuntime(8656): at android.database.sqlite.SQLiteDatabase.lock(SQLiteDatabase.java:413)
05-30 18:19:20.287: E/AndroidRuntime(8656): at android.database.sqlite.SQLiteDatabase.lock(SQLiteDatabase.java:400)
05-30 18:19:20.287: E/AndroidRuntime(8656): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:79)
05-30 18:19:20.287: E/AndroidRuntime(8656): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:160)
05-30 18:19:20.287: E/AndroidRuntime(8656): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:152)
05-30 18:19:20.287: E/AndroidRuntime(8656): at android.database.CursorWrapper.getCount(CursorWrapper.java:53)
05-30 18:19:20.287: E/AndroidRuntime(8656): at com.todoroo.astrid.service.TaskService.countTasks(TaskService.java:371)
05-30 18:19:20.287: E/AndroidRuntime(8656): at com.todoroo.astrid.backup.TasksXmlExporter$2.run(TasksXmlExporter.java:113)
05-30 18:19:20.287: E/AndroidRuntime(8656): at java.lang.Thread.run(Thread.java:856)

Seems like something wrong with sqlite part, but never occured during the execution of JUnit test cases.
Any comment is welcomed!

@timsu
Copy link

timsu commented May 31, 2012

That's kind of weird. Our code coverage is pretty bad, unfortunately, but this is the ant command that we use:

cd astrid
ant all clean 
cd ../tests
ant clean emma debug install coverage

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