aboutsummaryrefslogtreecommitdiff
path: root/integration-testing/src/coreAgentTest/kotlin/CoreAgentTest.kt
blob: 6d47323370db58fb7cb31b6f6699e13006650ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 *  Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */
import org.junit.*
import kotlinx.coroutines.*
import kotlinx.coroutines.debug.internal.*
import org.junit.Test
import java.io.*

class CoreAgentTest {

    @Test
    fun testAgentDumpsCoroutines() = runBlocking {
        val baos = ByteArrayOutputStream()
        @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
        DebugProbesImpl.dumpCoroutines(PrintStream(baos))
        // if the agent works, then dumps should contain something,
        // at least the fact that this test is running.
        Assert.assertTrue(baos.toString().contains("testAgentDumpsCoroutines"))
    }

}