Skip to content

Commit b2cdc5e

Browse files
committed
Restore Java 6 compatibility
1 parent 5639304 commit b2cdc5e

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

integration/kotlinx-coroutines-guava/test/ListenableFutureTest.kt

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import org.junit.Assert.*
1313
import org.junit.Test
1414
import java.io.*
1515
import java.util.concurrent.*
16-
import kotlin.reflect.*
1716
import kotlin.test.assertFailsWith
1817

1918
class ListenableFutureTest : TestBase() {
@@ -269,21 +268,6 @@ class ListenableFutureTest : TestBase() {
269268
result.checkFutureException<TestException>()
270269
}
271270

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-
287271
@Test
288272
fun testExternalCancellation() = runTest {
289273
val future = future(Dispatchers.Unconfined) {
@@ -316,13 +300,10 @@ class ListenableFutureTest : TestBase() {
316300
finish(3)
317301
}
318302

319-
private inline fun <reified T: Throwable> ListenableFuture<*>.checkFutureException(vararg suppressed: KClass<out Throwable>) {
303+
private inline fun <reified T: Throwable> ListenableFuture<*>.checkFutureException() {
320304
val e = assertFailsWith<ExecutionException> { get() }
321305
val cause = e.cause!!
322306
assertTrue(cause is T)
323-
for ((index, clazz) in suppressed.withIndex()) {
324-
assertTrue(clazz.isInstance(cause.suppressed[index]))
325-
}
326307
}
327308

328309
private suspend fun CoroutineScope.awaitFutureWithCancel(cancellable: Boolean): ListenableFuture<Int> {

0 commit comments

Comments
 (0)