Last active
January 18, 2019 09:41
-
-
Save grumpyshoe/98ea7feb8b67d16c828e480c22322730 to your computer and use it in GitHub Desktop.
TestRunner using custom Application implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class MockTestRunner : AndroidJUnitRunner() { | |
override fun onCreate(arguments: Bundle) { | |
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().permitAll().build()) | |
super.onCreate(arguments) | |
} | |
@Throws(InstantiationException::class, IllegalAccessException::class, ClassNotFoundException::class) | |
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application { | |
return super.newApplication(cl, TestAppApplication::class.java.name, context) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment