/** * Creates a rule chain containing the following rules:<ol> * <li> a timeout rule * <li> a rule to print console messages at the start and end of each test method and print trace level * log messages on test failure. * </ol> * @param timeout The maximum allowed time duration of the test * @param timeUnit The unit for the timeout * @return */ public static RuleChain createRuleChain(long timeout, TimeUnit timeUnit) { TestRule timeoutRule = timeoutRule(timeout, timeUnit); TestRule trace = new MethodExecutionTrace(); return RuleChain.outerRule(trace).around(timeoutRule); }