com.atlassian.jira.functest.framework
Class JiraTestWatchDog

java.lang.Object
  extended by com.atlassian.jira.functest.framework.JiraTestWatchDog
All Implemented Interfaces:
WebTestListener

public class JiraTestWatchDog
extends Object
implements WebTestListener

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.


Constructor Summary
JiraTestWatchDog(com.google.common.base.Predicate<WebTestDescription> monitorPredicate, long timeout, long repeatDelay, TimeUnit unit, int repeatMax, com.google.common.base.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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraTestWatchDog

public JiraTestWatchDog(com.google.common.base.Predicate<WebTestDescription> monitorPredicate,
                        long timeout,
                        long repeatDelay,
                        TimeUnit unit,
                        int repeatMax,
                        com.google.common.base.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
Method Detail

suiteStarted

public void suiteStarted(WebTestDescription suiteDescription)
Description copied from interface: WebTestListener
Called when the whole web test suite is going to start.

Specified by:
suiteStarted in interface WebTestListener
Parameters:
suiteDescription - description of the whole suite

suiteFinished

public void suiteFinished(WebTestDescription suiteDescription)
Description copied from interface: WebTestListener
Called when the whole web test suite is going finishing.

Specified by:
suiteFinished in interface WebTestListener
Parameters:
suiteDescription - description of the whole suite

testError

public void testError(WebTestDescription description,
                      Throwable t)
Description copied from interface: WebTestListener
Called when test ends with an error

Specified by:
testError in interface WebTestListener
Parameters:
description - test description
t - error

testFailure

public void testFailure(WebTestDescription test,
                        Throwable t)
Description copied from interface: WebTestListener
Called on test finished with an assertion failure.

Specified by:
testFailure in interface WebTestListener
Parameters:
test - test description
t - failure

testFinished

public void testFinished(WebTestDescription test)
Description copied from interface: WebTestListener
Called on finished web test.

Specified by:
testFinished in interface WebTestListener
Parameters:
test - test description

testStarted

public void testStarted(WebTestDescription test)
Description copied from interface: WebTestListener
Called on start of a single web test.

Specified by:
testStarted in interface WebTestListener
Parameters:
test - test description

close

public void close()


Copyright © 2002-2014 Atlassian. All Rights Reserved.