org.finra.jtaf.core.model.execution
Class Interpreter

java.lang.Object
  extended by org.finra.jtaf.core.model.execution.Interpreter

public class Interpreter
extends Object

This class is invoked by the Automation Engine to begin execution


Field Summary
 ErrorAccumulator ea
           
 
Constructor Summary
Interpreter()
           
 
Method Summary
 void addDetails(TestStepsDetails details)
          Add details of the invocation to the list of test steps
 void addError(Throwable th)
          Add exception to the Error Accumulator and set the Test Status to 'Failed'
 InvocationTarget getInvocationTarget(Invocation invocation)
          Get the invocation target instance if it exists in the Command Registry else throw exception 'Invocation not found'
 List<TestStepsDetails> getTestStepDetails()
          Return the list of test steps in the current test
 TestResult interpret(TestScript test)
          Execute the commands in the testscript passed to the Interpreter.
 void setCommandRegistry(CommandRegistry commandRegistry)
          Set the command registry
 void setCommandRunnerPlugins(List<ICommandRunnerPlugin> commandRunnerPlugins)
          Add plugins that should run before or after a command
 void setTestRunnerPlugins(List<ITestRunnerPlugin> testRunnerPlugins)
          Add plugins that should run before or after a test
 void visitCommand(Command command)
          Invoke the command's launch API.
 void visitFunction(Function function)
          Execute the function, if any, present in the test
 void visitInvocation(Invocation invocation)
          Execute the commands in the testscript passed to the Interpreter.
 void visitInvocationList(InvocationList invocationtList)
          Execute the list of commands in the test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ea

public ErrorAccumulator ea
Constructor Detail

Interpreter

public Interpreter()
Method Detail

setTestRunnerPlugins

public void setTestRunnerPlugins(List<ITestRunnerPlugin> testRunnerPlugins)
Add plugins that should run before or after a test

Parameters:
testRunnerPlugins - => the list of test level plugins

setCommandRunnerPlugins

public void setCommandRunnerPlugins(List<ICommandRunnerPlugin> commandRunnerPlugins)
Add plugins that should run before or after a command

Parameters:
commandRunnerPlugins - => the list of command level plugins

setCommandRegistry

public void setCommandRegistry(CommandRegistry commandRegistry)
Set the command registry

Parameters:
commandRegistry -

interpret

public final TestResult interpret(TestScript test)
                           throws Throwable
Execute the commands in the testscript passed to the Interpreter. Execute custom plugins that are supposed to run before and after each test or each command. The test passes if this method executes without throwing an exception.

Parameters:
test - =>testscript object passed by the Automation Engine
Throws:
Throwable

getTestStepDetails

public List<TestStepsDetails> getTestStepDetails()
Return the list of test steps in the current test

Returns:

visitInvocationList

public void visitInvocationList(InvocationList invocationtList)
                         throws Throwable
Execute the list of commands in the test

Parameters:
invocationtList -
Throws:
Throwable

visitCommand

public void visitCommand(Command command)
                  throws Throwable
Invoke the command's launch API. Responsible of actual execution of the command

Parameters:
command - => current command object to be executed
Throws:
Throwable

visitFunction

public void visitFunction(Function function)
                   throws Throwable
Execute the function, if any, present in the test

Parameters:
function -
Throws:
Throwable

visitInvocation

public final void visitInvocation(Invocation invocation)
                           throws Throwable
Execute the commands in the testscript passed to the Interpreter.

Parameters:
invocation - =>testscript object passed by the Automation Engine
Throws:
Throwable

getInvocationTarget

public InvocationTarget getInvocationTarget(Invocation invocation)
                                     throws Throwable
Get the invocation target instance if it exists in the Command Registry else throw exception 'Invocation not found'

Parameters:
invocation -
Returns:
Throws:
Throwable

addDetails

public void addDetails(TestStepsDetails details)
Add details of the invocation to the list of test steps


addError

public void addError(Throwable th)
Add exception to the Error Accumulator and set the Test Status to 'Failed'

Parameters:
th -


Copyright © 2014. All rights reserved.