Skip to content

Commit bd26f72

Browse files
committed
Move ListAllCoroutineThrowableSubclassesTest to integration-testing and fix assertion
1 parent e32aa78 commit bd26f72

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

integration-testing/build.gradle

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ dependencies {
2323
}
2424

2525
sourceSets {
26+
test {
27+
kotlin
28+
dependencies {
29+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
30+
implementation 'com.google.guava:guava:31.1-jre'
31+
}
32+
}
2633
mavenTest {
2734
kotlin
2835
compileClasspath += sourceSets.test.runtimeClasspath
@@ -89,5 +96,5 @@ compileTestKotlin {
8996
}
9097

9198
check {
92-
dependsOn([mavenTest, debugAgentTest, coreAgentTest, 'smokeTest:build'])
99+
dependsOn([test, mavenTest, debugAgentTest, coreAgentTest, 'smokeTest:build'])
93100
}

integration/kotlinx-coroutines-guava/test/ListAllCoroutineThrowableSubclassesTest.kt renamed to integration-testing/src/test/kotlin/ListAllCoroutineThrowableSubclassesTest.kt

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* Copyright 2016-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
package kotlinx.coroutines.guava
5+
package kotlinx.coroutines
66

77
import com.google.common.reflect.*
88
import kotlinx.coroutines.*
99
import org.junit.Test
1010
import kotlin.test.*
1111

12-
class ListAllCoroutineThrowableSubclassesTest : TestBase() {
12+
class ListAllCoroutineThrowableSubclassesTest {
1313

1414
/*
1515
* These are all known throwables in kotlinx.coroutines.
@@ -33,7 +33,6 @@ class ListAllCoroutineThrowableSubclassesTest : TestBase() {
3333
"kotlinx.coroutines.channels.ClosedReceiveChannelException",
3434
"kotlinx.coroutines.flow.internal.ChildCancelledException",
3535
"kotlinx.coroutines.flow.internal.AbortFlowException",
36-
3736
)
3837

3938
@Test
@@ -44,15 +43,11 @@ class ListAllCoroutineThrowableSubclassesTest : TestBase() {
4443
classes.forEach {
4544
try {
4645
if (Throwable::class.java.isAssignableFrom(it.load())) {
47-
// Skip classes from test sources
48-
if (it.load().protectionDomain.codeSource.location.toString().contains("/test/")) {
49-
return@forEach
50-
}
5146
++throwables
5247
// println(""""$it",""")
5348
assertTrue(knownThrowables.contains(it.toString()))
5449
}
55-
} catch (e: Throwable) {
50+
} catch (e: LinkageError) {
5651
// Ignore unloadable classes
5752
}
5853
}

0 commit comments

Comments
 (0)