Hello Professor,
For the very first time when I ran my test, both test passed and now when I re-run the test I get an error saying :
Running tests
Test running started
junit.framework.AssertionFailedError: Error: Movie Info Not Inserted Correctly
at com.....moviereview.data.DataBaseTest.testInsertReadRow(DataBaseTest.java:43)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1886)
Finish
and under Android Monitor tab it says:
05-21 20:27:52.324 31594-31615/com.....moviereview I/TestRunner: started: testInsertReadRow(com.....moviereview.data.DataBaseTest)
05-21 20:27:52.338 31594-31615/com.....moviereview E/SQLiteDatabase: Error inserting publish_date=2016-05-12 summary_short=Ben Wheatley adapts J.G. Ballard 2019s futuristic novel about a residential building that descends into decadence and barbarism. display_title=High-Rise
android.database.sqlite.SQLiteException: no such table: reviews (code 1): , while compiling: INSERT INTO reviews(publish_date,summary_short,display_title) VALUES (?,?,?)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1341)
at com.....moviereview.data.DataBaseTest.testInsertReadRow(DataBaseTest.java:42)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:115)
at junit.framework.TestResult.runProtected(TestResult.java:133)
at junit.framework.TestResult.run(TestResult.java:118)
at junit.framework.TestCase.run(TestCase.java:124)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1886)
05-21 20:27:52.340 31594-31615/com.....moviereview I/TestRunner: failed: testInsertReadRow(com.....moviereview.data.DataBaseTest)
05-21 20:27:52.343 31594-31615/com.....moviereview I/TestRunner: finished: testInsertReadRow(com.....moviereview.data.DataBaseTest)
05-21 20:27:52.344 31594-31615/com.....moviereview I/TestRunner: started: testAndroidTestCaseSetupProperly(com.....moviereview.data.DataBaseTest)
05-21 20:27:52.345 31594-31615/com.....moviereview I/TestRunner: finished: testAndroidTestCaseSetupProperly(com.....moviereview.data.DataBaseTest)
05-21 20:27:52.346 31594-31615/com.....moviereview I/TestRunner: passed: testAndroidTestCaseSetupProperly(com.....moviereview.data.DataBaseTest)