public class

FuncTestCase

extends TestCase
implements FunctTestConstants FuncTestLogger
java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ com.atlassian.jira.functest.framework.FuncTestCase
Known Direct Subclasses

Class Overview

The base class for JIRA "next generation" functional test cases. This lightweight implementation of junit.framework.TestCase provides for the ability to "record" exceptions that happening during the running of tests and produce "test artifacts" of these exceptions.

Also much of the standard JIRA setUp() and tearDown() is done via this class. It is the intended base class for JIRA web functional test cases.

ge NOTE: setUp() and tearDown() are final, please use the template methods setUpTest() and tearDownTest() instead

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.functest.framework.FunctTestConstants
Fields
protected Administration administration Use this field to access the Administration helper in play
protected Assertions assertions Use this field to access the Assertions helper in play
protected Backdoor backdoor Use this field to access the Backdoor helper in play, which can make sly RPCs to the server.
protected ChangeHistoryAssertions changeHistoryAssertions
protected JIRAEnvironmentData environmentData Use this field to access the com.atlassian.jira.webtests.util.JIRAEnvironmentData in play
protected Form form Used to set form values in tests.
protected FuncTestHelperFactory funcTestHelperFactory Factory for getting access to useful Func Test objects
protected IssueTableAssertions issueTableAssertions Use this field to access the IssueTableAssertions helper in play
protected JqlAssertions jqlAssertions
protected LocatorFactory locator Use this field to access the LocatorFactory in play
protected FuncTestLogger log Use this field to access the com.atlassian.jira.testkit.client.log.FuncTestLogger in play
protected Navigation navigation Use this field to access the Navigation helper in play
protected JIRAWebTest oldway_consider_porting This field is deprecated. think about why you need use the old ways
protected HtmlPage page Used to find out about the current HTML page that the test is on.
protected Parser parse Use this field to access the Parser helper in play
protected WebTester tester Use this field to access the net.sourceforge.jwebunit.WebTester in play
protected TextAssertions text Use this field to access the TextAssertions helper in play
[Expand]
Inherited Fields
From interface com.atlassian.jira.functest.framework.FunctTestConstants
Public Constructors
FuncTestCase()
Public Methods
static String builtInCustomFieldKey(String type)
Turns a simple key into a complete key for a built in custom field type
Assertions getAssertions()
JIRAEnvironmentData getEnvironmentData()
WebTester getTester()
FuncTestWebClientListener getWebClientListener()
void log(Object logData)
void log(Throwable t)
void runBare()
The outer most edge of a JUnit Test.
void setEnvironmentData(JIRAEnvironmentData environmentData)
@Deprecated void waitAndReloadBulkOperationProgressPage(WebTester webTester)
This method is deprecated. inject BulkOperationProgress for junit4 instead.
@Deprecated void waitAndReloadBulkOperationProgressPage()
This method is deprecated. inject BulkOperationProgress for junit4 instead.
@Deprecated void waitForOperationProgressPage(WebTester webTester)
This method is deprecated. inject BulkOperationProgress for junit4 instead.
Protected Methods
final JiraHttpClient createHttpClient()
JiraRestClient createRestClient()
JiraRestClient createRestClient(String user, String password)
boolean isDumpHTML()
void runTest()
Overridden so we can "record" exceptions that may happen during test execution.
final void setUp()
The default and final setUp() method will connect to JIRA and make sure its initialised and ready to go.
void setUpHttpUnitOptions()
Override this to set up any com.meterware.httpunit.HttpUnitOptions that must be set before the net.sourceforge.jwebunit.WebTester is instantiated.
void setUpTest()
Setup for an actual test
boolean shouldSkipSetup()
final void tearDown()
This will logout of JIRA and then produce test artifacts for any test that throws exceptions.
void tearDownTest()
individual test tear down
XPathLocator xpath(String xpathExpression)
A shortcut method to allow quick creation of XPathLocators
[Expand]
Inherited Methods
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface com.atlassian.jira.testkit.client.log.FuncTestLogger
From interface junit.framework.Test

Fields

protected Administration administration

Use this field to access the Administration helper in play

protected Assertions assertions

Use this field to access the Assertions helper in play

protected Backdoor backdoor

Use this field to access the Backdoor helper in play, which can make sly RPCs to the server.

protected ChangeHistoryAssertions changeHistoryAssertions

protected JIRAEnvironmentData environmentData

Use this field to access the com.atlassian.jira.webtests.util.JIRAEnvironmentData in play

protected Form form

Used to set form values in tests.

protected FuncTestHelperFactory funcTestHelperFactory

Factory for getting access to useful Func Test objects

protected IssueTableAssertions issueTableAssertions

Use this field to access the IssueTableAssertions helper in play

protected JqlAssertions jqlAssertions

protected LocatorFactory locator

Use this field to access the LocatorFactory in play

protected FuncTestLogger log

Use this field to access the com.atlassian.jira.testkit.client.log.FuncTestLogger in play

protected Navigation navigation

Use this field to access the Navigation helper in play

protected JIRAWebTest oldway_consider_porting

This field is deprecated.
think about why you need use the old ways

Use this field to access the JIRAWebTest test case in play. Access is provided to the old way of writing functiona; test cases but its use is not encouraged. Please consider porting the required function into the new framework.

protected HtmlPage page

Used to find out about the current HTML page that the test is on.

protected Parser parse

Use this field to access the Parser helper in play

protected WebTester tester

Use this field to access the net.sourceforge.jwebunit.WebTester in play

protected TextAssertions text

Use this field to access the TextAssertions helper in play

Public Constructors

public FuncTestCase ()

Public Methods

public static String builtInCustomFieldKey (String type)

Turns a simple key into a complete key for a built in custom field type

Parameters
type simple key
Returns
  • complete key for the given built-in custom field type

public Assertions getAssertions ()

public JIRAEnvironmentData getEnvironmentData ()

public WebTester getTester ()

public FuncTestWebClientListener getWebClientListener ()

public void log (Object logData)

public void log (Throwable t)

public void runBare ()

The outer most edge of a JUnit Test. All things start and end here.

Throws
Throwable
See Also

public void setEnvironmentData (JIRAEnvironmentData environmentData)

@Deprecated public void waitAndReloadBulkOperationProgressPage (WebTester webTester)

This method is deprecated.
inject BulkOperationProgress for junit4 instead.

@Deprecated public void waitAndReloadBulkOperationProgressPage ()

This method is deprecated.
inject BulkOperationProgress for junit4 instead.

@Deprecated public void waitForOperationProgressPage (WebTester webTester)

This method is deprecated.
inject BulkOperationProgress for junit4 instead.

Protected Methods

protected final JiraHttpClient createHttpClient ()

protected JiraRestClient createRestClient ()

protected JiraRestClient createRestClient (String user, String password)

protected boolean isDumpHTML ()

Returns
  • a boolean indicating whether to dump the HTML response to System.out (useful to disable in REST tests)

protected void runTest ()

Overridden so we can "record" exceptions that may happen during test execution. This is the method that all JUnit run methods end up calling.

Throws
Throwable
See Also

protected final void setUp ()

The default and final setUp() method will connect to JIRA and make sure its initialised and ready to go. For individual test setUp, override setUpTest() instead.

protected void setUpHttpUnitOptions ()

Override this to set up any com.meterware.httpunit.HttpUnitOptions that must be set before the net.sourceforge.jwebunit.WebTester is instantiated.

protected void setUpTest ()

Setup for an actual test

protected boolean shouldSkipSetup ()

protected final void tearDown ()

This will logout of JIRA and then produce test artifacts for any test that throws exceptions.

For individual test tearDown, override tearDownTest() instead.

protected void tearDownTest ()

individual test tear down

protected XPathLocator xpath (String xpathExpression)

A shortcut method to allow quick creation of XPathLocators

Parameters
xpathExpression the xpath expression
Returns
  • an XPathLocator