File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed
androidInstrumentedTest/kotlin/com/ctrip/sqllin/dsl
commonTest/kotlin/com/ctrip/sqllin/dsl
jvmTest/kotlin/com/ctrip/sqllin/dsl
nativeTest/kotlin/com/ctrip/sqllin/dsl Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
2222import androidx.test.platform.app.InstrumentationRegistry
2323import com.ctrip.sqllin.driver.toDatabasePath
2424import org.junit.After
25+ import org.junit.Before
2526import org.junit.Test
2627import org.junit.runner.RunWith
2728
@@ -67,6 +68,12 @@ class AndroidTest {
6768 @Test
6869 fun testJoinClause () = commonTest.testJoinClause()
6970
71+ @Before
72+ fun setUp () {
73+ val context = InstrumentationRegistry .getInstrumentation().targetContext
74+ context.deleteDatabase(CommonBasicTest .DATABASE_NAME )
75+ }
76+
7077 @After
7178 fun setDown () {
7279 val context = InstrumentationRegistry .getInstrumentation().targetContext
Original file line number Diff line number Diff line change @@ -345,7 +345,6 @@ class CommonBasicTest(private val path: DatabasePath) {
345345 name = DATABASE_NAME ,
346346 path = path,
347347 version = 1 ,
348- inMemory = true ,
349348 create = {
350349 it.execSQL(SQL_CREATE_BOOK )
351350 it.execSQL(SQL_CREATE_CATEGORY )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package com.ctrip.sqllin.dsl
1919import com.ctrip.sqllin.driver.deleteDatabase
2020import com.ctrip.sqllin.driver.toDatabasePath
2121import kotlin.test.AfterTest
22+ import kotlin.test.BeforeTest
2223import kotlin.test.Test
2324
2425/* *
@@ -61,6 +62,11 @@ class JvmTest {
6162 @Test
6263 fun testJoinClause () = commonTest.testJoinClause()
6364
65+ @BeforeTest
66+ fun setUp () {
67+ deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
68+ }
69+
6470 @AfterTest
6571 fun setDown () {
6672 deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package com.ctrip.sqllin.dsl
1919import com.ctrip.sqllin.driver.deleteDatabase
2020import com.ctrip.sqllin.driver.toDatabasePath
2121import kotlin.test.AfterTest
22+ import kotlin.test.BeforeTest
2223import kotlin.test.Test
2324
2425/* *
@@ -61,6 +62,11 @@ class NativeTest {
6162 @Test
6263 fun testJoinClause () = commonTest.testJoinClause()
6364
65+ @BeforeTest
66+ fun setUp () {
67+ deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
68+ }
69+
6470 @AfterTest
6571 fun setDown () {
6672 deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
You can’t perform that action at this time.
0 commit comments