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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> |
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
{ | |
"artifacts": { | |
"Flagship-debug": { | |
":artifact:sha1": "file:///Users/cazhang/voyager-android_trunk/Flagship/build/temp-publish/com/linkedin/voyager-android/Flagship-debug/0.675.62-SNAPSHOT/Flagship-debug-0.675.62-SNAPSHOT.aab.sha1", | |
":artifact:sha256": "file:///Users/cazhang/voyager-android_trunk/Flagship/build/temp-publish/com/linkedin/voyager-android/Flagship-debug/0.675.62-SNAPSHOT/Flagship-debug-0.675.62-SNAPSHOT.aab.sha256", | |
":artifact:sha512": "file:///Users/cazhang/voyager-android_trunk/Flagship/build/temp-publish/com/linkedin/voyager-android/Flagship-debug/0.675.62-SNAPSHOT/Flagship-debug-0.675.62-SNAPSHOT.aab.sha512", | |
":ivyfile:sha1": "file:///Users/cazhang/voyager-android_trunk/Flagship/build/temp-publish/com/linkedin/voyager-android/Flagship-debug/0.675.62-SNAPSHOT/Flagship-debug-0.675.62-SNAPSHOT.ivy.sha1", | |
":ivyfile:sha256": "file:///Users/cazhang/voyager-android_trunk/Flagship/build/temp-publish/com/linkedin/voyager-android |
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
@Test | |
fun testReexecution() = runBlockingTest { | |
val source = MutableStateFlow(1) | |
val liveData = source.flatMapConcat { | |
flowOf(it, it * 10) // Could be actual network request | |
}.asLiveData() | |
val observer = object : Observer<Int> { | |
var observeHistory = mutableListOf<Int>() | |
override fun onChanged(t: Int) { | |
observeHistory.add(t) |
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
class FlowLiveDataTest { | |
@Rule | |
@JvmField | |
val rule = InstantTaskExecutorRule() | |
private val testDispatcher = TestCoroutineDispatcher() | |
@Before | |
fun setup() { |
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
@MainThread | |
fun cancel() { | |
if (cancellationJob != null) { | |
error("Cancel call cannot happen without a maybeRun") | |
} | |
cancellationJob = scope.launch(Dispatchers.Main.immediate) { | |
delay(timeoutInMs) | |
if (!liveData.hasActiveObservers()) { | |
// one last check on active observers to avoid any race condition between starting | |
// a running coroutine and cancelation |
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
@MainThread | |
fun cancel() { | |
if (cancellationJob != null) { | |
error("Cancel call cannot happen without a maybeRun") | |
} | |
cancellationJob = scope.launch(Dispatchers.Main.immediate) { | |
delay(timeoutInMs) | |
if (!liveData.hasActiveObservers()) { | |
// one last check on active observers to avoid any race condition between starting | |
// a running coroutine and cancelation |
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
@Test | |
fun testDefaultTimeoutInBlock() = runBlockingTest { | |
val testCoroutineDispatcher = TestCoroutineDispatcher() | |
val source = MutableStateFlow(1) | |
val liveData = source.asLiveData( | |
context = testCoroutineDispatcher | |
) | |
val observer = object : Observer<Int> { | |
var observeHistory = mutableListOf<Int>() |
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
@Test | |
fun testDefaultTimeout() = runBlockingTest { | |
val source = MutableStateFlow(1) | |
val liveData = source.asLiveData() | |
val observer = object : Observer<Int> { | |
var observeHistory = mutableListOf<Int>() | |
override fun onChanged(t: Int) { | |
observeHistory.add(t) | |
} |
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
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts | |
index 245bc546a..98067412c 100644 | |
--- a/buildSrc/build.gradle.kts | |
+++ b/buildSrc/build.gradle.kts | |
@@ -19,7 +19,7 @@ object Plugins { | |
const val SHADOW = "6.1.0" | |
const val VERSIONS = "0.28.0" | |
const val SONAR = "2.8" | |
- const val DOKKA = "1.4.10" | |
+ const val DOKKA = "1.4.32" |
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
{ | |
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", | |
"version": "2.1.0", | |
"runs": [ | |
{ | |
"tool": { | |
"driver": { | |
"downloadUri": "https://github.com/checkstyle/checkstyle/releases/", | |
"fullName": "Checkstyle", | |
"informationUri": "https://checkstyle.org/", |