com.googlecode.lightest.core
Class SimpleDispatcherAssignmentStrategy

java.lang.Object
  extended by com.googlecode.lightest.core.QueuedDispatcherAssignmentStrategy
      extended by com.googlecode.lightest.core.SimpleDispatcherAssignmentStrategy
All Implemented Interfaces:
IDispatcherAssignmentStrategy, groovy.lang.GroovyObject

public class SimpleDispatcherAssignmentStrategy
extends QueuedDispatcherAssignmentStrategy
implements groovy.lang.GroovyObject, IDispatcherAssignmentStrategy

A bare-bones subclass of QueuedDispatcherAssignmentStrategy that should be sufficient for most cases of multi-environment test runs.


Constructor Summary
SimpleDispatcherAssignmentStrategy()
           
 
Method Summary
protected  List getCompatibleDispatchers(LightestTestCase testcase)
          The canRunIn() method on the testcase is used as the compatibility test.
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String name)
           
 Object invokeMethod(String name, Object args)
           
 void setDispatchers(List dispatchers)
          Sets the ITaskDispatchers this strategy is capable of assigning testcases to.
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
 
Methods inherited from class com.googlecode.lightest.core.QueuedDispatcherAssignmentStrategy
assign, getAvailableDispatchers, setAssignmentTimeout, unassign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.googlecode.lightest.core.IDispatcherAssignmentStrategy
assign, unassign
 

Constructor Detail

SimpleDispatcherAssignmentStrategy

public SimpleDispatcherAssignmentStrategy()
Method Detail

setDispatchers

public void setDispatchers(List dispatchers)
Description copied from interface: IDispatcherAssignmentStrategy
Sets the ITaskDispatchers this strategy is capable of assigning testcases to.

Specified by:
setDispatchers in interface IDispatcherAssignmentStrategy

getCompatibleDispatchers

protected List getCompatibleDispatchers(LightestTestCase testcase)
The canRunIn() method on the testcase is used as the compatibility test. If it returns true for the environment associated with a given dispatcher, that dispatcher is considered compatible, and will be included in the returned list. Otherwise, it will be excluded.

Specified by:
getCompatibleDispatchers in class QueuedDispatcherAssignmentStrategy
Parameters:
testcase - the testcase for which to return a list of compatible dispatchers

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject
Overrides:
getMetaClass in class QueuedDispatcherAssignmentStrategy

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject
Overrides:
setMetaClass in class QueuedDispatcherAssignmentStrategy

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class QueuedDispatcherAssignmentStrategy

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class QueuedDispatcherAssignmentStrategy

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject
Overrides:
setProperty in class QueuedDispatcherAssignmentStrategy


Copyright © 2009. All Rights Reserved.