public abstract class

BatchingStrategy

extends Object
java.lang.Object
   ↳ com.google.gwt.junit.BatchingStrategy

Class Overview

An interface that specifies how tests should be batched. A single batch should never include tests from more than one module, or the browser will load the new module and lose results from existing tests.

Summary

Public Constructors
BatchingStrategy()
Public Methods
abstract List<TestInfo[]> getTestBlocks(String syntheticModuleName)
Returns an ordered list of all tests blocks that should be executed for the specified module.
abstract boolean isSingleTestOnly()
Check if this batching strategy only supports execution of a single test at a time.
Protected Methods
final Set<JUnitHost.TestInfo> getTestsForModule(String syntheticModuleName)
Get the set of tests for this module, minus tests that should not be executed.
int getTimeoutMultiplier()
Returns the multiplicative factor for adjusting the timeout.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BatchingStrategy ()

Public Methods

public abstract List<TestInfo[]> getTestBlocks (String syntheticModuleName)

Returns an ordered list of all tests blocks that should be executed for the specified module. Each test block is an array of JUnitHost.TestInfo.

Parameters
syntheticModuleName the name of the synthetic module
Returns
  • an ordered list of test blocks to run

public abstract boolean isSingleTestOnly ()

Check if this batching strategy only supports execution of a single test at a time. If this method returns true, test methods will be executed on the client as they are run by JUnit. If it returns false, test methods will be batched and sent to the clients in groups. If you are using a test runner that shards test methods across multiple clients, you should use a strategy that returns false (such as NoBatchingStrategy) or all tests will be executed on all clients.

Returns
  • true if batches never contain more than one test

Protected Methods

protected final Set<JUnitHost.TestInfo> getTestsForModule (String syntheticModuleName)

Get the set of tests for this module, minus tests that should not be executed.

Returns
  • the set of tests to execute

protected int getTimeoutMultiplier ()

Returns the multiplicative factor for adjusting the timeout. Default value of 1 for no batching.