|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.backsource.alert.agent.BaseCase
org.backsource.alert.agent.UrlCase
BaseClass for URL based testcases.
This class may be used in itself, or as a superclass for other
agents that needs to test an URL. It is NOT based on the java.net.URL, becuse* of the need to be able to timeout.It uses two properties PropertyConstants.HTTP_TIMEOUT and PropertyConstants.HTTP_URL.
It is also possible to give authentication information:
PropertyConstants.HTTP_REALM,the realm to authenticate against.PropertyConstants.HTTP_USER, user to login as.PropertyConstants.HTTP_PWD, the password.
| Field Summary |
| Fields inherited from class org.backsource.alert.agent.BaseCase |
agentName, prop |
| Constructor Summary | |
UrlCase(java.lang.String name)
|
|
| Method Summary | |
protected void |
checkUrl(java.net.URL url)
Check the given url, ok if 200 is returned. |
protected void |
checkUrl(java.net.URL url,
java.lang.String find)
Fetch the given url and check if it contains the string given i find. |
static void |
main(java.lang.String[] args)
|
protected void |
setUp()
|
void |
testUrl()
Run the test agains the url given in property PropertyConstants.HTTP_URL. |
| Methods inherited from class org.backsource.alert.agent.BaseCase |
getAgentName, getProperties, initialize, toString |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown |
| Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface junit.framework.Test |
countTestCases, run |
| Constructor Detail |
public UrlCase(java.lang.String name)
| Method Detail |
protected void setUp()
throws java.lang.Exception
setUp in class BaseCasejava.lang.Exception
public void testUrl()
throws java.lang.Exception
PropertyConstants.HTTP_URL.
java.lang.Exceptionprotected void checkUrl(java.net.URL url)
protected void checkUrl(java.net.URL url,
java.lang.String find)
public static void main(java.lang.String[] args)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||