com.reuters.msgtest.load.value
Class ValueLoopGenerator

java.lang.Object
  extended bycom.reuters.msgtest.load.value.ValueLoopGenerator
All Implemented Interfaces:
ValueGenerator

public class ValueLoopGenerator
extends java.lang.Object
implements ValueGenerator

ValueLoopGenerator implements arbitrarily deep nested loops of valuesets. Currently each valueset is either a delimlist or an integer range.

Version:
@VSS_FLAG_VERSION@
Author:
Cavit Aydin

Field Summary
 
Fields inherited from interface com.reuters.msgtest.load.value.ValueGenerator
RANDOM, SEQUENTIAL
 
Constructor Summary
ValueLoopGenerator(DelimListValueLoopHandler pDelimListValueLoop)
          Construct a ValueLoopGenerator where the top level loop is a delimeted string.
ValueLoopGenerator(IntValueLoopHandler pIntValueLoop)
          Construct a ValueLoopGenerator where the top level loop is an integer range.
 
Method Summary
 boolean changeValue()
          Changes the current value.
 java.util.List getAllSubstr()
          Returns all the substitution strings in this nested loop.
 java.lang.String getCurrentValue(java.lang.String pSubstr)
          Returns the value of the current element in this set corresponding to the given substitution string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueLoopGenerator

public ValueLoopGenerator(IntValueLoopHandler pIntValueLoop)
Construct a ValueLoopGenerator where the top level loop is an integer range.

Parameters:
pIntValueLoop - the integer value loop object passed from the xml config file.

ValueLoopGenerator

public ValueLoopGenerator(DelimListValueLoopHandler pDelimListValueLoop)
Construct a ValueLoopGenerator where the top level loop is a delimeted string.

Parameters:
pDelimListValueLoop - the delimeter list loop object passed from the xml config file.
Method Detail

getCurrentValue

public java.lang.String getCurrentValue(java.lang.String pSubstr)
                                 throws RvTestException
Description copied from interface: ValueGenerator
Returns the value of the current element in this set corresponding to the given substitution string.

Specified by:
getCurrentValue in interface ValueGenerator
Parameters:
pSubstr - the substitution string
Returns:
the current element value as string
Throws:
RvTestException
See Also:
ValueGenerator.getCurrentValue(java.lang.String)

changeValue

public boolean changeValue()
Description copied from interface: ValueGenerator
Changes the current value. The choice of the new element can be by any criteria implemented by the subclasses. The return value is used as an indication to the calling code that this set has exhausted its current range of values. This is especially helpful for an outer loop to detect the end of loop condition for an inner loop. For large random sets relying on this value may not be efficient, so it should avoided.

Specified by:
changeValue in interface ValueGenerator
Returns:
true, if all the unique values have been exhausted and the current value is a duplicate
See Also:
ValueGenerator.changeValue()

getAllSubstr

public java.util.List getAllSubstr()
Returns all the substitution strings in this nested loop.

Returns:
an ArrayList of substitution strings


Copyright © 2002-2004 The RVTest Team. All Rights Reserved.