openfuture.bugbase.test.bugreports
Class JspAddBugReportTestCase

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--junit.log4j.LoggedTestCase
                    |
                    +--openfuture.bugbase.test.common.BusinessTestCase
                          |
                          +--openfuture.bugbase.test.bugreports.JspAddBugReportTestCase
All Implemented Interfaces:
junit.framework.Test

public class JspAddBugReportTestCase
extends BusinessTestCase

Test adding a new bug report via the JSP interface.

Created: Sat Nov 24 14:42:35 2001

Version:
$Revision: 1.4 $
Author:
Wolfgang Reissenberger

Fields inherited from class junit.log4j.LoggedTestCase
category, isLog4jInClasspath
 
Constructor Summary
JspAddBugReportTestCase(java.lang.String name)
          Creates a new JspAddBugReportTestCase instance and initializes the criteria as an empty list.
 
Method Summary
protected  void addReportWithAttachment(java.lang.String prefix, java.lang.String suffix)
          Submit a complete bug report including an attachment using the JSP interface.
protected  com.meterware.httpunit.WebRequest fillReportForm(com.meterware.httpunit.WebForm form, java.lang.String title, java.lang.String description, java.lang.String packageName, java.lang.String groupid, java.lang.String errorLevel)
          Fill the bug report form with the given parameters
static java.lang.String findFileParameter(com.meterware.httpunit.WebForm form)
          Search the form for the first file parameter
 java.util.LinkedList getCriteria()
          Get the value of criteria.
 java.text.DateFormat getDateFormat()
          Get the date format used to make bug report titles unique.
 void setCriteria(java.util.LinkedList v)
          Set the value of criteria.
 void setDateFormat(java.text.DateFormat newDateFormat)
          Set the date format used to make bug report titles unique.
 void tearDown()
          Try to remove the created bug reports again.
 void testAddCompleteReport()
          Submit a complete bug report using the JSP interface.
 void testAddMissingDescription()
          Submit a bug report with missing description entry using the JSP interface: Call NewBugReport.jsp. Log in. Fill form completely except for the report description. Submit the form.
 void testAddMissingTitle()
          Submit a bug report with missing title entry using the JSP interface: Call NewBugReport.jsp. Log in. Fill form completely except for the report title. Submit the form.
 void testAddReportWithConformAttachment()
          Submit a complete bug report including an attachment with HTTP conform name using the JSP interface.
 void testAddReportWithNonConformAttachment()
          Submit a complete bug report including an attachment with a name containing a blank using the JSP interface.
 
Methods inherited from class openfuture.bugbase.test.common.BusinessTestCase
callPage, createAdminUser, createCompleteBugReport, createCompleteBugReport, createDoctorUser, createNormalUser, createNormalUser, createUniqueUserId, findForm, findLink, findLinkByText, getAdminUser, getClient, getDoctorUser, getNormalUser, getResourceBundle, getUniqueFilename, hasReasonKey, isUniqueUserId, login, login, loginPage, loginPage, logoff, logoffPage, searchUser, setAdminUser, setClient, setDefault, setDoctorUser, setNormalUser, setResourceBundle, setUp
 
Methods inherited from class junit.log4j.LoggedTestCase
debug, debug, error, error, fatal, fatal, getProperties, info, info, setProperties, warn, warn
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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

JspAddBugReportTestCase

public JspAddBugReportTestCase(java.lang.String name)
Creates a new JspAddBugReportTestCase instance and initializes the criteria as an empty list.
Parameters:
name - test case name
Method Detail

testAddCompleteReport

public void testAddCompleteReport()
                           throws java.lang.Exception
Submit a complete bug report using the JSP interface.
Throws:
java.lang.Exception - if an error occurs

testAddMissingTitle

public void testAddMissingTitle()
                         throws java.lang.Exception
Submit a bug report with missing title entry using the JSP interface:
Throws:
java.lang.Exception - if an error occurs

testAddMissingDescription

public void testAddMissingDescription()
                               throws java.lang.Exception
Submit a bug report with missing description entry using the JSP interface:
Throws:
java.lang.Exception - if an error occurs

testAddReportWithConformAttachment

public void testAddReportWithConformAttachment()
                                        throws java.lang.Exception
Submit a complete bug report including an attachment with HTTP conform name using the JSP interface.
Throws:
java.lang.Exception - if an error occurs

testAddReportWithNonConformAttachment

public void testAddReportWithNonConformAttachment()
                                           throws java.lang.Exception
Submit a complete bug report including an attachment with a name containing a blank using the JSP interface.
Throws:
java.lang.Exception - if an error occurs

tearDown

public void tearDown()
              throws java.lang.Exception
Try to remove the created bug reports again.
Overrides:
tearDown in class BusinessTestCase
Throws:
java.lang.Exception - if an error occurs

addReportWithAttachment

protected void addReportWithAttachment(java.lang.String prefix,
                                       java.lang.String suffix)
                                throws java.lang.Exception
Submit a complete bug report including an attachment using the JSP interface.
Parameters:
prefix - a filename prefix
suffix - a filename suffix
Throws:
java.lang.Exception - if an error occurs

fillReportForm

protected com.meterware.httpunit.WebRequest fillReportForm(com.meterware.httpunit.WebForm form,
                                                           java.lang.String title,
                                                           java.lang.String description,
                                                           java.lang.String packageName,
                                                           java.lang.String groupid,
                                                           java.lang.String errorLevel)
Fill the bug report form with the given parameters
Overrides:
fillReportForm in class BusinessTestCase
Parameters:
form - the HTML form
title - bug report title
description - bug report description
packageName - bug report package name
groupid - bug report group ID
errorLevel - bug report error level
Returns:
the web request belonging to the form's submit button

findFileParameter

public static java.lang.String findFileParameter(com.meterware.httpunit.WebForm form)
Search the form for the first file parameter
Parameters:
form - the web form
Returns:
a the first file parameter name (null, if none is found.

getCriteria

public java.util.LinkedList getCriteria()
Get the value of criteria.
Returns:
value of criteria.

setCriteria

public void setCriteria(java.util.LinkedList v)
Set the value of criteria.
Parameters:
v - Value to assign to criteria.

getDateFormat

public java.text.DateFormat getDateFormat()
Get the date format used to make bug report titles unique.
Returns:
the date format used to make bug report titles unique.

setDateFormat

public void setDateFormat(java.text.DateFormat newDateFormat)
Set the date format used to make bug report titles unique.
Parameters:
newDateFormat - the new date format used to make bug report titles unique.


Copyright © 2000 -- 2003 openfuture.de. All Rights Reserved.