2
2
* Copyright 2016-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
4
5
- package kotlinx.coroutines.guava
5
+ package kotlinx.coroutines
6
6
7
7
import com.google.common.reflect.*
8
8
import kotlinx.coroutines.*
9
9
import org.junit.Test
10
10
import kotlin.test.*
11
11
12
- class ListAllCoroutineThrowableSubclassesTest : TestBase () {
12
+ class ListAllCoroutineThrowableSubclassesTest {
13
13
14
14
/*
15
15
* These are all known throwables in kotlinx.coroutines.
16
16
* If you have added one, this test will fail to make
17
17
* you ensure your exception type is java.io.Serializable.
18
18
*
19
19
* We do not have means to check it automatically, so checks are delegated to humans.
20
- * Also, this test meant to be in kotlinx-coroutines-core, but properly scanning classpath
21
- * requires guava which is toxic dependency that we'd like to avoid even in tests.
22
20
*
23
21
* See #3328 for serialization rationale.
24
22
*/
@@ -33,7 +31,6 @@ class ListAllCoroutineThrowableSubclassesTest : TestBase() {
33
31
" kotlinx.coroutines.channels.ClosedReceiveChannelException" ,
34
32
" kotlinx.coroutines.flow.internal.ChildCancelledException" ,
35
33
" kotlinx.coroutines.flow.internal.AbortFlowException" ,
36
-
37
34
)
38
35
39
36
@Test
@@ -44,15 +41,11 @@ class ListAllCoroutineThrowableSubclassesTest : TestBase() {
44
41
classes.forEach {
45
42
try {
46
43
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
- }
51
44
++ throwables
52
45
// println(""""$it",""")
53
46
assertTrue(knownThrowables.contains(it.toString()))
54
47
}
55
- } catch (e: Throwable ) {
48
+ } catch (e: LinkageError ) {
56
49
// Ignore unloadable classes
57
50
}
58
51
}
0 commit comments