/usr/share/doc/libantelope-java/manual/bk03ch25.html is in libantelope-java-doc 3.5.1-4.
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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 25. Suite Task</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Antelope Users Guide"><link rel="up" href="bk03.html" title="Additional Ant Tasks"><link rel="prev" href="bk03ch24.html" title="Chapter 24. Repeat Task"><link rel="next" href="bk03ch26.html" title="Chapter 26. TestCase 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 25. Suite Task</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch24.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch26.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="suitetask"></a>Chapter 25. Suite Task</h1></div></div></div>
@style@
<p>
Modeled after the TestSuite provided by jUnit, this class is an Ant task that
looks through the build file that contains this task, calls a 'setUp' target
(if it exists), then executes all nested tasks, and last calls
a target named 'tearDown' (if it exists). Both 'setUp' and 'tearDown' are
optional targets in the build file. A build file may contain multiple suite tasks, note that each invocation will call 'setUp' and 'tearDown', so you may want to use some conditionals to only have them execute once.
</p><p>
<span class="bold"><strong>While this task and the associated 'testcase' task work very well, a similar test framework has been created by the Ant development team. You may want to check out that framework as it is likely to be the "standard" Ant test framework. Look for "AntUnit" at http://ant.apache.org.</strong></span>
</p><p>
Typically, the nested tasks are TestCases, although they can be any task as appropriate to your testing. The nested tasks may also be Suites, so you can group your tests easily. Nested tasks are executed in order.
</p><p>
Suite may also hold FileSets. Each file in the FileSet will be treated as a file suitable for use by a TestCase and will be executed as such. This makes it easy to run an entire directory of tests without having to specify a TestCase for each one individually.
</p><p>
To use this task in your build files, include a task definition like this:
</p><pre class="programlisting">
<taskdef name="suite" classname="ise.antelope.tasks.Suite"/>
</pre><p>
</p><p>
</p><div class="table"><a name="idm2167"></a><p class="title"><b>Table 25.1. Suite Attributes</b></p><div class="table-contents"><table class="table" summary="Suite 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>enabled</td><td>Determines if this suite should be ran. By using a property for this attribute, it is easy to turn off/on multiple tests.</td><td>On</td><td>No</td></tr><tr><td>assertenabled</td><td>Generally tests will use the Assert task. This attribute sets whether asserts should be enabled.</td><td>Yes</td><td>No</td></tr><tr><td>showoutput</td><td>If true, show intermediate test results</td><td>Yes</td><td>No</td></tr><tr><td>showsummary</td><td>If true, show a summary of test results at the end of the test run.</td><td>Yes</td><td>Yes</td></tr></tbody></table></div></div><p><br class="table-break">
</p><p>
In the example below, the "suite" tasks is a top-level task, so will execute automatically. This example does not use 'setUp' or 'tearDown' targets.
</p><p>
</p><pre class="programlisting">
<project name="mathtest" basedir="." xmlns:a="antlib:ise.antelope.tasks">
<description>
Build file to run unit tests for the Math task
</description>
<a:suite>
<a:testcase file="math_basic_tests.xml"/>
<a:testcase file="math_rules_tests.xml"/>
<a:testcase file="math_precision_tests.xml"/>
</a:suite>
<!-- alternatively, a fileset could be used:
<a:suite>
<fileset dir="${basedir}">
<include name="math_*.xml"/>
</fileset>
</a:suite>
-->
</project>
$ ant -f mathtest2.xml
Buildfile: mathtest2.xml
[testcase] +-------------------------------------------+
[testcase] + mathtest
[testcase] +-------------------------------------------+
test6:
[testcase] ERROR: test6 failed: string or property must be set.
test5:
[testcase] test5 passed.
test4:
[testcase] test4 passed.
test3:
[testcase] test3 passed.
test2:
[testcase] test2 passed.
test1:
[testcase] test1 passed.
[testcase] +-------------------------------------------+
[testcase] + mathtest
[testcase] +-------------------------------------------+
[testcase]
[testcase] ---- Errors ---------------------------------
[testcase] ERROR: test6 failed: string or property must be set.
[testcase] ---- Results --------------------------------
[testcase] Ran 6 out of 6 tests.
[testcase] Passed: 5
[testcase] Warning: 0
[testcase] Failed: 1
[testcase] +-------------------------------------------+
[testcase] +-------------------------------------------+
[testcase] + math_precision_tests
[testcase] +-------------------------------------------+
test11:
[echo] Division by zero test
[a:try] Task 'a:math' in target 'test11' failed, error message is: java.lang.ArithmeticException
[testcase] ERROR: test11 failed: java.lang.ArithmeticException: / by zero
test10:
[echo] Circle area test
[testcase] ERROR: test10 failed: string or property must be set.
[testcase] +-------------------------------------------+
[testcase] + math_precision_tests
[testcase] +-------------------------------------------+
[testcase]
[testcase] ---- Errors ---------------------------------
[testcase] ERROR: test11 failed: java.lang.ArithmeticException: / by zero
[testcase] ERROR: test10 failed: string or property must be set.
[testcase] ---- Results --------------------------------
[testcase] Ran 2 out of 2 tests.
[testcase] Passed: 0
[testcase] Warning: 0
[testcase] Failed: 2
[testcase] +-------------------------------------------+
[testcase] +-------------------------------------------+
[testcase] + math_rules_tests
[testcase] +-------------------------------------------+
test7.2:
[testcase] test7.2 passed.
test7.1:
[testcase] test7.1 passed.
test7.0:
[testcase] test7.0 passed.
test8.3:
[testcase] test8.3 passed.
test8.2:
[testcase] test8.2 passed.
test9:
[testcase] test9 passed.
test8.1:
[testcase] test8.1 passed.
test8.0:
[testcase] test8.0 passed.
[testcase] +-------------------------------------------+
[testcase] + math_rules_tests
[testcase] +-------------------------------------------+
[testcase] ---- Results --------------------------------
[testcase] Ran 8 out of 8 tests.
[testcase] Passed: 8
[testcase] Warning: 0
[testcase] Failed: 0
[testcase] +-------------------------------------------+
[suite] ++-- Totals -------------------------------++
[suite] ++ Total Ran 16 out of 16 tests.
[suite] ++ Total Passed: 13
[suite] ++ Total Warnings: 0
[suite] ++ Total Failed: 3
[suite] ++-----------------------------------------++
BUILD SUCCESSFUL
Total time: 1 second
</pre><p>
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch24.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="bk03ch26.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 24. Repeat Task </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 26. TestCase Task</td></tr></table></div></body></html>
|