ariba.util.test
Class TestValidationParameter

java.lang.Object
  extended by ariba.util.test.TestValidationParameter

public class TestValidationParameter
extends java.lang.Object

A class to encapsulate the values returned by Validators within the Ariba UI Test Infrastructure. The class contains 3 key data items:

  1. name will be displayed in the UI to describe to testers what the paramter represents.
  2. value a string representation of the value, parameters must not contain any object Ids or other values which will change from test run to test run.
  3. key a string which will be used to match the parameter with values in future runs to check consistency of the application. You should minimize changes to keys in order to avoid artificially breaking existing test cases.
Devlopers writing Validators don't need to worry about the encoding/decoding described next.
The class also provides a variety of utility methods to help manage the encoding of parameters and lists of parameters into a string that is stored as part of the recorded Selenium test case. The String encoding of a list of validation parameters currently looks like:
        "ENCODING of VALIDATOR METHOD","key1","value1","key2","value2",...
    

See Also:
TestValidator

Constructor Summary
TestValidationParameter(java.lang.String name, java.util.List<TestValidationParameter> value)
           
TestValidationParameter(java.lang.String name, java.util.List objects, java.lang.String validatorToUseOnObjects, boolean validateOrder)
           
TestValidationParameter(java.lang.String name, java.lang.String value)
          Note that when using this constructor the key for this parameter will be set to the same value as the name.
TestValidationParameter(java.lang.String name, java.lang.String key, java.util.List<TestValidationParameter> value)
           
TestValidationParameter(java.lang.String name, java.lang.String key, java.util.List objects, java.lang.String validatorToUseOnObjects, boolean validateOrder)
           
TestValidationParameter(java.lang.String name, java.lang.String key, java.lang.String value)
          Construct a TestValidationParameter based on the provided data.
TestValidationParameter(java.lang.String name, java.lang.String key, TestValidationParameterList value)
           
TestValidationParameter(java.lang.String name, TestValidationParameterList value)
           
 
Method Summary
 boolean errorValue()
          Used by validation code to teel the display if this value was "interesting" from an error reporting perspective.
 void explodeNestedList(java.util.List<TestValidationParameter> newListOfValues)
           
 java.lang.String getKey()
           
 java.lang.String getName()
           
 java.lang.Object getValue()
           
 boolean isList()
           
 boolean isObjectList()
           
 boolean isValidateOrder()
           
 void objectList(boolean representsObjectList)
           
 void setErrorValue(boolean isError)
           
 java.lang.String theValidatorToUseForLists()
           
 void validateTheOrderOfTheList(boolean validateOrder)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               java.lang.String value)
Note that when using this constructor the key for this parameter will be set to the same value as the name. Use this only if the the name will be stable enough from run to run to avoid test failuers. If the name is a translated UI string that might change with translation revisions or with UI cleanup then use the constructor with a key and provide a more stable key.

Parameters:
name - a human friendly desription of the parameter.
value - a string representation of the value - must not contain any text that would change between test runs (e.g. object Ids, timestamps).

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               java.lang.String key,
                               java.lang.String value)
Construct a TestValidationParameter based on the provided data.

Parameters:
name - a human friendly desription of the parameter.
key - a stable string which will be used to match the parameter with values in future runs to check consistency of the application. You should minimize changes to keys in order to avoid artificially breaking existing test cases.
value - a string representation of the value - must not contain any text that would change between test runs (e.g. object Ids, timestamps).

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               TestValidationParameterList value)

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               java.lang.String key,
                               TestValidationParameterList value)

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               java.util.List<TestValidationParameter> value)

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               java.util.List objects,
                               java.lang.String validatorToUseOnObjects,
                               boolean validateOrder)

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               java.lang.String key,
                               java.util.List objects,
                               java.lang.String validatorToUseOnObjects,
                               boolean validateOrder)

TestValidationParameter

public TestValidationParameter(java.lang.String name,
                               java.lang.String key,
                               java.util.List<TestValidationParameter> value)
Method Detail

getName

public java.lang.String getName()

getValue

public java.lang.Object getValue()

getKey

public java.lang.String getKey()

isList

public boolean isList()

isObjectList

public boolean isObjectList()

isValidateOrder

public boolean isValidateOrder()

theValidatorToUseForLists

public java.lang.String theValidatorToUseForLists()

explodeNestedList

public void explodeNestedList(java.util.List<TestValidationParameter> newListOfValues)

validateTheOrderOfTheList

public void validateTheOrderOfTheList(boolean validateOrder)

objectList

public void objectList(boolean representsObjectList)

errorValue

public boolean errorValue()
Used by validation code to teel the display if this value was "interesting" from an error reporting perspective.

Returns:
true if this paramter was involved in producing an error.

setErrorValue

public void setErrorValue(boolean isError)


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.