|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--junit.framework.Assert
|
+--junit.framework.TestCase
|
+--org.apache.cactus.AbstractTestCase
|
+--org.apache.cactus.AbstractWebTestCase
|
+--org.apache.cactus.ServletTestCase
|
+--org.apache.cactus.JspTestCase
|
+--openfuture.bugbase.test.common.JspBaseTestCase
Base test case for JSP tests using the Cactus framework.
Created: Wed Oct 31 14:33:23 2001
| Fields inherited from class org.apache.cactus.JspTestCase |
out, pageContext |
| Fields inherited from class org.apache.cactus.ServletTestCase |
config, request, response, session |
| Fields inherited from class org.apache.cactus.AbstractTestCase |
BEGIN_METHOD_PREFIX, END_METHOD_PREFIX, LOG_CLIENT_CONFIG, TEST_METHOD_PREFIX |
| Constructor Summary | |
JspBaseTestCase(java.lang.String name)
Creates a new JspLoginTestCase instance.
|
|
| Method Summary | |
void |
clientSetUp()
Setup before executing a test case: Create a Bug Base Servlet Proxy.
|
void |
clientTearDown()
Currently does nothing. |
void |
copyCookies(com.meterware.httpunit.WebResponse from,
org.apache.cactus.WebRequest to)
copy the new cookies received by the response to the new request. |
com.meterware.httpunit.WebForm |
findForm(com.meterware.httpunit.WebForm[] forms,
java.lang.String action)
Find a certain form. |
BugBaseServletClient |
getClient()
Get the value of client. |
org.apache.commons.logging.Log |
getLog()
Convenience method accessing the Cactus LogService Log. |
java.util.Properties |
getProperties()
Get the value of properties. |
protected com.meterware.httpunit.WebResponse |
login(com.meterware.httpunit.WebConversation wc,
com.meterware.httpunit.WebResponse resp,
boolean searchLogin)
Login into Bug Base using HttpUnit. |
com.meterware.httpunit.WebResponse |
loginPage(com.meterware.httpunit.WebConversation wc,
org.apache.cactus.WebRequest request,
java.lang.String jsp,
boolean searchLogin)
Call a page, that requires a login first. |
protected com.meterware.httpunit.WebResponse |
logoff(com.meterware.httpunit.WebConversation wc,
com.meterware.httpunit.WebResponse resp)
Logoff from Bug Base. |
com.meterware.httpunit.WebResponse |
logoffPage(com.meterware.httpunit.WebConversation wc,
org.apache.cactus.WebRequest request,
java.lang.String jsp)
Call a page and logoff directly. |
void |
setClient(BugBaseServletClient v)
Set the value of client. |
protected void |
setDefault(java.lang.String key,
java.lang.String value)
Set a property to a default value, if the property is NOT already set. |
void |
setProperties(java.util.Properties v)
Set the value of properties. |
protected void |
setUrl(java.net.URL url,
org.apache.cactus.WebRequest request)
Set the URL in the Cactus request |
| Methods inherited from class org.apache.cactus.JspTestCase |
runTest |
| Methods inherited from class org.apache.cactus.AbstractWebTestCase |
callEndMethod, runGenericTest |
| Methods inherited from class org.apache.cactus.AbstractTestCase |
callBeginMethod, getBeginMethodName, getCurrentTestMethod, getEndMethodName, getLogger, runBare, runBareServerTest, runServerTest |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, setName, setUp, tearDown, toString |
| 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 |
| Constructor Detail |
public JspBaseTestCase(java.lang.String name)
JspLoginTestCase instance.
Read the property file "bugbase.properties" from the
classpath. The following properties are recognized:
name - test case name| Method Detail |
public void clientSetUp()
throws java.lang.Exception
Bug Base Servlet Proxy.
The URL to the
BugBaseServlet
is constructed as
http://<openfuture.bugbase.test.host>/<openfuture.bugbase.test.context>/servlet/BugBaseServlet.
java.lang.Exception - if an error occurs
public void clientTearDown()
throws java.lang.Exception
java.lang.Exception - if an error occurs
public com.meterware.httpunit.WebResponse loginPage(com.meterware.httpunit.WebConversation wc,
org.apache.cactus.WebRequest request,
java.lang.String jsp,
boolean searchLogin)
throws java.lang.Exception
wc - the web conversationrequest - Cactus request objectjsp - the JSP that requires a loginsearchLogin - if true, the result
page will be searched for a login form. The login form is
recognized
by its action. The action must contain "login.do" as substring.java.lang.Exception - if an error occurs
public com.meterware.httpunit.WebResponse logoffPage(com.meterware.httpunit.WebConversation wc,
org.apache.cactus.WebRequest request,
java.lang.String jsp)
throws java.lang.Exception
wc - the web conversationrequest - Cactus request objectjsp - the JSP from where the logoff will be processedjava.lang.Exception - if an error occurs
protected com.meterware.httpunit.WebResponse login(com.meterware.httpunit.WebConversation wc,
com.meterware.httpunit.WebResponse resp,
boolean searchLogin)
throws java.lang.Exception
wc - the current web conversationresp - the web response, where the input form will be searchedsearchLogin - if true, the result
page will be searched for a login form. The login form is
recognized
by its action. The action must contain "login.do" as substring.java.lang.Exception - if an error occurs
protected com.meterware.httpunit.WebResponse logoff(com.meterware.httpunit.WebConversation wc,
com.meterware.httpunit.WebResponse resp)
throws java.lang.Exception
wc - the current web conversationresp - the web response, where the input form will be searchedjava.lang.Exception - if an error occurs
public void copyCookies(com.meterware.httpunit.WebResponse from,
org.apache.cactus.WebRequest to)
from - received responseto - target request
public com.meterware.httpunit.WebForm findForm(com.meterware.httpunit.WebForm[] forms,
java.lang.String action)
forms - array of form objectsaction - action string that must be contained in the action string.null, if the
desired form cannot be found.
protected void setDefault(java.lang.String key,
java.lang.String value)
key - property keyvalue - property value
protected void setUrl(java.net.URL url,
org.apache.cactus.WebRequest request)
url - URL to be setrequest - Cactus request the URL should be setWebRequest.setURL(String, String, String, String, String)public java.util.Properties getProperties()
public void setProperties(java.util.Properties v)
v - Value to assign to properties.public BugBaseServletClient getClient()
public void setClient(BugBaseServletClient v)
v - Value to assign to client.public org.apache.commons.logging.Log getLog()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||