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
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
22
22
import androidx.test.platform.app.InstrumentationRegistry
23
23
import com.ctrip.sqllin.driver.toDatabasePath
24
24
import org.junit.After
25
+ import org.junit.Before
25
26
import org.junit.Test
26
27
import org.junit.runner.RunWith
27
28
@@ -67,6 +68,12 @@ class AndroidTest {
67
68
@Test
68
69
fun testJoinClause () = commonTest.testJoinClause()
69
70
71
+ @Before
72
+ fun setUp () {
73
+ val context = InstrumentationRegistry .getInstrumentation().targetContext
74
+ context.deleteDatabase(CommonBasicTest .DATABASE_NAME )
75
+ }
76
+
70
77
@After
71
78
fun setDown () {
72
79
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) {
345
345
name = DATABASE_NAME ,
346
346
path = path,
347
347
version = 1 ,
348
- inMemory = true ,
349
348
create = {
350
349
it.execSQL(SQL_CREATE_BOOK )
351
350
it.execSQL(SQL_CREATE_CATEGORY )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package com.ctrip.sqllin.dsl
19
19
import com.ctrip.sqllin.driver.deleteDatabase
20
20
import com.ctrip.sqllin.driver.toDatabasePath
21
21
import kotlin.test.AfterTest
22
+ import kotlin.test.BeforeTest
22
23
import kotlin.test.Test
23
24
24
25
/* *
@@ -61,6 +62,11 @@ class JvmTest {
61
62
@Test
62
63
fun testJoinClause () = commonTest.testJoinClause()
63
64
65
+ @BeforeTest
66
+ fun setUp () {
67
+ deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
68
+ }
69
+
64
70
@AfterTest
65
71
fun setDown () {
66
72
deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package com.ctrip.sqllin.dsl
19
19
import com.ctrip.sqllin.driver.deleteDatabase
20
20
import com.ctrip.sqllin.driver.toDatabasePath
21
21
import kotlin.test.AfterTest
22
+ import kotlin.test.BeforeTest
22
23
import kotlin.test.Test
23
24
24
25
/* *
@@ -61,6 +62,11 @@ class NativeTest {
61
62
@Test
62
63
fun testJoinClause () = commonTest.testJoinClause()
63
64
65
+ @BeforeTest
66
+ fun setUp () {
67
+ deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
68
+ }
69
+
64
70
@AfterTest
65
71
fun setDown () {
66
72
deleteDatabase(path, CommonBasicTest .DATABASE_NAME )
You can’t perform that action at this time.
0 commit comments