@@ -13,7 +13,6 @@ import org.junit.Assert.*
13
13
import org.junit.Test
14
14
import java.io.*
15
15
import java.util.concurrent.*
16
- import kotlin.reflect.*
17
16
import kotlin.test.assertFailsWith
18
17
19
18
class ListenableFutureTest : TestBase () {
@@ -269,21 +268,6 @@ class ListenableFutureTest : TestBase() {
269
268
result.checkFutureException<TestException >()
270
269
}
271
270
272
- @Test
273
- fun testExceptionAggregation () = runTest {
274
- val result = future(Dispatchers .Unconfined ) {
275
- // child crashes
276
- launch(start = CoroutineStart .ATOMIC ) { throw TestException1 (" FAIL" ) }
277
- launch(start = CoroutineStart .ATOMIC ) { throw TestException2 (" FAIL" ) }
278
- throw TestException ()
279
- }
280
-
281
- expect(1 )
282
- result.checkFutureException<TestException >(TestException1 ::class , TestException2 ::class )
283
- yield ()
284
- finish(2 ) // we are not cancelled
285
- }
286
-
287
271
@Test
288
272
fun testExternalCancellation () = runTest {
289
273
val future = future(Dispatchers .Unconfined ) {
@@ -316,13 +300,10 @@ class ListenableFutureTest : TestBase() {
316
300
finish(3 )
317
301
}
318
302
319
- private inline fun <reified T : Throwable > ListenableFuture <* >.checkFutureException (vararg suppressed : KClass < out Throwable > ) {
303
+ private inline fun <reified T : Throwable > ListenableFuture <* >.checkFutureException () {
320
304
val e = assertFailsWith<ExecutionException > { get() }
321
305
val cause = e.cause!!
322
306
assertTrue(cause is T )
323
- for ((index, clazz) in suppressed.withIndex()) {
324
- assertTrue(clazz.isInstance(cause.suppressed[index]))
325
- }
326
307
}
327
308
328
309
private suspend fun CoroutineScope.awaitFutureWithCancel (cancellable : Boolean ): ListenableFuture <Int > {
0 commit comments