Injecting a FileHandle

There are two easy ways to inject a service order into a module :
  • the "inject" element

  • the "inject" action

Inject element

The following test :
  • creates a FileHandle with filename "inject@@1"

  • references the FileHandle as "inject@@1"

  • calls onPut on the module named "getFh"

  • waits for the FileHandle with filename "inject@@1" to come to module "port1"

<test name="inject">
		<flow>flow1</flow>
		<inject mod="getFh">
			<fh filename="1"/>
		</inject>
		<expect mod="port1">
			<fh filename="1"/>
		</expect>
	</test>

Inject action

The following test :
  • creates a FileHandle with filename "inject@@1"

  • references the FileHandle as "inject@@1"

  • calls onPut on the module named "getFh"

  • waits for the FileHandle with filename "inject@@1" to come to the module "port1"

<test name="action_inject">
		<flow>flow1</flow>
		<description>Test wod : dataset validation</description>
		<expect mod="port1">
			<fh filename="1"/>
		</expect>
		<action>
			<inject mod="getFh">
				<fh filename="1"/>
			</inject>
		</action>
	</test>