Update sample unit test; the categorybasedtimer section was stale

This commit is contained in:
Michael Stack 2017-03-02 22:34:24 -08:00
parent 5645684ec9
commit 678ad0ea73
1 changed files with 7 additions and 5 deletions

View File

@ -1110,11 +1110,13 @@ public class TestExample {
// down in 'testExampleFoo()' where we use it to log current test's name.
@Rule public TestName testName = new TestName();
// CategoryBasedTimeout.forClass(<testcase>) decides the timeout based on the category
// (small/medium/large) of the testcase. @ClassRule requires that the full testcase runs within
// this timeout irrespective of individual test methods' times.
@ClassRule
public static TestRule timeout = CategoryBasedTimeout.forClass(TestExample.class);
// The below rule does two things. It decides the timeout based on the category
// (small/medium/large) of the testcase. This @Rule requires that the full testcase runs
// within this timeout irrespective of individual test methods' times. The second
// feature is we'll dump in the log when the test is done a count of threads still
// running.
@Rule public static TestRule timeout = CategoryBasedTimeout.builder().
withTimeout(this.getClass()).withLookingForStuckThread(true).build();
@Before
public void setUp() throws Exception {