Skip to content

Android Unit test failed when using SqlCipher DB #105

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

Closed
sunilmishra opened this issue Sep 30, 2013 · 3 comments
Closed

Android Unit test failed when using SqlCipher DB #105

sunilmishra opened this issue Sep 30, 2013 · 3 comments

Comments

@sunilmishra
Copy link

Hi,

I am facing problem when using sqlcipher in my project. My project is running fine without UnitTest with Cipher.

But when using Cipher,
09-30 15:53:32.877: I/TestRunner(11663): java.lang.NullPointerException
09-30 15:53:32.877: I/TestRunner(11663): at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:101)

Can you please suggest me how to resolve this issue.

@developernotes
Copy link
Member

Hello sunilmishra,

SQLCipher for Android must run on device or emulator. Where are you executing your unit tests?

@PareshMayani
Copy link

@developernotes when using SQLCipher, can we write test cases using Robolectric? Would it work because Robolectric executes test cases on JVM!

@developernotes
Copy link
Member

Hello @PareshMayani

Unfortunately that would not work. While Robolectric does run its tests on the JVM, SQLCipher for Android contains native libraries that target specific platforms for the Android runtime, thus they would not run on the JVM that is on your desktop. As an alternative, we have put together a SQLCipher for Android test suite which allows you to run JUnit-esque tests that would run on device/emulator.

@sqlcipher sqlcipher locked and limited conversation to collaborators Jul 31, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants