diff options
author | Rex Hoffman <rexhoffman@google.com> | 2023-11-20 18:45:21 +0000 |
---|---|---|
committer | Rex Hoffman <rexhoffman@google.com> | 2023-11-20 19:03:20 +0000 |
commit | 62069d3f0f27e349274869b5fd6552558096ad2c (patch) | |
tree | d81deb8bf8b61b7e593c0dd893ff8dcee9303a8e /utils | |
parent | ecd0d05c67d737b8a4ee0c8da2376be671863fd4 (diff) | |
parent | fcd5292155ec5e946b7a23c02f128824fcd443fe (diff) | |
download | robolectric-62069d3f0f27e349274869b5fd6552558096ad2c.tar.gz |
Merge branch 'upstream-google' into sync_upstream
Test: CI
Bug: 304328861
Change-Id: Icc02efa6120d797dbaef8becdb42616d6aefd0a2
Diffstat (limited to 'utils')
-rw-r--r-- | utils/build.gradle | 1 | ||||
-rw-r--r-- | utils/src/test/java/org/robolectric/util/PerfStatsCollectorTest.kt | 4 | ||||
-rw-r--r-- | utils/src/test/java/org/robolectric/util/SchedulerTest.kt | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/utils/build.gradle b/utils/build.gradle index 54a2531e2..342d22990 100644 --- a/utils/build.gradle +++ b/utils/build.gradle @@ -6,6 +6,7 @@ apply plugin: RoboJavaModulePlugin apply plugin: 'kotlin' apply plugin: DeployedRoboJavaModulePlugin apply plugin: "com.diffplug.spotless" +apply plugin: "io.gitlab.arturbosch.detekt" spotless { kotlin { diff --git a/utils/src/test/java/org/robolectric/util/PerfStatsCollectorTest.kt b/utils/src/test/java/org/robolectric/util/PerfStatsCollectorTest.kt index ec0a22168..1c7e7ab49 100644 --- a/utils/src/test/java/org/robolectric/util/PerfStatsCollectorTest.kt +++ b/utils/src/test/java/org/robolectric/util/PerfStatsCollectorTest.kt @@ -71,10 +71,10 @@ class PerfStatsCollectorTest { try { collector.measure<Any, RuntimeException>("event") { fakeClock.delay(5) - throw RuntimeException("fake") + throw IllegalThreadStateException("fake") } Assert.fail("should have thrown") - } catch (e: RuntimeException) { + } catch (e: IllegalThreadStateException) { assertThat(e.message).isEqualTo("fake") } val metrics = collector.metrics diff --git a/utils/src/test/java/org/robolectric/util/SchedulerTest.kt b/utils/src/test/java/org/robolectric/util/SchedulerTest.kt index 00e161a08..309d99dad 100644 --- a/utils/src/test/java/org/robolectric/util/SchedulerTest.kt +++ b/utils/src/test/java/org/robolectric/util/SchedulerTest.kt @@ -384,11 +384,11 @@ class SchedulerTest { val runnablesThatWereRun: MutableList<Int> = ArrayList() scheduler.post { runnablesThatWereRun.add(1) - throw RuntimeException("foo") + throw IllegalThreadStateException("foo") } try { scheduler.unPause() - } catch (ignored: RuntimeException) {} + } catch (ignored: IllegalThreadStateException) {} scheduler.post { runnablesThatWereRun.add(2) } assertThat(runnablesThatWereRun).containsExactly(1, 2) } |