org.gridgain.grid.test
Class GridTestRouterAdapter
java.lang.Object
org.gridgain.grid.test.GridTestRouterAdapter
- All Implemented Interfaces:
- GridTestRouter
public class GridTestRouterAdapter
- extends Object
- implements GridTestRouter
Round-Robin implementation of GridTestRouter interface.
The implementation makes sure that nodes are assigned to tests
sequentially, one after another.
Note that if GridTestVmParameters.GRIDGAIN_ROUTER_PREFER_REMOTE VM parameter
is set to true, then tests will be routed to remote nodes assuming there
are any. If there are no remote nodes, tests will be routed to local node.
-
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GridTestRouterAdapter
public GridTestRouterAdapter()
route
public GridNode route(Class<?> test,
String name,
Collection<GridNode> subgrid,
UUID locNodeId)
- Routes a test to a specific node. This method is provided so subclasses
could specify their own logic for routing tests. It should be useful
when some test can only be run on a specific node or on a specific
set of nodes.
By default tests are routed to grid nodes in round-robin fashion.
Set GridTestVmParameters.GRIDGAIN_ROUTER_PREFER_REMOTE VM parameter
to true to always route tests to remote nodes, assuming there are any.
If there are no remote nodes, then tests will still execute locally even
if this VM parameter is set.
- Specified by:
route in interface GridTestRouter
- Parameters:
test - Test class.name - Test name.subgrid - List of available grid nodes.locNodeId - Local node ID.
- Returns:
- Node this test should execute on.