• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines.debug.junit5
6 
7 import kotlinx.coroutines.*
8 import org.junit.jupiter.api.*
9 
10 /**
11  * Tests the basic usage of [CoroutinesTimeout] on classes and test methods.
12  *
13  * This test class is not intended to be run manually. Instead, use [CoroutinesTimeoutTest] as the entry point.
14  */
15 @TestMethodOrder(MethodOrderer.OrderAnnotation::class)
16 @CoroutinesTimeout(100)
17 class CoroutinesTimeoutSimpleTest {
18 
19     @Test
20     @Order(1)
usesClassTimeout1null21     fun usesClassTimeout1() {
22         runBlocking {
23             delay(150)
24         }
25     }
26 
27     @CoroutinesTimeout(1000)
28     @Test
29     @Order(2)
ignoresClassTimeoutnull30     fun ignoresClassTimeout() {
31         runBlocking {
32             delay(150)
33         }
34     }
35 
36     @CoroutinesTimeout(200)
37     @Test
38     @Order(3)
usesMethodTimeoutnull39     fun usesMethodTimeout() {
40         runBlocking {
41             delay(300)
42         }
43     }
44 
45     @Test
46     @Order(4)
fitsInClassTimeoutnull47     fun fitsInClassTimeout() {
48         runBlocking {
49             delay(50)
50         }
51     }
52 
53     @Test
54     @Order(5)
usesClassTimeout2null55     fun usesClassTimeout2() {
56         runBlocking {
57             delay(150)
58         }
59     }
60 
61 }
62