Class FuncTestSuite

java.lang.Object
com.atlassian.jira.functest.framework.FuncTestSuite
Direct Known Subclasses:
FuncTestSuiteStreams

public class FuncTestSuite extends Object
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 no test is returned more than once.

Since:
v4.0
  • Constructor Details

    • FuncTestSuite

      public FuncTestSuite()
  • Method Details

    • createTest

      public junit.framework.TestSuite createTest()
      This gets the test suite based on the func test settings that you currently have.
      Returns:
      a suite of test classes to run
    • createTest

      public junit.framework.TestSuite 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<?>> 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<?>> 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<?>> 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<?>> getTpmLdapTests()
    • addBundledPluginsTests

      public FuncTestSuite addBundledPluginsTests(List<Class<?>> testClasses)
    • addBundledPluginsTest

      public FuncTestSuite addBundledPluginsTest(Class<?> testClass)
      This will add the test class into the suite as a bundled plugins 2.0 test only.
      Parameters:
      testClass - the test case class to add
      Returns:
      this (in order to create a fluent style)
    • addTest

      public FuncTestSuite addTest(Class<?> testClass)
      This will add the test class into the suite.
      Parameters:
      testClass - the test case class to add
      Returns:
      this (in order to create a fluent style)
    • addTests

      public FuncTestSuite addTests(Collection<Class<?>> testClasses)
      This will add a collection of test classes into the suite as a STANDARD, PROFESSIONAL and ENTERPRISE tests.
      Parameters:
      testClasses - a collection of test case classes
      Returns:
      this (in order to create a fluent style)
    • getTestClasses

      public static List<Class<?>> getTestClasses(String packageName, boolean recursive)
      Returns all test classes in a package, excluding any that are marked with @Ignore.
      Parameters:
      packageName - a String containing a package name
      recursive - a boolean indicating whether to search recursively
      Returns:
      a List containing all test classes in a package, sorted by name