-
Notifications
You must be signed in to change notification settings - Fork 39
Roboelectric tests failing. Unable to resolve SQLite database connection #4
Comments
I'm getting this same stack trace in one of my tests that is setting up a |
@rvenugopal I found that the issue (for me anyway) was with Java |
@leviwilson , thanks man. I will try it out. PS : I have not Open sourced it simply cause it is not a starter kit like this one, but just a working project. |
FYI/FWIW - AndroidIntelliJStarter is now mavenized. Also, you may want to On Thu, Apr 11, 2013 at 5:06 AM, Rao Venu [email protected] wrote:
|
@leviwilson I am getting this same stack trace when I am trying to run any tests that use a SQLite database in eclipse. The tests, however, will work when their test class is run individually, but when i try to run all the tests in the project the tests fail. Why would they work individually but not in a group? |
When I try the "Run tests" step from the instructions, a few tests fail which causes the build to fail
Run tests(step from the instructions) :
cd path_to_your_project_repo && (cd submodules/robolectric && ant clean findAndroidUnix && ant test) && ant clean test
The failing tests are
[junit] Test com.xtremelabs.robolectric.shadows.CursorAdapterTest FAILED
[junit] Test com.xtremelabs.robolectric.shadows.MergeCursorTest FAILED
[junit] Test com.xtremelabs.robolectric.shadows.SQLiteCursorTest FAILED
[junit] Test com.xtremelabs.robolectric.shadows.SQLiteDatabaseTest FAILED
[junit] Test com.xtremelabs.robolectric.shadows.SQLiteOpenHelperTest FAILED
[junit] Test com.xtremelabs.robolectric.shadows.SQLiteStatementTest FAILED
Looking at the reports, they all have a stack trace similar to the following
java.lang.NullPointerException
at org.sqlite.NestedDB$CausedSQLException.fillInStackTrace(NestedDB.java:649)
at java.lang.Throwable.(Throwable.java:250)
at java.lang.Exception.(Exception.java:54)
at java.sql.SQLException.(SQLException.java:140)
at org.sqlite.NestedDB$CausedSQLException.(NestedDB.java:626)
at org.sqlite.NestedDB._open(NestedDB.java:63)
at org.sqlite.DB.open(DB.java:86)
at org.sqlite.Conn.open(Conn.java:140)
at org.sqlite.Conn.(Conn.java:57)
at org.sqlite.JDBC.createConnection(JDBC.java:77)
at org.sqlite.JDBC.connect(JDBC.java:64)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:243)
at com.xtremelabs.robolectric.util.DatabaseConfig.getMemoryConnection(DatabaseConfig.java:69)
at com.xtremelabs.robolectric.shadows.CursorAdapterTest.setUp(CursorAdapterTest.java:38)
at com.xtremelabs.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:288)
It appears that database connection is not being resolved in DatabaseConfig.java (submodules/robolectric/src/main/java/com/xtremelabs/robolectric/util/DatabaseConfig.java)
Thanks
-Venu
The text was updated successfully, but these errors were encountered: