ktor-server-test-host / io.ktor.server.testing / EngineTestBase

EngineTestBase

abstract class EngineTestBase<TEngine : ApplicationEngine, TConfiguration : Configuration> : CoroutineScope

Annotations

Http2Only

annotation class Http2Only

NoHttp2

annotation class NoHttp2

Constructors

<init>

EngineTestBase(applicationEngineFactory: ApplicationEngineFactory<TEngine, TConfiguration>)

Properties

applicationEngineFactory

val applicationEngineFactory: ApplicationEngineFactory<TEngine, TConfiguration>

callGroupSize

var callGroupSize: Int

coroutineContext

open val coroutineContext: <ERROR CLASS>

enableHttp2

var enableHttp2: Boolean

enableSsl

var enableSsl: Boolean

exceptions

val exceptions: <ERROR CLASS><Throwable>

isUnderDebugger

val isUnderDebugger: Boolean

port

var port: Int

server

var server: TEngine?

socketReadTimeout

val socketReadTimeout: Int

sslPort

var sslPort: Int

test

val test: TestName

testDispatcher

val testDispatcher: ExecutorCoroutineDispatcher

testLog

val testLog: Logger

timeout

open val timeout: Long

timeoutRule

val timeoutRule: CoroutinesTimeout

Functions

configure

open fun configure(configuration: TConfiguration): Unit

createAndStartServer

fun createAndStartServer(log: Logger? = null, parent: <ERROR CLASS> = EmptyCoroutineContext, routingConfigurer: Routing.() -> Unit): TEngine

createServer

open fun createServer(log: Logger? = null, parent: <ERROR CLASS> = EmptyCoroutineContext, module: Application.() -> Unit): TEngine

features

open fun features(application: Application, routingConfigurer: Routing.() -> Unit): Unit

findFreePort

fun findFreePort(): Int

setUpBase

fun setUpBase(): Unit

socket

fun socket(block: Socket.() -> Unit): Unit

startServer

fun startServer(server: TEngine): List<Throwable>

tearDownBase

fun tearDownBase(): Unit

withUrl

fun withUrl(path: String, builder: suspend HttpRequestBuilder.() -> Unit = {}, block: suspend HttpResponse.(Int) -> Unit): Unit

Companion Object Properties

keyStore

lateinit var keyStore: KeyStore

keyStoreFile

val keyStoreFile: File

sslContext

lateinit var sslContext: SSLContext

trustManager

lateinit var trustManager: X509TrustManager

Companion Object Functions

setupAll

fun setupAll(): Unit