Implicit and Explicit Scoping for Object References

The following xml attributes are automatically scoped using the test name:
  • so::orderId, sod:orderId, pod::orderId, wod::orderId

  • fh::filename

  • any "object" attribute on any xml element

The scoper string is "@@".

This statement implies that :
  • the previously listed attributes will be prefixed with testName + "@@"

  • a service order will be referenced as testName + "@@" + orderId

  • a file handle will be referenced as filename + "@@" + orderId

This functionality allow users to give very short names to their objects both for creation and validation. If a test needs an object that has been referenced in a previous test, always use its fully scoped reference to access it.

Example 1

This example uses implicit scoping for so orderId setting and validation.

<test name="test_so_orderId_1">
		<flow>flow1</flow>
		<description>Test so : orderId unscoped validation</description>
		<inject mod="getSo">
			<so orderId="1"/>
		</inject>
		<expect mod="port1">
			<so orderId="1"/>
		</expect>
	</test>

Example 2

This example uses implicit scoping for so creation and explicit scopping for orderId validation. This explicit scoping is essentially used to access objects that have been created in a test other than the current one.

Notice that explicit scoping can also be used for so creation.

<test name="test_so_orderId_2">
		<flow>flow1</flow>
		<description>Test so : orderId scoped validation</description>
		<inject mod="getSo">
			<so orderId="1"/>
		</inject>
		<expect mod="port1">
			<so orderId="test_so_orderId_2@@1"/>
		</expect>
	</test>

Example 3

This example shows that implicit scoping is used for the "object" attribute of an invoke. The object is referenced as "test_action_createSo_1@@1".

<test name="test_action_createSo_1">
		<description>Test action createSo</description>
		<action>
			<createSo orderId="1">
				<attr name="priority" value="1"/>
				<sod/>
			</createSo>
			<checkObject object="1">
				<attr name="priority" value="1"/>
			</checkObject>
			<finishTest/>
		</action>
	</test>