SQLDroid/SQLDroid — pull request #27 by dperiwal (2014-01-24 23:12:05+00:00)
Title: - Made changes to enable testing on an Android emulator.

- Added AndroidManifest.xml.
- Added method setupDatabaseFileAndJDBCDriver(String dbFile) to refactor code pertaining to initializing a database and the JDBC driver.
- Added tests for ResultSets in a new method testResultsSets().

Here are the steps to create an Eclipse project and run the tests:

1: Create a new Android test project in Eclipse (File -> New -> Project -> Android -> Android Test Project). Give a Project Name say SQLDroidTest. Hit the Next button.

2: Select Test Target as "This project". Choosing your local SQLDroid project may also work, but I have not tried that path. Hit the Next button.

3: Keep build target as Android 3.0 (API level 11) or higher. There are some compilation problems if the API level is less than 11. Hit the Finish button to create the Android Test Project SQLDroidTest.

4: In the AndroidManifest.xml file, change the settings of both the package and android:targetPackage tags to "org.sqldroid", if they are something else.

5: Add (Copy) the DriverUnitTest.java file under src/org/sqldroid directory of the project. You may have to create the directory.

6: Click Project->Properties->Java Build Path->Libraries->Add External Jars button to add the sqldroid.jar file to be tested.

7: Under Project->Properties->Java Build Path->Order and Export, check the box for sqldroid.jar.

8: Build the project.

9: Run the tests by clicking Run As -> Android JUnit Test.

In my setup of Eclipse, the test results are shown in a tab named JUnit which is next to Package Explorer tab.