1 package kotlinx.coroutines.debug.junit5 2 3 import kotlinx.coroutines.* 4 import org.junit.jupiter.api.* 5 6 /** 7 * Tests the basic usage of [CoroutinesTimeout] on classes and test methods. 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 @CoroutinesTimeout(100) 13 class CoroutinesTimeoutSimpleTest { 14 15 @Test 16 @Order(1) usesClassTimeout1null17 fun usesClassTimeout1() { 18 runBlocking { 19 delay(150) 20 } 21 } 22 23 @CoroutinesTimeout(1000) 24 @Test 25 @Order(2) ignoresClassTimeoutnull26 fun ignoresClassTimeout() { 27 runBlocking { 28 delay(150) 29 } 30 } 31 32 @CoroutinesTimeout(200) 33 @Test 34 @Order(3) usesMethodTimeoutnull35 fun usesMethodTimeout() { 36 runBlocking { 37 delay(300) 38 } 39 } 40 41 @Test 42 @Order(4) fitsInClassTimeoutnull43 fun fitsInClassTimeout() { 44 runBlocking { 45 delay(50) 46 } 47 } 48 49 @Test 50 @Order(5) usesClassTimeout2null51 fun usesClassTimeout2() { 52 runBlocking { 53 delay(150) 54 } 55 } 56 57 } 58