Initialisation

The big obstacle to testing initialisation is that during initialisation almost nothing is available: you are unable to use instance values, or calculations. The original 1.* test suite just displayed a dialogue box to announce that the initialisation events had been received:

<message ev:event="xforms-model-construct">xforms-model-construct received</message>

However, in the version 2 test suite, we have succeeded in finding a way to record that the event happened, in an instance value, so that the test can self-check.

When we receive the initialisation event, all we do is dispatch a new event with a delay long enough to allow initialisation to complete (1000 milliseconds is more than enough):

<action ev:event="xforms-model-construct">
   <dispatch name="yes" delay="1000" targetid="M"/>
</action>

When the new event is caught, initialisation will have finished, and we can then record that the initial event was seen:

<action ev:event="yes">
   <setvalue ref="test[1]">xforms-model-construct</setvalue>
</action>