com.atlassian.jira.functest.framework
Class FuncTestSuite

java.lang.Object
  extended by com.atlassian.jira.functest.framework.FuncTestSuite
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AcceptanceTestHarness, FuncTestSuiteAdministration, FuncTestSuiteAppLinks, FuncTestSuiteAttachments, FuncTestSuiteAvatars, FuncTestSuiteBrowsing, FuncTestSuiteBulkOperations, FuncTestSuiteCharting, FuncTestSuiteCloneIssue, FuncTestSuiteComments, FuncTestSuiteComponentsAndVersions, FuncTestSuiteCustomFields, FuncTestSuiteDashboards, FuncTestSuiteDatabase, FuncTestSuiteEmail, FuncTestSuiteFields, FuncTestSuiteFilters, FuncTestSuiteI18n, FuncTestSuiteImportExport, FuncTestSuiteIssueNavigator, FuncTestSuiteIssues, FuncTestSuiteJelly, FuncTestSuiteJql, FuncTestSuiteLdap, FuncTestSuiteLicencing, FuncTestSuiteMoveIssue, FuncTestSuitePermissions, FuncTestSuitePlatform, FuncTestSuitePlugins, FuncTestSuiteProjectImport, FuncTestSuiteProjects, FuncTestSuiteRandomTests, FuncTestSuiteReferencePlugins, FuncTestSuiteReloadablePluginModules, FuncTestSuiteRemote, FuncTestSuiteReports, FuncTestSuiteREST, FuncTestSuiteRoles, FuncTestSuiteSchemes, FuncTestSuiteSecurity, FuncTestSuiteSetup, FuncTestSuiteSharedEntities, FuncTestSuiteSubTasks, FuncTestSuiteTimeTracking, FuncTestSuiteTimeZone, FuncTestSuiteUpgradeTasks, FuncTestSuiteUsersAndGroups, FuncTestSuiteWorkflow, FuncTestSuiteWorklogs, FuncTestSuiteXXXX

public class FuncTestSuite
extends Object
implements junit.framework.Test

A base class for JIRA functional test suites. It handles TestCase classes and ensures that a test instance is never added more than once. It also keeps track of the various JIRA editions and what test should run within them.

Under the covers it uses LinkedHashSets which means the test are maintained in "insertion order" but not test is returned more than once.

Since:
v4.0

Constructor Summary
FuncTestSuite()
           
 
Method Summary
 FuncTestSuite addBundledPlugins2Only(Class<? extends junit.framework.TestCase> testCaseClass)
          This will add the test class into the suite as a bundled plugins 2.0 test only.
 FuncTestSuite addSingleRunTest(Class<? extends junit.framework.TestCase> testCaseClass)
           
 FuncTestSuite addTest(Class<? extends junit.framework.TestCase> testCaseClass)
          This will add the test class into the suite.
 FuncTestSuite addTests(Collection<Class<? extends junit.framework.TestCase>> testCaseClasses)
          This will add a collection of test classes into the suite as a STANDARD, PROFESSIONAL and ENTERPRISE tests.
 FuncTestSuite addTestsInPackage(String packageName, boolean recursive)
           
 FuncTestSuite addTestsInPackageBundledPluginsOnly(String packageName, boolean recursive)
           
 FuncTestSuite addTestSuite(FuncTestSuite funcTestSuite)
          This will add the tests from the passed in FuncTestSuite to this suite, respecting the various editions and ensuring that tests are not added twice.
 FuncTestSuite addTpmLdapOnly(Class<? extends junit.framework.TestCase> testCaseClass)
           
 int countTestCases()
           
protected  TestSuiteBuilder createFuncTestBuilder()
           
 junit.framework.Test createTest()
          This gets the suite of Tests based on the func test settings that you currently have.
 junit.framework.Test createTest(JIRAEnvironmentData environment)
          This gets the suite of Tests based on the passed environment.
 Set<Class<? extends junit.framework.TestCase>> getAllTests()
           
 Set<Class<? extends junit.framework.TestCase>> getBundledPlugins2Tests()
           
 Set<Class<? extends junit.framework.TestCase>> getFuncTests()
           
 Set<Class<? extends junit.framework.TestCase>> getSingleRunTests()
           
 Set<Class<? extends junit.framework.TestCase>> getTests(JIRAEnvironmentData environmentData)
          Returns a set of test classes that are deemed as test that should run on based on the JIRA edition inside the JIRAEnvironmentData object.
 Set<Class<? extends junit.framework.TestCase>> getTpmLdapTests()
           
 void run(junit.framework.TestResult result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuncTestSuite

public FuncTestSuite()
Method Detail

createTest

public junit.framework.Test createTest()
This gets the suite of Tests based on the func test settings that you currently have.

Returns:
a Test suite of classes to run

createTest

public junit.framework.Test createTest(JIRAEnvironmentData environment)
This gets the suite of Tests based on the passed environment.

Parameters:
environment - the environment to used to select the tests.
Returns:
a Test suite of classes to run

getTests

public Set<Class<? extends junit.framework.TestCase>> getTests(JIRAEnvironmentData environmentData)
Returns a set of test classes that are deemed as test that should run on based on the JIRA edition inside the JIRAEnvironmentData object.

Parameters:
environmentData - the edition to use is in here
Returns:
the of test classes that are deemed as test that should run on based on the JIRA edition, in insertion order

createFuncTestBuilder

protected TestSuiteBuilder createFuncTestBuilder()

getFuncTests

public Set<Class<? extends junit.framework.TestCase>> getFuncTests()
Returns:
the set of test classes that are deemed as test that should run on JIRA ENTERPRISE edition, in insertion order.

getBundledPlugins2Tests

public Set<Class<? extends junit.framework.TestCase>> getBundledPlugins2Tests()
Returns:
the set of test classes that are deemed as test that should run for bundled plugins in insertion order.

getTpmLdapTests

public Set<Class<? extends junit.framework.TestCase>> getTpmLdapTests()

getSingleRunTests

public Set<Class<? extends junit.framework.TestCase>> getSingleRunTests()

getAllTests

public Set<Class<? extends junit.framework.TestCase>> getAllTests()

addBundledPlugins2Only

public FuncTestSuite addBundledPlugins2Only(Class<? extends junit.framework.TestCase> testCaseClass)
This will add the test class into the suite as a bundled plugins 2.0 test only.

Parameters:
testCaseClass - the test case class to add
Returns:
this (in order to create a fluent style)

addTpmLdapOnly

public FuncTestSuite addTpmLdapOnly(Class<? extends junit.framework.TestCase> testCaseClass)

addSingleRunTest

public FuncTestSuite addSingleRunTest(Class<? extends junit.framework.TestCase> testCaseClass)

addTest

public FuncTestSuite addTest(Class<? extends junit.framework.TestCase> testCaseClass)
This will add the test class into the suite.

Parameters:
testCaseClass - the test case class to add
Returns:
this (in order to create a fluent style)

addTests

public FuncTestSuite addTests(Collection<Class<? extends junit.framework.TestCase>> testCaseClasses)
This will add a collection of test classes into the suite as a STANDARD, PROFESSIONAL and ENTERPRISE tests.

Parameters:
testCaseClasses - a collection of test case classes
Returns:
this (in order to create a fluent style)

addTestsInPackage

public FuncTestSuite addTestsInPackage(String packageName,
                                       boolean recursive)

addTestsInPackageBundledPluginsOnly

public FuncTestSuite addTestsInPackageBundledPluginsOnly(String packageName,
                                                         boolean recursive)

addTestSuite

public FuncTestSuite addTestSuite(FuncTestSuite funcTestSuite)
This will add the tests from the passed in FuncTestSuite to this suite, respecting the various editions and ensuring that tests are not added twice.

Parameters:
funcTestSuite - the FuncTestSuite to copy test classes from
Returns:
this (in order to create a fluent style)

countTestCases

public int countTestCases()
Specified by:
countTestCases in interface junit.framework.Test

run

public void run(junit.framework.TestResult result)
Specified by:
run in interface junit.framework.Test


Copyright © 2002-2014 Atlassian. All Rights Reserved.