|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
|
package net.pokeranalytics.android |
|
|
|
|
|
|
|
|
|
import android.os.Looper |
|
|
|
|
import io.realm.Realm |
|
|
|
|
import io.realm.RealmConfiguration |
|
|
|
|
import org.junit.After |
|
|
|
|
@ -15,18 +14,22 @@ open class RealmInstrumentedUnitTest { |
|
|
|
|
@Before |
|
|
|
|
fun setup() { |
|
|
|
|
|
|
|
|
|
Looper.prepare() |
|
|
|
|
// Looper.prepare() |
|
|
|
|
|
|
|
|
|
val testConfig = RealmConfiguration.Builder().inMemory().name("test-realm").build() |
|
|
|
|
Realm.setDefaultConfiguration(testConfig) |
|
|
|
|
this.mockRealm = Realm.getDefaultInstance() |
|
|
|
|
|
|
|
|
|
this.mockRealm.executeTransaction { |
|
|
|
|
this.mockRealm.deleteAll() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@After |
|
|
|
|
@Throws(Exception::class) |
|
|
|
|
public fun tearDown() { |
|
|
|
|
Looper.loop() |
|
|
|
|
// Looper.loop() |
|
|
|
|
this.mockRealm.close() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|