| 1 |
<?xml version="1.0"?> |
| 2 |
|
| 3 |
<project name="asserttest" basedir="." default="test1"> |
| 4 |
<description> |
| 5 |
test build file for the Assert task |
| 6 |
</description> |
| 7 |
|
| 8 |
<taskdef resource="net/sf/antcontrib/antcontrib.properties"> |
| 9 |
<classpath location="${antcontrib.jar}"/> |
| 10 |
</taskdef> |
| 11 |
<property name="ant.enable.asserts" value="true"/> |
| 12 |
|
| 13 |
<target name="test1"> |
| 14 |
<property name="testprop" value="true"/> |
| 15 |
<assert> |
| 16 |
<isset property="testprop"/> |
| 17 |
</assert> |
| 18 |
<assert> |
| 19 |
<istrue value="${testprop}" /> |
| 20 |
</assert> |
| 21 |
</target> |
| 22 |
|
| 23 |
<target name="test2"> |
| 24 |
<assert name="testprop"/> |
| 25 |
</target> |
| 26 |
|
| 27 |
<target name="test3"> |
| 28 |
<property name="testprop" value="true"/> |
| 29 |
<assert name="testprop" value="12"/> |
| 30 |
</target> |
| 31 |
|
| 32 |
|
| 33 |
<target name="test4"> |
| 34 |
<assert> |
| 35 |
<isgreaterthan arg1="6.02" arg2="4"/> |
| 36 |
</assert> |
| 37 |
<assert> |
| 38 |
<isgreaterthan arg1="Many" arg2="Less"/> |
| 39 |
</assert> |
| 40 |
</target> |
| 41 |
<target name="test5"> |
| 42 |
<assert> |
| 43 |
<islessthan arg1="6.02" arg2="23.456"/> |
| 44 |
</assert> |
| 45 |
<assert> |
| 46 |
<islessthan arg1="least" arg2="most"/> |
| 47 |
</assert> |
| 48 |
</target> |
| 49 |
<target name="test6"> |
| 50 |
<property name="testprop" value="false"/> |
| 51 |
<assert> |
| 52 |
<ispropertyfalse property="testprop"/> |
| 53 |
</assert> |
| 54 |
</target> |
| 55 |
<target name="test7"> |
| 56 |
<property name="testprop" value="no"/> |
| 57 |
<assert> |
| 58 |
<ispropertytrue property="testprop"/> |
| 59 |
</assert> |
| 60 |
</target> |
| 61 |
<target name="test8"> |
| 62 |
<property name="testprop" value="yes"/> |
| 63 |
<assert> |
| 64 |
<ispropertytrue property="testprop"/> |
| 65 |
</assert> |
| 66 |
</target> |
| 67 |
<target name="test9"> |
| 68 |
<property name="testprop" value="on"/> |
| 69 |
<assert> |
| 70 |
<ispropertyfalse property="testprop"/> |
| 71 |
</assert> |
| 72 |
</target> |
| 73 |
|
| 74 |
</project> |