On this page
io.github.libtmux.junit5.TmuxExtension.TmuxExtension
- Module
- io.github.libtmux.junit5.TmuxExtension
- Package
- io.github.libtmux:libtmux
- Source
- libtmux-junit5/src/main/java/io/github/libtmux/junit5/TmuxExtension.java
-
Gives each test its own tmux server and guarantees it is gone afterwards.
<p>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.
<p>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.
<p>Teardown is driven from a lifecycle callback and the aggregate is also
AutoCloseablefor 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
- Fixture class One test's server, socket and directory, released exactly once.
- afterEach method
- beforeEach method
- deleteTree method
- fixtureRoot method
- reapAbandoned method Ends every tmux server under
rootwhose owning JVM is gone, and answers how many ended. Runs while other runs are using the same root, so it may only touch abandoned servers. - resolveParameter method
- supportsParameter method