1 package kotlinx.coroutines.debug.junit5 2 3 import kotlinx.coroutines.* 4 import org.junit.jupiter.api.* 5 6 /** 7 * Tests usage of [CoroutinesTimeout] on classes and test methods when only methods are annotated. 8 * 9 * This test class is not intended to be run manually. Instead, use [CoroutinesTimeoutTest] as the entry point. 10 */ 11 @TestMethodOrder(MethodOrderer.OrderAnnotation::class) 12 class CoroutinesTimeoutMethodTest { 13 14 @Test 15 @Order(1) noClassTimeoutnull16 fun noClassTimeout() { 17 runBlocking { 18 delay(150) 19 } 20 } 21 22 @CoroutinesTimeout(100) 23 @Test 24 @Order(2) usesMethodTimeoutWithNoClassTimeoutnull25 fun usesMethodTimeoutWithNoClassTimeout() { 26 runBlocking { 27 delay(1000) 28 } 29 } 30 31 @CoroutinesTimeout(1000) 32 @Test 33 @Order(3) fitsInMethodTimeoutnull34 fun fitsInMethodTimeout() { 35 runBlocking { 36 delay(10) 37 } 38 } 39 40 } 41