brooklyn.test
Class WebAppMonitor
java.lang.Object
brooklyn.test.WebAppMonitor
- All Implemented Interfaces:
- Runnable
public class WebAppMonitor
- extends Object
- implements Runnable
Repeatedly polls a given URL, to check if it is always available.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebAppMonitor
public WebAppMonitor(String url)
WebAppMonitor
public WebAppMonitor()
logFailures
public WebAppMonitor logFailures(org.slf4j.Logger log)
delayMillis
public WebAppMonitor delayMillis(long val)
expectedResponseCode
public WebAppMonitor expectedResponseCode(int val)
url
public WebAppMonitor url(String val)
run
public void run()
- Specified by:
run in interface Runnable
isResponseOkay
public boolean isResponseOkay(Object code)
setDelayMillis
public void setDelayMillis(long delayMillis)
getDelayMillis
public long getDelayMillis()
terminate
public void terminate()
throws InterruptedException
- Throws:
InterruptedException
getFailures
public int getFailures()
getSuccesses
public int getSuccesses()
setUrl
public void setUrl(String url)
getUrl
public String getUrl()
getProblem
public Object getProblem()
getAttempts
public int getAttempts()
getLastWasFailed
public boolean getLastWasFailed()
getLastStatus
public Object getLastStatus()
getLastTime
public long getLastTime()
getLastFailure
public Object getLastFailure()
- result code (int) or exception
onFailure
public void onFailure(Object problem)
preAttempt
public boolean preAttempt()
- return false to skip a run
assertNoFailures
public WebAppMonitor assertNoFailures(String message)
assertAttemptsMade
public WebAppMonitor assertAttemptsMade(int minAttempts,
String message)
assertSuccessFraction
public WebAppMonitor assertSuccessFraction(String message,
double percentage)
resetCounts
public WebAppMonitor resetCounts()
Copyright © 2013. All Rights Reserved.