org.finra.jtaf.core.commands
Class Multipath

java.lang.Object
  extended by org.finra.jtaf.core.model.invocationtarget.InvocationTarget
      extended by org.finra.jtaf.core.model.invocationtarget.Command
          extended by org.finra.jtaf.core.commands.Multipath

public class Multipath
extends Command

Used to specify control paths that have the same end result. This allows testers to write their scripts at a higher level of abstraction rather than paying attention to an explicit set of actions that need to be performed. TODO: Add an optional weight to each of the paths. This will cause certain paths to be executed w/ a higher probability.


Field Summary
 
Fields inherited from class org.finra.jtaf.core.model.invocationtarget.Command
interpreter, recordResult
 
Fields inherited from class org.finra.jtaf.core.model.invocationtarget.InvocationTarget
globalContext
 
Constructor Summary
Multipath(String name)
          This called when instantiating the command before it is executed by the interpreter.The recordResult variable is set to false because details about the Multipath step aren't needed, unlike the commands within the Multipath block.
 
Method Summary
protected  void execute(IInvocationContext ctx)
          This randomly picks a path and executes all commands in the block.
 
Methods inherited from class org.finra.jtaf.core.model.invocationtarget.Command
acceptInvocationTargetVisitor, clearContext, deinitialize, executeInvocation, getBooleanOrDefault, getContext, getFloatOrDefault, getIntegerOrDefault, getOptionalObject, getOptionalString, getRequiredBoolean, getRequiredFloat, getRequiredInteger, getRequiredObject, getRequiredString, getStringOrDefault, initialize, launch, recordResult
 
Methods inherited from class org.finra.jtaf.core.model.invocationtarget.InvocationTarget
addOptionalParameter, addProduction, addRequiredParameter, cleanGlobalContext, getAllParameters, getFromGlobalContext, getGlobalContext, getName, getOptionalParameters, getProductions, getRequiredParameters, getUsage, putToGlobalContext, setGlobalContext, setUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Multipath

public Multipath(String name)
          throws NameFormatException
This called when instantiating the command before it is executed by the interpreter.The recordResult variable is set to false because details about the Multipath step aren't needed, unlike the commands within the Multipath block.

Parameters:
name - - name of the command
Throws:
NameFormatException
Method Detail

execute

protected void execute(IInvocationContext ctx)
                throws Throwable
This randomly picks a path and executes all commands in the block. For this command, 'Path' is a named Block command.

Specified by:
execute in class Command
Parameters:
ctx - - The current context when this method is executed.
Throws:
Throwable - - Any exception thrown by a command within the Repeat block.


Copyright © 2014. All rights reserved.