public class

JiraTestWatchDog

extends Object
implements WebTestListener
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.JiraTestWatchDog

Class Overview

This class basically listens to tests and fires a callback if a test does not complete with the configured time. The callback can be repeatably invoked after the initial timeout at a fixed interval.

Summary

Public Constructors
JiraTestWatchDog(Predicate<WebTestDescription> monitorPredicate, long timeout, long repeatDelay, TimeUnit unit, int repeatMax, Function<WebTestDescription, ?> timeoutCallable)
Create a watchdog that will watch the tests and fire the passed callback for any tests that do not complete within the specified amount of time.
Public Methods
void close()
void suiteFinished(WebTestDescription suiteDescription)
Called when the whole web test suite is going finishing.
void suiteStarted(WebTestDescription suiteDescription)
Called when the whole web test suite is going to start.
void testError(WebTestDescription description, Throwable t)
Called when test ends with an error
void testFailure(WebTestDescription test, Throwable t)
Called on test finished with an assertion failure.
void testFinished(WebTestDescription test)
Called on finished web test.
void testStarted(WebTestDescription test)
Called on start of a single web test.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.functest.framework.WebTestListener

Public Constructors

public JiraTestWatchDog (Predicate<WebTestDescription> monitorPredicate, long timeout, long repeatDelay, TimeUnit unit, int repeatMax, Function<WebTestDescription, ?> timeoutCallable)

Create a watchdog that will watch the tests and fire the passed callback for any tests that do not complete within the specified amount of time.

Parameters
monitorPredicate will only monitor tests for which the predicate returns true.
timeout the time we should wait for a test to finish before it is considered to have frozen.
repeatDelay the delay between taking thread dumps once the timeout has passed.
unit the unit of the timeout and repeatDelay.
repeatMax the number of times to execute the callable.
timeoutCallable this callback is invoked

Public Methods

public void close ()

public void suiteFinished (WebTestDescription suiteDescription)

Called when the whole web test suite is going finishing.

Parameters
suiteDescription description of the whole suite

public void suiteStarted (WebTestDescription suiteDescription)

Called when the whole web test suite is going to start.

Parameters
suiteDescription description of the whole suite

public void testError (WebTestDescription description, Throwable t)

Called when test ends with an error

Parameters
description test description
t error

public void testFailure (WebTestDescription test, Throwable t)

Called on test finished with an assertion failure.

Parameters
test test description
t failure

public void testFinished (WebTestDescription test)

Called on finished web test.

Parameters
test test description

public void testStarted (WebTestDescription test)

Called on start of a single web test.

Parameters
test test description