Tests that cx:wait-for-update works. It relies on the fact that calling the time-of-day service only updates every 10 seconds, so it’s highly likely to have to wait a bit.
Test wait-for-update-001.xml is expected to pass.
It requires the following features: webaccess.
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0">
<p:import href="https://xmlcalabash.com/ext/library/wait-for-update.xpl"/>
<p:import href="https://xmlcalabash.com/ext/library/pipeline-messages.xpl"/>
<p:output port="result" sequence="true"/>
<p:option name="WHOST" select="'http://localhost:8246'" static="true"/>
<cx:wait-for-update name="wait" href="{$WHOST}/service/time-of-day"/>
<cx:pipeline-messages p:depends="wait" level="debug"/>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="cx" uri="http://xmlcalabash.com/ns/extensions"/>
<s:pattern>
<s:rule context="/">
<s:assert test="cx:messages">The root is wrong.</s:assert>
<s:assert test="exists(cx:messages/cx:message [@level = 'DEBUG' and starts-with(@message, 'Waiting for http:')])">Did not find waiting message.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Added static options for web server host and port.
Created test.