/usr/share/doc/libantelope-java/manual/bk03ch24.html is in libantelope-java-doc 3.5.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 24. Repeat Task</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Antelope Users Guide"><link rel="up" href="bk03.html" title="Additional Ant Tasks"><link rel="prev" href="bk03ch23.html" title="Chapter 23. Split Task"><link rel="next" href="bk03ch25.html" title="Chapter 25. Suite Task"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Repeat Task</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch23.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch25.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 24. Repeat Task"><div class="titlepage"><div><div><h2 class="title"><a name="Repeat"></a>Chapter 24. Repeat Task</h2></div></div></div>
@style@
<p>
The Repeat task performs the same subtasks over and over a certain number of times or until a condition is met. Since most tasks are configured when the build file is first loaded and never again, this task may not do what you want.
</p><p>
To use this task in your build files, include a task definition like this:
</p><pre class="programlisting">
<taskdef name="call" classname="ise.antelope.tasks.Repeat"/>
</pre><p>
</p><p>
</p><div class="table"><a name="id2521487"></a><p class="title"><b>Table 24.1. Repeat Task Attributes</b></p><div class="table-contents"><table summary="Repeat Task Attributes" border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td>count</td><td>The number of times to repeat execution of the nested tasks.</td><td>1</td><td>No</td></tr><tr><td>interval</td><td>How long to wait between repetitions. If set to 0, only 1 repetition will be performed, this is to avoid a tight loop.</td><td>0</td><td>No</td></tr><tr><td>unit</td><td>The units for interval, allowed values are "milliseconds", "seconds", "minutes", "days", and "weeks"</td><td>seconds</td><td>No</td></tr><tr><td>property</td><td>The name of a property to set upon completion.</td><td>None</td><td>No</td></tr><tr><td>value</td><td>The value to set for the property to be set upon completion.</td><td>None</td><td>No</td></tr></tbody></table></div></div><p><br class="table-break">
</p><p>
Here are a number of examples taken from the unit tests for this task:
</p><pre class="programlisting">
<target name="test1a">
<!-- no count set, verify performs tasks once -->
<a:var name="count" value="0"/>
<a:repeat>
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
</a:repeat>
<a:assert>
<bool>
<mathequals arg1="${count}" arg2="1"/>
</bool>
</a:assert>
</target>
<target name="test1b">
<!-- count > 1, verify performs tasks correct number of times -->
<a:var name="count" value="0"/>
<a:repeat count="3" interval="1">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
</a:repeat>
<a:assert message="Expected 3, got ${count}">
<bool>
<mathequals arg1="${count}" arg2="3"/>
</bool>
</a:assert>
</target>
<target name="test1c">
<!-- count = -1, verify performs tasks indefinitely -->
<a:var name="count" value="0"/>
<a:limit maxwait="10">
<a:repeat count="-1" interval="1">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
</a:repeat>
</a:limit>
<a:assert>
<bool>
<and>
<a:isgreaterthan arg1="${count}" arg2="8"/>
<a:islessthan arg1="${count}" arg2="12"/>
</and>
</bool>
</a:assert>
</target>
<target name="test2a">
<!-- no interval set, verify performs tasks 10 seconds apart -->
<a:var name="count" value="0"/>
<a:stopwatch name="test2a_stopwatch" action="start"/>
<a:repeat count="2">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
</a:repeat>
<a:stopwatch name="test2a_stopwatch" action="total"/>
<a:assert message="Got ${count}, expected 2">
<bool>
<and>
<a:mathequals arg1="${count}" arg2="2"/>
<a:islessthan arg1="${test2a_stopwatch}" arg2="11"/>
</and>
</bool>
</a:assert>
</target>
<target name="test2b">
<!-- interval set to other than 10 seconds, verify tasks performed correct
time apart. -->
<a:var name="count" value="0"/>
<a:stopwatch name="test2b_stopwatch" action="start"/>
<a:repeat count="2" interval="5">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
</a:repeat>
<a:stopwatch name="test2b_stopwatch" action="total"/>
<a:assert>
<bool>
<and>
<a:mathequals arg1="${count}" arg2="2"/>
<a:islessthan arg1="${test2b_stopwatch}" arg2="6"/>
</and>
</bool>
</a:assert>
</target>
<target name="test2c">
<!-- interval = 0, verify tasks performed just once -->
<a:var name="count" value="0"/>
<a:stopwatch name="test2c_stopwatch" action="start"/>
<a:repeat count="5" interval="0">
<a:math result="count" operand1="${count}" operand2="1" operation="+" datatype="int"/>
</a:repeat>
<a:stopwatch name="test2c_stopwatch" action="total"/>
<a:assert>
<bool>
<and>
<a:mathequals arg1="${count}" arg2="1"/>
<a:islessthan arg1="${test2c_stopwatch}" arg2="1"/>
</and>
</bool>
</a:assert>
</target>
<target name="test3a">
<!-- failOnError not set, verify continues to execute tasks even if one fails -->
<a:var name="count" value="0"/>
<a:repeat count="3" interval="1">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
<fail/>
</a:repeat>
<a:assert>
<bool>
<a:mathequals arg1="${count}" arg2="3"/>
</bool>
</a:assert>
</target>
<target name="test3b">
<!-- failOnError set to false, same as 3a -->
<a:var name="count" value="0"/>
<a:repeat count="3" interval="1" failonerror="no">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
<fail/>
</a:repeat>
<a:assert>
<bool>
<a:mathequals arg1="${count}" arg2="3"/>
</bool>
</a:assert>
</target>
<target name="test3c">
<!-- failOnError set to true, verify build fails if subtask fails -->
<a:var name="count" value="0"/>
<a:try>
<a:repeat count="3" interval="1" failonerror="yes">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
<fail/>
</a:repeat>
</a:try>
<a:assert>
<bool>
<a:mathequals arg1="${count}" arg2="1"/>
</bool>
</a:assert>
</target>
<target name="test4a">
<!-- property name set, value not set, verify property is set to true when task
is complete -->
<a:var name="count" value="0"/>
<a:repeat count="1" interval="1" property="test4a_property">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
<fail/>
</a:repeat>
<a:assert>
<bool>
<istrue value="${test4a_property}"/>
</bool>
</a:assert>
</target>
<target name="test4b">
<!-- property ame set, value set to a specific value, verify property is set to
specific value when task is complete -->
<a:var name="count" value="0"/>
<a:repeat count="1" interval="1" property="test4b_property" value="good">
<a:math result="count" operand1="${count}" operand2="1" operation="+"/>
<fail/>
</a:repeat>
<a:assert name="test4b_property" value="good"/>
</target>
<target name="test5">
<property name="call_count" value="0"/>
<a:limit seconds="5" failonerror="true">
<a:repeat count="-1" interval="1">
<a:until>
<a:contains property="log_contents" substring="All tests passed 4 times." />
</a:until>
<echo>read log</echo>
<a:new>
<a:call target="readLog"/>
</a:new>
<echo>${call_count} - ${log_contents}</echo>
</a:repeat>
</a:limit>
</target>
<target name="readLog">
<a:unset name="log_contents"/>
<a:new>
<a:math result="call_count" operand1="${call_count}" operand2="1" operation="+" datatype="int"/>
<property name="log_contents" value="All tests passed ${call_count} times."/>
</a:new>
</target>
</pre><p>
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch23.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk03ch25.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 23. Split Task </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 25. Suite Task</td></tr></table></div></body></html>
|