com.appfoundation.automation.framework.gwen.business
Class ActionAssembler

java.lang.Object
  extended by com.appfoundation.automation.framework.gwen.business.ActionAssembler

public class ActionAssembler
extends java.lang.Object

ActionAssembler

The purpose of this class is to take a list of Sentences and convert them into Assembled Actions.

Author:
john.valentino

Field Summary
private  LocatorAssembler locatorAssembler
          Service used for assembling locators
 
Constructor Summary
ActionAssembler()
           
 
Method Summary
protected  AssembledAction assemble(Sentence line)
          Assembles an action based on the given unprocessed line (sentence)
protected  AssertAction deriveAssertAction(Sentence line)
          Derives an Assert Action from the given Sentence
protected  BeginTestAction deriveBeginTestAction(Sentence line)
          Derives a Begin Test Action from the given Sentence
protected  BrowsersAction deriveBrowsersAction(Sentence line)
          Derives a Browsers Action from the given Sentence
protected  ClearAction deriveClearAction(Sentence line)
          Derives a Clear Action from the given Sentence
protected  ClickAction deriveClickAction(Sentence line)
          Derives a Click Action from the given Sentence
protected  CommandLineAction deriveCommandLineAction(Sentence line)
           
protected  DragAndDropAction deriveDragAndDropAction(Sentence line)
           
protected  EndTestAction deriveEndTestAction(Sentence line)
          Derives an End Test Action from the given Sentence
 Locator deriveLocator(java.lang.String actionString, int startingIndex, Sentence line)
          Derives a Locator starting at the specified index in the given Sentence
protected  ScreenshotAction deriveScreenshotAction(Sentence line)
          Derives a Screenshot Action from the given Sentence
protected  ScreenshotsAction deriveScreenshotsAction(Sentence line)
          Derives a Screenshots Action from the given Sentence.
protected  SwitchAction deriveSwitchAction(Sentence line)
           
protected  TestAction deriveTestAction(Sentence line)
          Derives a Test Action from the given Sentence
protected  TypeAction deriveTypeAction(Sentence line)
          Derives a Type Action from the given Sentence
protected  UrlAction deriveUrlAction(Sentence line)
          Derives a Url Action from the given Sentence
protected  WaitAction deriveWaitAction(Sentence line)
          Derives a Wait Action from the given Sentence
protected  Action determineAction(Sentence line)
          Determines the type of action from the given Sentence
protected  Browser findBrowser(java.lang.String element)
          Returns the browser based on the given element from a sentence
 AssembledFile process(SentenceFile file)
          Converts a file of Sentences into a file of Assembled Actions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locatorAssembler

private LocatorAssembler locatorAssembler
Service used for assembling locators

Constructor Detail

ActionAssembler

public ActionAssembler()
Method Detail

process

public AssembledFile process(SentenceFile file)
Converts a file of Sentences into a file of Assembled Actions.

Parameters:
file -
Returns:

assemble

protected AssembledAction assemble(Sentence line)
Assembles an action based on the given unprocessed line (sentence)

Parameters:
line -
Returns:

determineAction

protected Action determineAction(Sentence line)
                          throws ActionException
Determines the type of action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveTestAction

protected TestAction deriveTestAction(Sentence line)
                               throws ActionException
Derives a Test Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveUrlAction

protected UrlAction deriveUrlAction(Sentence line)
                             throws ActionException
Derives a Url Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveBrowsersAction

protected BrowsersAction deriveBrowsersAction(Sentence line)
                                       throws ActionException
Derives a Browsers Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveWaitAction

protected WaitAction deriveWaitAction(Sentence line)
                               throws ActionException
Derives a Wait Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveLocator

public Locator deriveLocator(java.lang.String actionString,
                             int startingIndex,
                             Sentence line)
                      throws ActionException
Derives a Locator starting at the specified index in the given Sentence

Parameters:
actionString -
startingIndex -
line -
Returns:
Throws:
ActionException

findBrowser

protected Browser findBrowser(java.lang.String element)
Returns the browser based on the given element from a sentence

Parameters:
element -
Returns:

deriveScreenshotAction

protected ScreenshotAction deriveScreenshotAction(Sentence line)
                                           throws ActionException
Derives a Screenshot Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveAssertAction

protected AssertAction deriveAssertAction(Sentence line)
                                   throws ActionException
Derives an Assert Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveClickAction

protected ClickAction deriveClickAction(Sentence line)
                                 throws ActionException
Derives a Click Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveDragAndDropAction

protected DragAndDropAction deriveDragAndDropAction(Sentence line)
                                             throws ActionException
Throws:
ActionException

deriveSwitchAction

protected SwitchAction deriveSwitchAction(Sentence line)
                                   throws ActionException
Throws:
ActionException

deriveBeginTestAction

protected BeginTestAction deriveBeginTestAction(Sentence line)
                                         throws ActionException
Derives a Begin Test Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveEndTestAction

protected EndTestAction deriveEndTestAction(Sentence line)
                                     throws ActionException
Derives an End Test Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveTypeAction

protected TypeAction deriveTypeAction(Sentence line)
                               throws ActionException
Derives a Type Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveScreenshotsAction

protected ScreenshotsAction deriveScreenshotsAction(Sentence line)
                                             throws ActionException
Derives a Screenshots Action from the given Sentence.

Parameters:
line -
Returns:
Throws:
ActionException

deriveClearAction

protected ClearAction deriveClearAction(Sentence line)
                                 throws ActionException
Derives a Clear Action from the given Sentence

Parameters:
line -
Returns:
Throws:
ActionException

deriveCommandLineAction

protected CommandLineAction deriveCommandLineAction(Sentence line)
                                             throws ActionException
Throws:
ActionException