Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

io.github.libtmux.junit5.TmuxExtension.TmuxExtension

Java
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
io.github.libtmux.junit5.TmuxExtension
Package
io.github.libtmux:libtmux
Source
libtmux-junit5/src/main/java/io/github/libtmux/junit5/TmuxExtension.java
class io.github.libtmux.junit5.TmuxExtension.TmuxExtension
classreadonly [source]
classreadonly [source]
class io.github.libtmux.junit5.TmuxExtension.TmuxExtension

Gives each test its own tmux server and guarantees it is gone afterwards.

All state lives in the extension store, never in fields. JUnit reuses one declaratively registered extension instance for every test in a class, so a field is shared state the moment tests run in parallel, and one test's teardown then reaches another test's server.

The server is started eagerly, before the test body, and the aggregate that owns it is registered before any process exists. Registering afterwards leaves a window in which a failure partway through setup leaks a running tmux that nothing is left holding.

Teardown is driven from a lifecycle callback and the aggregate is also AutoCloseable for the framework's own store handling. Relying on store auto-close alone is a silent dependency on a configuration property: with it disabled that design releases nothing and reports nothing. The aggregate closes exactly once, so either path alone is sufficient.

8 declared, 0 inherited

Members

Esc

Type to search.