MockConnector

In-memory connector for session and transport-adapter tests.

Local close only records that the connector was closed. Remote lifecycle events are triggered explicitly through simulateClosed or simulateCrash.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Number of times close was called locally.

Link copied to clipboard

True after local close has been requested.

Link copied to clipboard

Resize calls in the order they were received.

Link copied to clipboard

Number of times start was called.

Link copied to clipboard

Captured outbound bytes written by the session.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun feedFromHost(bytes: ByteArray, offset: Int = 0, length: Int = bytes.size)

Delivers host output to the session.

Link copied to clipboard
open override fun resize(columns: Int, rows: Int)
Link copied to clipboard
fun simulateClosed(exitCode: Int? = null)

Simulates remote transport closure.

Link copied to clipboard

Simulates remote transport failure.

Link copied to clipboard
open override fun start(listener: TerminalConnectorListener)
Link copied to clipboard
open override fun write(bytes: ByteArray, offset: Int, length: Int)