Description

The SegmentDataCreatorReceiver morphs a Domain's generated data into name/value pair XML segments. Each XML segment represents a single Domain of test data.  Each segment can also reference a parent Domain from another segment to ensure referential integrity between parent/child relationships. It formats data generically this way so that other Receivers that can read XML segment files may merge the segmented data into complex nested output formats. The Receivers that use segment generated XML files are the following:

  • XMLSegmentMergeReceiver
  • JSONSegmentMergeReceiver

Parameters

The SegmentDataCreatorReceiver requires that the following parameters are defined:

  • outputPath - Defines the location to store the generated XML segment file.
  • fileName - Defines the name of the generated segment file.

Receiver Attribute Property Keys

The Receiver defines two property keys that can be modified on any of its associated Domain Attributes:

  • aliasName - Can be used to override the Attribute name.
  • parentId - Defines a reference to a parent segment.
  • include - Determines if the given Attribute will be included in the segment output.

File Name Convention

  • Though not strictly enforced, a segment file name should end with Segment.xml (e.g. UserSegment.xml) 

Example Scenario

A user has two Domains that she wants data to be generated for.  

  • Organization - Generated test data for three Organizations.
  • Department - Each Organization should have three Departments.


Organization Segment Output

Since the Organization Domain is the root Domain, the segment is generated without a parentId.


<segments>
  <segment loopCount="1">
    <data>
      <attribute name="id">1</attribute>
      <attribute name="name">Organization 1</attribute>
      <attribute name="address">1000 N Washington Dr</attribute>
      <attribute name="city">Montpelier</attribute>
      <attribute name="state">VT</attribute>
      <attribute name="zipCode">05061</attribute>
      <attribute name="webAddress">www.org1.com</attribute>
    </data>
  </segment>
  <segment loopCount="1">
    <data>
      <attribute name="id">2</attribute>
      <attribute name="name">Organization 2</attribute>
      <attribute name="address">1001 S Adams Sq</attribute>
      <attribute name="city">Saint Paul</attribute>
      <attribute name="state">MN</attribute>
      <attribute name="zipCode">55101</attribute>
      <attribute name="webAddress">www.org2.com</attribute>
    </data>
  </segment>
  <segment loopCount="1">
    <data>
      <attribute name="id">3</attribute>
      <attribute name="name">Organization 3</attribute>
      <attribute name="address">1002 E Jefferson Ct</attribute>
      <attribute name="city">Columbus</attribute>
      <attribute name="state">OH</attribute>
      <attribute name="zipCode">43805</attribute>
      <attribute name="webAddress">www.org3.com</attribute>
    </data>
  </segment>
</segments>


Department Segment Output

Since the Department Domain is a child of the Organization Domain and there must be three departments for each Organization, the segments will be generated in groups of three with parentId's.


<segments>
  <segment parentId="1" loopCount="3">
    <data>
      <attribute name="id">1</attribute>
      <attribute name="name">Department 1</attribute>
      <attribute name="manager">Zelma Q. Lao</attribute>
      <attribute name="emailAddress">zelma.lao@gmail.com</attribute>
    </data>
    <data>
      <attribute name="id">2</attribute>
      <attribute name="name">Department 2</attribute>
      <attribute name="manager">Elisha Z. Cardinal</attribute>
      <attribute name="emailAddress">elisha.cardinal@yahoo.com</attribute>
    </data>
    <data>
      <attribute name="id">3</attribute>
      <attribute name="name">Department 3</attribute>
      <attribute name="manager">Oliver G. Mark</attribute>
      <attribute name="emailAddress">oliver.mark@email.com</attribute>
    </data>
  </segment>
  <segment parentId="2" loopCount="3">
    <data>
      <attribute name="id">4</attribute>
      <attribute name="name">Department 1</attribute>
      <attribute name="manager">Piedad I. Liggett</attribute>
      <attribute name="emailAddress">piedad.liggett@yahoo.com</attribute>
    </data>
    <data>
      <attribute name="id">5</attribute>
      <attribute name="name">Department 2</attribute>
      <attribute name="manager">Beatrice L. Lafferty</attribute>
      <attribute name="emailAddress">beatrice.lafferty@email.com</attribute>
    </data>
    <data>
      <attribute name="id">6</attribute>
      <attribute name="name">Department 3</attribute>
      <attribute name="manager">Alva X. Vanmeter</attribute>
      <attribute name="emailAddress">alva.vanmeter@gmail.com</attribute>
    </data>
  </segment>
  <segment parentId="3" loopCount="3">
    <data>
      <attribute name="id">7</attribute>
      <attribute name="name">Department 1</attribute>
      <attribute name="manager">Rodger T. Catania</attribute>
      <attribute name="emailAddress">rodger.catania@email.com</attribute>
    </data>
    <data>
      <attribute name="id">8</attribute>
      <attribute name="name">Department 2</attribute>
      <attribute name="manager">Lara V. Groce</attribute>
      <attribute name="emailAddress">lara.groce@yahoo.com</attribute>
    </data>
    <data>
      <attribute name="id">9</attribute>
      <attribute name="name">Department 3</attribute>
      <attribute name="manager">Roosevelt V. Hudgens</attribute>
      <attribute name="emailAddress">roosevelt.hudgens@email.com</attribute>
    </data>
  </segment>
</segments>