net.sf.jameleon.plugin.jagacy
Class JagacyFunctionTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.LocationAwareTagSupport
          extended by net.sf.jameleon.JameleonTagSupport
              extended by net.sf.jameleon.function.FunctionTag
                  extended by net.sf.jameleon.plugin.jagacy.JagacyFunctionTag
All Implemented Interfaces:
BreakPoint, Attributable, Storable, DynaTag, LocationAware, Tag
Direct Known Subclasses:
JagacyIsTextPresentTag, JagacySendKeyTag, JagacySetFieldTag, JagacySetValueForLabelTag, JagacyValidateTextNotPresentTag, JagacyValidateTextPresentTag, JagacyWaitForChangeTag, JagacyWaitForTextTag

public abstract class JagacyFunctionTag
extends FunctionTag


Field Summary
protected  com.jagacy.Session3270 session
           
protected  JagacySessionTag sessionTag
           
 
Fields inherited from class net.sf.jameleon.function.FunctionTag
addt, breakPoint, expectException, expectFailure, fResults, functionDelay, functionId, lastFileWritten, log, NO_DELAY, params, postcondition, precondition, st, state, tct, vpt
 
Fields inherited from class net.sf.jameleon.JameleonTagSupport
attributes, broker, contextVars, fp, unsupportedAttributes
 
Fields inherited from class net.sf.jameleon.LocationAwareTagSupport
columnNumber, elementTagName, lineNumber, scriptFileName
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
JagacyFunctionTag()
           
 
Method Summary
 void assertTextNotPresent(String text)
          Checks that the provided text doesn't exist in the current screen
 void assertTextNotPresent(String text, int assertLevel)
          Checks that the provided text doesn't exist in the current screen
 void assertTextNotPresent(String msg, String text)
          Checks that the provided text exists in the current screen
 void assertTextNotPresent(String msg, String text, int assertLevel)
          Checks that the provided text doesn't exist in the current screen
 void assertTextPresent(String text)
          Checks that the provided text exists in the current screen
 void assertTextPresent(String text, int assertLevel)
          Checks that the provided text exists in the current screen
 void assertTextPresent(String message, String text)
          Checks that the provided text exists in the current screen
 void assertTextPresent(String message, String text, int assertLevel)
          Checks that the provided text exists in the current screen
 String getScreen()
           
 void pluginTearDown()
           
 String readField(int field, int offset)
          Reads the value in the given field.
 String readPosition(int row, int column, int length)
          Reads the value at the current position.
 String[] readScreen()
          Reads the current screen.
 void setupEnvironment()
          Gets the references of the session and the test results from the parent TestCase This method gets called once all attributes are set from the macro language.
 void store(String fName, int event)
           
 boolean waitForChange(int timeInMillis)
          Waits for timeInMillis for the screen to change state.
 boolean waitForField(int field, int offset, String value, int timeInMillis)
          Waits (in 100 millisecond intervals) for the value to appear at the given field and offset.
 boolean waitForPosition(int row, int column, String value, int timeInMillis)
          Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.
 boolean waitForUnlock(int timeInMillis)
          Waits for timeInMillis for the keyboard to unlock.
 void writeAfterLabel(String label, String value)
          Finds a label and attempts to enter the given text in the field directly after the label
 void writeCursor(int row, int column)
          Writes the cursor at the given coordinates
 void writeField(int field, int offset, String value)
          Writes the given text to the nth field
 void writeKey(com.jagacy.Key key)
          Writes the given Key to the screen.
 void writePosition(int row, int column, String value)
          Writes a string at the given coordinates
 void writeString(String value)
          Writes the given String to the current cursor position
 
Methods inherited from class net.sf.jameleon.function.FunctionTag
addParam, addRequiredAttribute, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertFalse, assertFalse, assertMethod, assertMethodWithLevel, assertNotNull, assertNotNull, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNotSame, assertNotSame, assertNull, assertNull, assertNull, assertNull, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertSame, assertSame, assertSame, assertSame, assertTextContains, assertTextContains, assertTextContains, assertTextContains, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTrue, assertTrue, assertTrue, assertTrue, checkParamTypes, cleanUp, cleanUpEnvironment, delay, delay, doTag, fail, fail, fail, fail, getFunctionId, getFunctionResults, getMatchingRegexText, getParam, getParamLength, getParams, getParentTags, getSessionTag, getStoreToFileName, getStringOrDefault, getTestCaseTag, getVariable, getVariableAsBoolean, getVariableAsList, getVariableAsString, isBreakPoint, isContextVariableNull, recordFunctionResult, regexMatches, removeFunctionResult, removeVariable, setDefaultVariableValue, setDefaultVariableValue, setExpectException, setExpectFailure, setFunctionDelay, setFunctionId, setup, setUpFunctionResults, setVariable, tearDown, testBlock, traceMsg, validate
 
Methods inherited from class net.sf.jameleon.JameleonTagSupport
cleanVariablesInContext, createAttributes, describeAttributes, getAttributeBroker, getAttributes, getAttributeType, getClassAttributes, getFunctionalPoint, getUnsupportedAttributes, loadFunctionalPoint, resetFunctionalPoint, setAttribute, setVariableInContext, testForUnsupportedAttributesCaught
 
Methods inherited from class net.sf.jameleon.LocationAwareTagSupport
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

sessionTag

protected JagacySessionTag sessionTag

session

protected com.jagacy.Session3270 session
Constructor Detail

JagacyFunctionTag

public JagacyFunctionTag()
Method Detail

setupEnvironment

public void setupEnvironment()
Gets the references of the session and the test results from the parent TestCase This method gets called once all attributes are set from the macro language. Any required setup should go here.

Overrides:
setupEnvironment in class FunctionTag

pluginTearDown

public void pluginTearDown()
Overrides:
pluginTearDown in class FunctionTag

store

public void store(String fName,
                  int event)
           throws IOException
Specified by:
store in interface Storable
Overrides:
store in class FunctionTag
Throws:
IOException

getScreen

public String getScreen()

readField

public String readField(int field,
                        int offset)
Reads the value in the given field.

Parameters:
field - - The field number, indexed from 1
offset - - Offset in the field, indexed from 1
Returns:
The value of the given field.

readPosition

public String readPosition(int row,
                           int column,
                           int length)
Reads the value at the current position.

Parameters:
row - - The row number, indexed from 0
column - - The column number, indexed from 0
length - - The length of string to read
Returns:
The value of the given position.

readScreen

public String[] readScreen()
Reads the current screen.

Returns:
An array of lines on the screen.

waitForChange

public boolean waitForChange(int timeInMillis)
Waits for timeInMillis for the screen to change state.

Parameters:
timeInMillis - - the time in milliseconds to wait until the screen changes.
Returns:
true if the screen changed

waitForField

public boolean waitForField(int field,
                            int offset,
                            String value,
                            int timeInMillis)
Waits (in 100 millisecond intervals) for the value to appear at the given field and offset.

Parameters:
field - - The field number, indexed from 1
offset - - Offset in the field, indexed from 1
value - - The expected value of the field
timeInMillis - - the time in milliseconds to wait until the screen changes.
Returns:
true if the field is displayed

waitForPosition

public boolean waitForPosition(int row,
                               int column,
                               String value,
                               int timeInMillis)
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.

Parameters:
row - - The row number, indexed from 0
column - - The column number, indexed from 0
value - - The expected value at this position
timeInMillis - - the time in milliseconds to wait until the screen changes.
Returns:
true if the position is displayed

waitForUnlock

public boolean waitForUnlock(int timeInMillis)
Waits for timeInMillis for the keyboard to unlock.

Parameters:
timeInMillis - - the time in milliseconds to wait until the screen changes.
Returns:
true if the keyboard unlocked

writeAfterLabel

public void writeAfterLabel(String label,
                            String value)
Finds a label and attempts to enter the given text in the field directly after the label

Parameters:
label - - the text to the left of the field
value - - the value to set the field to.

writeCursor

public void writeCursor(int row,
                        int column)
Writes the cursor at the given coordinates

Parameters:
row - - the row the set the cursor on. Indexed from 0.
column - - the column to set the cursor on. Indexed from 0.

writeField

public void writeField(int field,
                       int offset,
                       String value)
Writes the given text to the nth field

Parameters:
field - - The field number, indexed from 1
offset - - Offset in the field, indexed from 1
value - - The value to set the field to

writeKey

public void writeKey(com.jagacy.Key key)
Writes the given Key to the screen.

Parameters:
key - - the key to write to the screen

writePosition

public void writePosition(int row,
                          int column,
                          String value)
Writes a string at the given coordinates

Parameters:
row - - the row the field exists at. Indexed from 0.
column - - the column the field exists at. Indexed from 0.
value - - the value to set the field to.

writeString

public void writeString(String value)
Writes the given String to the current cursor position

Parameters:
value - - the value to write to the current cursor position.

assertTextPresent

public void assertTextPresent(String text)
Checks that the provided text exists in the current screen

Parameters:
text - - the text that should be contained in the current screen

assertTextPresent

public void assertTextPresent(String text,
                              int assertLevel)
Checks that the provided text exists in the current screen

Parameters:
text - - the text that should be contained in the current screen
assertLevel - - only run this test under the assertLevel as described in AssertLevel

assertTextPresent

public void assertTextPresent(String message,
                              String text)
Checks that the provided text exists in the current screen

Parameters:
message - - the message to provide if an error occurs
text - - the text that should be contained in the current screen

assertTextPresent

public void assertTextPresent(String message,
                              String text,
                              int assertLevel)
Checks that the provided text exists in the current screen

Parameters:
message - - the message to provide if an error occurs
text - - the text that should be contained in the current screen
assertLevel - - only run this test under the assertLevel as described in AssertLevel

assertTextNotPresent

public void assertTextNotPresent(String text)
Checks that the provided text doesn't exist in the current screen

Parameters:
text - - the text that should not be contained in the current screen

assertTextNotPresent

public void assertTextNotPresent(String text,
                                 int assertLevel)
Checks that the provided text doesn't exist in the current screen

Parameters:
text - - the text that should not be contained in the current screen
assertLevel - - only run this test under the assertLevel as described in AssertLevel

assertTextNotPresent

public void assertTextNotPresent(String msg,
                                 String text)
Checks that the provided text exists in the current screen

Parameters:
msg - - the message to provide if an error occurs
text - - the text that should not be contained in the current screen

assertTextNotPresent

public void assertTextNotPresent(String msg,
                                 String text,
                                 int assertLevel)
Checks that the provided text doesn't exist in the current screen

Parameters:
msg - - the message to provide if an error occurs
text - - the text that should not be contained in the current screen
assertLevel - - only run this test under the assertLevel as described in AssertLevel


Copyright © 2005-2008 Christian Hargraves. All Rights Reserved.