What is Peach
Installing
Tutorials
Methodology
Introduction
FAQ
Peach 3
Peach Pits
 General Conf
 Data Modeling
 State Modeling
 Agents
  Monitors
 Test
  Publishers
  Loggers
Running
Minset
Peach 2.3

License

Data

Data elements are used to create and load default sets of data into DataModels. This data overwrites the default data in the value attributes of the data elements. To match the data into the correct elements, Peach will "crack" the data and fail if the data does not fit. This is done the same way data is cracked from an input Action.

There are currently three ways to load data, first is from a file, the second is via a python expression, and the third is by setting values field by field.

The Data element is a valid top level element (child of <Peach>) when defining sets of data to be referenced later on. It is also valid as a child of Action when used to both define data or reference an existing top level definition.

If multiple Data files xml blocks are specified, the attribute switchCount with the random strategy can be used to specify the number of iterations performed before switching to the next.


<DataModel name="MyDataModel">
   <Block name="FooBlock">
      <String name="Value" />
   </Block>
</DataModel>

<Data name="HelloWorldDataSet">
  <Field name="FooBlock.Value" value="Hello World!" />
</Data>

<Data name="LoadFromFile" fileName="sample.bin" />

Attributes:

  • name — Name of the DataModel [required]

  • ref — Reference to a DataModel to use as a template [optional]

  • fileName — Name of file to load, or folder with files to cycle through [optional]

Valid Child-Elements:

Examples

Multiple Data elements switched after switchCount iterations"

<StateModel name="TheState">
  <State name="initial">
    <Action type="output">
      <DataModel ref="TheDataModel" />
      <Data name="SampleData1">
        <Field name="Block1.Value" value="Hello World!" />
      </Data>
      <Data name="SampleData2">
        <Field name="Block1.Value" value="Good Afternoon World!" />
      </Data>
    </Action>
  </State>
</StateModel>