Skip to content

Commit

Permalink
Polish @BeforeAll Javadoc regarding execution order
Browse files Browse the repository at this point in the history
Issue: #1620
  • Loading branch information
sbrannen committed Feb 7, 2019
1 parent f510e82 commit 154ff89
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@
* deterministic but intentionally non-obvious.
*
* <p>In addition, {@code @BeforeAll} methods are in no way linked to
* {@code @AfterAll} methods, i.e. there are no guarantees with regard to their
* wrapping behavior. For example, given two {@code @BeforeAll} methods
* {@code createA()} and {@code createB()} as well as two {@code @AfterAll}
* {@code @AfterAll} methods. Consequently, there are no guarantees with regard
* to their <em>wrapping</em> behavior. For example, given two {@code @BeforeAll}
* methods {@code createA()} and {@code createB()} as well as two {@code @AfterAll}
* methods {@code destroyA()} and {@code destroyB()}, the order in which the
* {@code @BeforeAll} methods are executed (e.g. {@code createA()} before
* {@code createB()}) does not imply any order for the seemingly corresponding
* {@code @AfterAll} methods: (e.g. {@code destroyA()} might be called before
* <em>or</em> after {@code destroyB()}). Thus, the JUnit Team recommends that
* developers declare at most one {@code @BeforeAll}/{@code @AfterAll} method
* per test class/interface unless there are no dependencies between them.
* {@code @AfterAll} methods. In other words, {@code destroyA()} might be called
* before <em>or</em> after {@code destroyB()}. The JUnit Team therefore recommends
* that developers declare at most one {@code @BeforeAll} method and at most one
* {@code @AfterAll} method per test class or test interface unless there are no
* dependencies between the {@code @BeforeAll} methods or between the
* {@code @AfterAll} methods.
*
* <h3>Composition</h3>
*
Expand Down

0 comments on commit 154ff89

Please sign in to comment.