You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kotlinx-coroutines-test/api/kotlinx-coroutines-test.api
+10-3
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ public final class kotlinx/coroutines/test/TestCoroutineDispatcher : kotlinx/cor
51
51
52
52
public final class kotlinx/coroutines/test/TestCoroutineExceptionHandler : kotlin/coroutines/AbstractCoroutineContextElement, kotlinx/coroutines/CoroutineExceptionHandler, kotlinx/coroutines/test/UncaughtExceptionCaptor {
53
53
public fun <init> ()V
54
-
public fun cleanupTestCoroutinesCaptor ()V
54
+
public fun cleanupTestCoroutines ()V
55
55
public fun getUncaughtExceptions ()Ljava/util/List;
56
56
public fun handleException (Lkotlin/coroutines/CoroutineContext;Ljava/lang/Throwable;)V
57
57
}
@@ -68,9 +68,10 @@ public final class kotlinx/coroutines/test/TestCoroutineScheduler : kotlin/corou
68
68
public final class kotlinx/coroutines/test/TestCoroutineScheduler$Key : kotlin/coroutines/CoroutineContext$Key {
69
69
}
70
70
71
-
public abstract interface class kotlinx/coroutines/test/TestCoroutineScope : kotlinx/coroutines/CoroutineScope, kotlinx/coroutines/test/UncaughtExceptionCaptor {
71
+
public abstract interface class kotlinx/coroutines/test/TestCoroutineScope : kotlinx/coroutines/CoroutineScope {
72
72
public abstract fun cleanupTestCoroutines ()V
73
73
public abstract fun getTestScheduler ()Lkotlinx/coroutines/test/TestCoroutineScheduler;
74
+
public abstract fun reportException (Ljava/lang/Throwable;)V
74
75
}
75
76
76
77
public final class kotlinx/coroutines/test/TestCoroutineScope$DefaultImpls {
@@ -85,6 +86,7 @@ public final class kotlinx/coroutines/test/TestCoroutineScopeKt {
85
86
public static final fun createTestCoroutineScope (Lkotlin/coroutines/CoroutineContext;)Lkotlinx/coroutines/test/TestCoroutineScope;
86
87
public static synthetic fun createTestCoroutineScope$default (Lkotlin/coroutines/CoroutineContext;ILjava/lang/Object;)Lkotlinx/coroutines/test/TestCoroutineScope;
87
88
public static final fun getCurrentTime (Lkotlinx/coroutines/test/TestCoroutineScope;)J
89
+
public static final fun getUncaughtExceptions (Lkotlinx/coroutines/test/TestCoroutineScope;)Ljava/util/List;
88
90
public static final fun pauseDispatcher (Lkotlinx/coroutines/test/TestCoroutineScope;)V
89
91
public static final fun pauseDispatcher (Lkotlinx/coroutines/test/TestCoroutineScope;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
90
92
public static final fun resumeDispatcher (Lkotlinx/coroutines/test/TestCoroutineScope;)V
@@ -104,8 +106,13 @@ public final class kotlinx/coroutines/test/TestDispatchers {
104
106
public static final fun setMain (Lkotlinx/coroutines/Dispatchers;Lkotlinx/coroutines/CoroutineDispatcher;)V
105
107
}
106
108
109
+
public final class kotlinx/coroutines/test/TestExceptionHandlerKt {
110
+
public static final fun TestExceptionHandler (Lkotlinx/coroutines/test/TestCoroutineScope;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/CoroutineExceptionHandler;
111
+
public static synthetic fun TestExceptionHandler$default (Lkotlinx/coroutines/test/TestCoroutineScope;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/CoroutineExceptionHandler;
112
+
}
113
+
107
114
public abstract interface class kotlinx/coroutines/test/UncaughtExceptionCaptor {
108
-
public abstract fun cleanupTestCoroutinesCaptor ()V
115
+
public abstract fun cleanupTestCoroutines ()V
109
116
public abstract fun getUncaughtExceptions ()Ljava/util/List;
Copy file name to clipboardExpand all lines: kotlinx-coroutines-test/common/src/TestCoroutineExceptionHandler.kt
+19-10
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,16 @@ import kotlin.coroutines.*
11
11
/**
12
12
* Access uncaught coroutine exceptions captured during test execution.
13
13
*/
14
-
@ExperimentalCoroutinesApi // Since 1.2.1, tentatively till 1.3.0
14
+
@Deprecated(
15
+
"Consider whether a `TestExceptionHandler` would work instead. If not, please report your use case at https://github.com/Kotlin/kotlinx.coroutines/issues.",
16
+
level =DeprecationLevel.WARNING
17
+
)
15
18
publicinterfaceUncaughtExceptionCaptor {
16
19
/**
17
20
* List of uncaught coroutine exceptions.
18
21
*
19
22
* The returned list is a copy of the currently caught exceptions.
20
-
* During [cleanupTestCoroutinesCaptor] the first element of this list is rethrown if it is not empty.
23
+
* During [cleanupTestCoroutines] the first element of this list is rethrown if it is not empty.
21
24
*/
22
25
publicval uncaughtExceptions:List<Throwable>
23
26
@@ -29,33 +32,39 @@ public interface UncaughtExceptionCaptor {
29
32
*
30
33
* @throws Throwable the first uncaught exception, if there are any uncaught exceptions.
31
34
*/
32
-
publicfuncleanupTestCoroutinesCaptor()
35
+
publicfuncleanupTestCoroutines()
33
36
}
34
37
35
38
/**
36
39
* An exception handler that captures uncaught exceptions in tests.
37
40
*/
38
-
@ExperimentalCoroutinesApi // Since 1.2.1, tentatively till 1.3.0
41
+
@Deprecated("You can use `TestExceptionHandler` to define an exception handler that is linked to "+
42
+
"a `TestCoroutineScope`, or define your own `CoroutineExceptionHandler` if you just need to handle uncaught "+
43
+
"exceptions without a special `TestCoroutineScope` integration.", level =DeprecationLevel.WARNING)
0 commit comments