Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

openfuture.bugbase.test.common
Class JspBaseTestCase  view JspBaseTestCase download JspBaseTestCase.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.cactus.internal.AbstractCactusTestCase
              extended byorg.apache.cactus.ServletTestCase
                  extended byorg.apache.cactus.JspTestCase
                      extended byopenfuture.bugbase.test.common.JspBaseTestCase
All Implemented Interfaces:
org.apache.cactus.internal.CactusTestCase, junit.framework.Test

public abstract class JspBaseTestCase
extends org.apache.cactus.JspTestCase

Base test case for JSP tests.

Created: Wed Oct 31 14:33:23 2001

Version:
$Revision: 1.1 $

Field Summary
private  java.util.Properties properties
           
 
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.internal.AbstractCactusTestCase
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
JspBaseTestCase(java.lang.String name)
          Creates a new JspLoginTestCase instance.
 
Method Summary
 void copyCookies(com.meterware.httpunit.WebResponse from, org.apache.cactus.WebRequest to)
          copy the new cookies received by the response to the new request.
protected  com.meterware.httpunit.WebForm findLoginForm(com.meterware.httpunit.WebForm[] forms)
          Try to find a login form in the given array.
protected  com.meterware.httpunit.WebForm findLogoffForm(com.meterware.httpunit.WebForm[] forms)
          Try to find a logoff form in the given array.
protected  Log getLog()
          Retrieve the logger from the Cactus logging service.
 java.util.Properties getProperties()
          Get the value of properties.
protected  boolean isLoginForm(com.meterware.httpunit.WebForm form)
          Check, if the given form is a login form.
protected  boolean isLogoffForm(com.meterware.httpunit.WebForm form)
          Check, if the given form is a logoff form.
protected  com.meterware.httpunit.WebResponse login(com.meterware.httpunit.WebConversation wc, com.meterware.httpunit.WebResponse resp, boolean searchLogin)
          Login into Bug Base.
protected  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.
protected  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 setProperties(java.util.Properties v)
          Set the value of properties.
static void setURL(org.apache.cactus.WebRequest request, java.net.URL url)
          Helper method for setting WebRequest.setURL(String, String, String, String, String)>WebRequest.setURL(String, String, String, String, String) 55 .
 
Methods inherited from class org.apache.cactus.JspTestCase
createProtocolHandler
 
Methods inherited from class org.apache.cactus.internal.AbstractCactusTestCase
runBare, runBareServer
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, 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
 
Methods inherited from interface org.apache.cactus.internal.CactusTestCase
runBareServer
 

Field Detail

properties

private java.util.Properties properties
Constructor Detail

JspBaseTestCase

public JspBaseTestCase(java.lang.String name)
Creates a new JspLoginTestCase instance. Read the property file "bugbase.properties" from the current directory. The following properties are recognized:
  • openfuture.bugbase.test.host: host name of the Bug Base instance.
    [Default: localhost:8080]
  • openfuture.bugbase.test.context: context name of the Bug Base instance.
    [Default: bugbase]
  • openfuture.bugbase.test.userid: User ID.
    [Default: admin]
  • openfuture.bugbase.test.password: Password for the user.
    [Default: bugbase]

Method Detail

loginPage

protected 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
Call a page, that requires a login first.


logoffPage

protected com.meterware.httpunit.WebResponse logoffPage(com.meterware.httpunit.WebConversation wc,
                                                        org.apache.cactus.WebRequest request,
                                                        java.lang.String jsp)
                                                 throws java.lang.Exception
Call a page and logoff directly. It is assumed, that no intermediatary login is required.


login

protected com.meterware.httpunit.WebResponse login(com.meterware.httpunit.WebConversation wc,
                                                   com.meterware.httpunit.WebResponse resp,
                                                   boolean searchLogin)
                                            throws java.lang.Exception
Login into Bug Base. The current page must contain a login form.


logoff

protected com.meterware.httpunit.WebResponse logoff(com.meterware.httpunit.WebConversation wc,
                                                    com.meterware.httpunit.WebResponse resp)
                                             throws java.lang.Exception
Logoff from Bug Base. If the current page must contain a logoff form, it will be called.


isLoginForm

protected boolean isLoginForm(com.meterware.httpunit.WebForm form)
Check, if the given form is a login form. We decide this due to the occurence of a field named "password".


isLogoffForm

protected boolean isLogoffForm(com.meterware.httpunit.WebForm form)
Check, if the given form is a logoff form. We search for the action 55 of the form starting with "/logoff.do".


findLoginForm

protected com.meterware.httpunit.WebForm findLoginForm(com.meterware.httpunit.WebForm[] forms)
Try to find a login form in the given array.


findLogoffForm

protected com.meterware.httpunit.WebForm findLogoffForm(com.meterware.httpunit.WebForm[] forms)
Try to find a logoff form in the given array.


setURL

public static void setURL(org.apache.cactus.WebRequest request,
                          java.net.URL url)
Helper method for setting WebRequest.setURL(String, String, String, String, String)>WebRequest.setURL(String, String, String, String, String) 55 .


copyCookies

public void copyCookies(com.meterware.httpunit.WebResponse from,
                        org.apache.cactus.WebRequest to)
copy the new cookies received by the response to the new request.


getLog

protected Log getLog()
Retrieve the logger from the Cactus logging service.


getProperties

public java.util.Properties getProperties()
Get the value of properties.


setProperties

public void setProperties(java.util.Properties v)
Set the value of properties.