Revise JUnit vs. Spring timeout support in reference manual

Prior to this commit, the discussion of JUnit vs. Spring with regard to
timeout support in tests erroneously claimed that Spring's support for
JUnit's @Test(timeout=...) did not include set up and tear down or
repetitions. This information, however, was based on a previous version
of SpringJUnit4ClassRunner and is no longer valid.

This commit revises the affected section of the testing chapter in the
reference manual accordingly.
master
Sam Brannen 10 years ago
parent ac164088d6
commit 5857cef026
  1. 7
      src/asciidoc/index.adoc

@ -18940,10 +18940,9 @@ test (see `@Repeat`), as well as any __set up__ or __tear down__ of the test fix
Spring's `@Timed` annotation has different semantics than JUnit's `@Test(timeout=...)` Spring's `@Timed` annotation has different semantics than JUnit's `@Test(timeout=...)`
support. Specifically, due to the manner in which JUnit handles test execution timeouts support. Specifically, due to the manner in which JUnit handles test execution timeouts
(that is, by executing the test method in a separate `Thread`), `@Test(timeout=...)` (that is, by executing the test method in a separate `Thread`), `@Test(timeout=...)`
applies to __each iteration__ in the case of repetitions and preemptively fails the test preemptively fails the test if the test takes too long. Spring's `@Timed`, on the other
if the test takes too long. Spring's `@Timed`, on the other hand, times the __total__ hand, does not preemptively fail the test but rather waits for the test to complete
test execution time (including all repetitions) and does not preemptively fail the test before failing.
but rather waits for the test to complete before failing.
* `@Repeat` * `@Repeat`

Loading…
Cancel
Save