public final class

TestSuiteBuilder

extends Object
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.TestSuiteBuilder

Class Overview

Divides up a set of tests such that they can be performed in parallel. It does this by taking a set of tests and dividing them up into composite test of roughly even size.

If a passed test is annotated with Splitable then its individual test methods will be broken out into the different tests. All other tests have all their test methods within the same batch.

Summary

Nested Classes
class TestSuiteBuilder.ParallelEnvironmentTestSuite  
Public Constructors
TestSuiteBuilder(int batch, int maxBatch)
Create a splitter that will return the given batch from the specified number of total batches.
TestSuiteBuilder()
Create a no-op splitter, that is, the passed tests will not be batched.
Public Methods
TestSuiteBuilder addSingleTestMethod(Class<? extends TestCase> testClass, String methodName)
Adds an individual test method to the suite.
TestSuiteBuilder addTest(Class<? extends TestCase> test)
TestSuiteBuilder addTests(Class...<? extends TestCase> tests)
TestSuiteBuilder addTests(Collection<Class<? extends TestCase>> tests)
Add the passed tests to the splitter for division.
TestSuiteBuilder batch(int batch)
Test build()
Create the composite test that represents the batch.
TestSuiteBuilder log(boolean log)
TestSuiteBuilder maxBatch(int maxBatch)
TestSuiteBuilder parallel(boolean parallel)
String toString()
TestSuiteBuilder watch(long timeout, long delay, TimeUnit unit, Class...<? extends Test> classes)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TestSuiteBuilder (int batch, int maxBatch)

Create a splitter that will return the given batch from the specified number of total batches.

Parameters
batch the batch the splitter should return. A value of -1 can be specified when maxBatch is also passed -1. This indicates that no batching should be performed.
maxBatch the number of batches that splitter should divide the tests into. A value of -1 can be specified when batch is also passed -1. This indicates that no batching should be performed.

public TestSuiteBuilder ()

Create a no-op splitter, that is, the passed tests will not be batched. Same as @{code TestSplitter(-1, -1) }.

Public Methods

public TestSuiteBuilder addSingleTestMethod (Class<? extends TestCase> testClass, String methodName)

Adds an individual test method to the suite. This is currently experimental and only intended to be used in "blame" mode.

Parameters
testClass the TestCase class
methodName method name
Returns
  • this TestSuiteBuilder

public TestSuiteBuilder addTest (Class<? extends TestCase> test)

public TestSuiteBuilder addTests (Class...<? extends TestCase> tests)

public TestSuiteBuilder addTests (Collection<Class<? extends TestCase>> tests)

Add the passed tests to the splitter for division.

Parameters
tests the set of tests to divide.
Returns
  • a reference to this.

public TestSuiteBuilder batch (int batch)

public Test build ()

Create the composite test that represents the batch.

Returns
  • the composite test that represents the batch.

public TestSuiteBuilder log (boolean log)

public TestSuiteBuilder maxBatch (int maxBatch)

public TestSuiteBuilder parallel (boolean parallel)

public String toString ()

public TestSuiteBuilder watch (long timeout, long delay, TimeUnit unit, Class...<? extends Test> classes)