provide built-in negations for remaining assertions
This commit is contained in:
parent
3c3cdce66b
commit
0d5bb05c19
|
|
@ -46,7 +46,9 @@
|
||||||
Only works properly with Ant 1.10.13 or later.
|
Only works properly with Ant 1.10.13 or later.
|
||||||
</action>
|
</action>
|
||||||
<action type="add">
|
<action type="add">
|
||||||
Add a new assertPropertyNotSet assertion.
|
Add new assertNotEquals, assertPropertyNotSet,
|
||||||
|
assertPropertyNotEquals, assertPropertyDoesntContain and
|
||||||
|
assertReferenceIsNotSet assertions.
|
||||||
</action>
|
</action>
|
||||||
</release>
|
</release>
|
||||||
<release version="1.4.1" date="2021-07-07">
|
<release version="1.4.1" date="2021-07-07">
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,54 @@
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<assertEquals message="foo is not bar" expected="bar"
|
<assertEquals message="foo is not bar" expected="bar"
|
||||||
actual="${foo}" casesensitive="false"/>
|
actual="${foo}" casesensitive="false"/>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h2><a name="assertNotEquals">assertNotEquals</a></h2>
|
||||||
|
|
||||||
|
<p>Asserts that its two arguments are not equal.</p>
|
||||||
|
|
||||||
|
<p><em>Since AntUnit 1.5</em></p>
|
||||||
|
|
||||||
|
<table border="1" cellpadding="2" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><b>Attribute</b></td>
|
||||||
|
<td valign="top"><b>Description</b></td>
|
||||||
|
<td align="center" valign="top"><b>Required</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">notExpected</td>
|
||||||
|
<td valign="top">First string to test.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">actual</td>
|
||||||
|
<td valign="top">Second string to test.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">message</td>
|
||||||
|
<td valign="top">Message for the exception if the condition
|
||||||
|
doesn't hold true. Defaults to "Didn't expect
|
||||||
|
'<em>notExpected</em>' to be '<em>actual</em>'".</td>
|
||||||
|
<td align="center">No.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">casesensitive</td>
|
||||||
|
<td valign="top">Perform a case sensitive comparision.
|
||||||
|
Default is true.</td>
|
||||||
|
<td valign="top" align="center">No</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Examples</h3>
|
||||||
|
|
||||||
|
<p>Make the build fail with the message "foo is bar" if the
|
||||||
|
property foo doesn't hold the value bar regardless of case:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<assertNotEquals message="foo is bar" notExpected="bar"
|
||||||
|
actual="${foo}" casesensitive="false"/>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h2><a name="assertPropertySet">assertPropertySet</a></h2>
|
<h2><a name="assertPropertySet">assertPropertySet</a></h2>
|
||||||
|
|
@ -125,6 +172,42 @@
|
||||||
<assertPropertySet name="foo"/>
|
<assertPropertySet name="foo"/>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<h2><a name="assertPropertyNotSet">assertPropertyNotSet</a></h2>
|
||||||
|
|
||||||
|
<p><em>Since AntUnit 1.5</em></p>
|
||||||
|
|
||||||
|
<p>Asserts that a property hasn't got a value.</p>
|
||||||
|
|
||||||
|
<table border="1" cellpadding="2" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><b>Attribute</b></td>
|
||||||
|
<td valign="top"><b>Description</b></td>
|
||||||
|
<td align="center" valign="top"><b>Required</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">name</td>
|
||||||
|
<td valign="top">Name of the property.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">message</td>
|
||||||
|
<td valign="top">Message for the exception if the condition
|
||||||
|
doesn't hold true. Defaults to "Didn't expect property
|
||||||
|
'<em>name</em>' to be set but was '<em>actual value</em>'".</td>
|
||||||
|
<td align="center">No.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Examples</h3>
|
||||||
|
|
||||||
|
<p>Make the build fail with the message "Didn't expect property
|
||||||
|
'foo' but was 'bar'" if the property foo is defined and has
|
||||||
|
value bar:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<assertPropertyNotSet name="foo"/>
|
||||||
|
</pre>
|
||||||
|
|
||||||
<h2><a name="assertPropertyEquals">assertPropertyEquals</a></h2>
|
<h2><a name="assertPropertyEquals">assertPropertyEquals</a></h2>
|
||||||
|
|
||||||
<p>Asserts that a given property is set and holds a certain
|
<p>Asserts that a given property is set and holds a certain
|
||||||
|
|
@ -169,7 +252,54 @@
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<assertPropertyEquals message="foo is not bar" value="bar"
|
<assertPropertyEquals message="foo is not bar" value="bar"
|
||||||
name="foo" casesensitive="false"/>
|
name="foo" casesensitive="false"/>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h2><a name="assertPropertyNotEquals">assertPropertyNotEquals</a></h2>
|
||||||
|
|
||||||
|
<p><em>Since AntUnit 1.5</em></p>
|
||||||
|
|
||||||
|
<p>Asserts that a given property is set but doesn't hold a certain
|
||||||
|
value.</p>
|
||||||
|
|
||||||
|
<table border="1" cellpadding="2" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><b>Attribute</b></td>
|
||||||
|
<td valign="top"><b>Description</b></td>
|
||||||
|
<td align="center" valign="top"><b>Required</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">name</td>
|
||||||
|
<td valign="top">Name of the property.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">value</td>
|
||||||
|
<td valign="top">Not expected value.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">message</td>
|
||||||
|
<td valign="top">Message for the exception if the condition
|
||||||
|
doesn't hold true. Defaults to "Didn't expect property '<em>name</em>' to have value '<em>value</em>'".</td>
|
||||||
|
<td align="center">No.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">casesensitive</td>
|
||||||
|
<td valign="top">Perform a case sensitive comparision.
|
||||||
|
Default is true.</td>
|
||||||
|
<td valign="top" align="center">No</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Examples</h3>
|
||||||
|
|
||||||
|
<p>Make the build fail with the message "foo is bar" if the
|
||||||
|
property foo holds the value bar regardless of case:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<assertPropertyNotEquals message="foo is bar" value="bar"
|
||||||
|
name="foo" casesensitive="false"/>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h2><a name="assertPropertyContains">assertPropertyContains</a></h2>
|
<h2><a name="assertPropertyContains">assertPropertyContains</a></h2>
|
||||||
|
|
@ -219,6 +349,55 @@
|
||||||
name="foo" casesensitive="false"/>
|
name="foo" casesensitive="false"/>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<h2><a name="assertPropertyDoesntContain">assertPropertyDoesntContain</a></h2>
|
||||||
|
|
||||||
|
<p>Asserts that a given property is set and doesn't hold a certain
|
||||||
|
value as substring.</p>
|
||||||
|
|
||||||
|
<p><em>Since AntUnit 1.5</em></p>
|
||||||
|
|
||||||
|
<table border="1" cellpadding="2" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><b>Attribute</b></td>
|
||||||
|
<td valign="top"><b>Description</b></td>
|
||||||
|
<td align="center" valign="top"><b>Required</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">name</td>
|
||||||
|
<td valign="top">Name of the property.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">value</td>
|
||||||
|
<td valign="top">Not expected substring value.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">message</td>
|
||||||
|
<td valign="top">Message for the exception if the condition
|
||||||
|
doesn't hold true. Defaults to "Didn't expect property
|
||||||
|
'<em>name</em>' to contain value '<em>value</em>' but was
|
||||||
|
'<em>value of property name</em>'".</td>
|
||||||
|
<td align="center">No.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">casesensitive</td>
|
||||||
|
<td valign="top">Perform a case sensitive comparision.
|
||||||
|
Default is true.</td>
|
||||||
|
<td valign="top" align="center">No</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Examples</h3>
|
||||||
|
|
||||||
|
<p>Make the build fail with the message "foo contains bar" if the
|
||||||
|
property foo contains the value bar regardless of case:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<assertPropertyDoesntContain message="foo contains bar" value="bar"
|
||||||
|
name="foo" casesensitive="false"/>
|
||||||
|
</pre>
|
||||||
|
|
||||||
<h2><a name="assertFileExists">assertFileExists</a></h2>
|
<h2><a name="assertFileExists">assertFileExists</a></h2>
|
||||||
|
|
||||||
<p>Asserts that a given file exists.</p>
|
<p>Asserts that a given file exists.</p>
|
||||||
|
|
@ -607,7 +786,7 @@
|
||||||
<td align="center">No.</td>
|
<td align="center">No.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Example</h3>
|
<h3>Example</h3>
|
||||||
|
|
||||||
<p>Make the build fail if the file build.xml and backups/build.xml
|
<p>Make the build fail if the file build.xml and backups/build.xml
|
||||||
|
|
@ -645,7 +824,7 @@
|
||||||
<td align="center">No.</td>
|
<td align="center">No.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Example</h3>
|
<h3>Example</h3>
|
||||||
|
|
||||||
<p>Make the build fail if the file build.xml and backups/build.xml
|
<p>Make the build fail if the file build.xml and backups/build.xml
|
||||||
|
|
@ -688,6 +867,41 @@
|
||||||
<assertReferenceSet name="foo"/>
|
<assertReferenceSet name="foo"/>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<h2><a name="assertReferenceIsNotSet">assertReferenceIsNotSet</a></h2>
|
||||||
|
|
||||||
|
<p>Asserts that a reference hasn't got any value.</p>
|
||||||
|
|
||||||
|
<p><em>Since AntUnit 1.5</em></p>
|
||||||
|
|
||||||
|
<table border="1" cellpadding="2" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><b>Attribute</b></td>
|
||||||
|
<td valign="top"><b>Description</b></td>
|
||||||
|
<td align="center" valign="top"><b>Required</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">refid</td>
|
||||||
|
<td valign="top">Id of the reference.</td>
|
||||||
|
<td valign="top" align="center">Yes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">message</td>
|
||||||
|
<td valign="top">Message for the exception if the condition
|
||||||
|
doesn't hold true. Defaults to "Didn't expect reference
|
||||||
|
'<em>id</em>'".</td>
|
||||||
|
<td align="center">No.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Examples</h3>
|
||||||
|
|
||||||
|
<p>Make the build fail with the message "Didn't expect reference 'foo'"
|
||||||
|
if the reference foo is defined:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<assertReferenceIsNotSet name="foo"/>
|
||||||
|
</pre>
|
||||||
|
|
||||||
<h2><a name="assertReferenceIsType">assertReferenceIsType</a></h2>
|
<h2><a name="assertReferenceIsType">assertReferenceIsType</a></h2>
|
||||||
|
|
||||||
<p>Asserts that a reference has a value of a given type.</p>
|
<p>Asserts that a reference has a value of a given type.</p>
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,22 @@ under the License.
|
||||||
<au:assertEquals expected="bar" actual="BAR"/>
|
<au:assertEquals expected="bar" actual="BAR"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="assertNotEqualsPass1">
|
||||||
|
<au:assertNotEquals notexpected="bar" actual="baz"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertNotEqualsPass2">
|
||||||
|
<au:assertNotEquals notexpected="bar" actual="BAR"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertNotEqualsFail">
|
||||||
|
<au:assertNotEquals notexpected="bar" actual="bar"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertNotEqualsCaseFail">
|
||||||
|
<au:assertNotEquals notexpected="bar" actual="BAR" casesensitive="false"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="assertPropertySetPass">
|
<target name="assertPropertySetPass">
|
||||||
<property name="foo" value="bar"/>
|
<property name="foo" value="bar"/>
|
||||||
<au:assertPropertySet name="foo"/>
|
<au:assertPropertySet name="foo"/>
|
||||||
|
|
@ -119,6 +135,30 @@ under the License.
|
||||||
<au:assertPropertyEquals name="foo" value="BAR"/>
|
<au:assertPropertyEquals name="foo" value="BAR"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="assertPropertyNotEqualsPass1">
|
||||||
|
<property name="foo" value="bar"/>
|
||||||
|
<au:assertPropertyNotEquals name="foo" value="baz"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertPropertyNotEqualsPass2">
|
||||||
|
<property name="foo" value="bar"/>
|
||||||
|
<au:assertPropertyNotEquals name="foo" value="BAR"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertPropertyNotEqualsFail1">
|
||||||
|
<au:assertPropertyNotEquals name="foo" value="bar"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertPropertyNotEqualsFail2">
|
||||||
|
<property name="foo" value="bar"/>
|
||||||
|
<au:assertPropertyNotEquals name="foo" value="bar"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertPropertyNotEqualsCaseFail">
|
||||||
|
<property name="foo" value="bar"/>
|
||||||
|
<au:assertPropertyNotEquals name="foo" value="BAR" casesensitive="false"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="assertPropertyContains">
|
<target name="assertPropertyContains">
|
||||||
<property name="foo" value="bar"/>
|
<property name="foo" value="bar"/>
|
||||||
<au:assertPropertyContains name="foo" value="ba"/>
|
<au:assertPropertyContains name="foo" value="ba"/>
|
||||||
|
|
@ -129,6 +169,16 @@ under the License.
|
||||||
<au:assertPropertyContains name="foo" value="foo"/>
|
<au:assertPropertyContains name="foo" value="foo"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="assertPropertyDoesntContain">
|
||||||
|
<property name="foo" value="bar"/>
|
||||||
|
<au:assertPropertyDoesntContain name="foo" value="foo"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertPropertyDoesntContainFail">
|
||||||
|
<property name="foo" value="bar"/>
|
||||||
|
<au:assertPropertyDoesntContain name="foo" value="ba"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="assertFileExistsPass">
|
<target name="assertFileExistsPass">
|
||||||
<au:assertFileExists file="assert.xml"/>
|
<au:assertFileExists file="assert.xml"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
@ -214,6 +264,15 @@ under the License.
|
||||||
<au:assertReferenceSet refid="foo2"/>
|
<au:assertReferenceSet refid="foo2"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="assertReferenceIsNotSetPass">
|
||||||
|
<au:assertReferenceIsNotSet refid="foo3"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="assertReferenceIsNotSetFail">
|
||||||
|
<path id="foo4"/>
|
||||||
|
<au:assertReferenceIsNotSet refid="foo4"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="assertReferenceIsTypePass">
|
<target name="assertReferenceIsTypePass">
|
||||||
<path id="foo3"/>
|
<path id="foo3"/>
|
||||||
<au:assertReferenceIsType refid="foo3" type="path"/>
|
<au:assertReferenceIsType refid="foo3" type="path"/>
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,22 @@ under the License.
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
<macrodef name="assertNotEquals" backtrace="false">
|
||||||
|
<attribute name="notExpected"/>
|
||||||
|
<attribute name="actual"/>
|
||||||
|
<attribute name="casesensitive" default="true"/>
|
||||||
|
<attribute name="message"
|
||||||
|
default="Didn't expect '@{notExpected}' to be '@{actual}'"/>
|
||||||
|
<sequential>
|
||||||
|
<au:fail message="@{message}">
|
||||||
|
<not>
|
||||||
|
<equals arg1="@{notExpected}" arg2="@{actual}"
|
||||||
|
casesensitive="@{casesensitive}"/>
|
||||||
|
</not>
|
||||||
|
</au:fail>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
<macrodef name="assertPropertySet" backtrace="false">
|
<macrodef name="assertPropertySet" backtrace="false">
|
||||||
<attribute name="name"/>
|
<attribute name="name"/>
|
||||||
<attribute name="message"
|
<attribute name="message"
|
||||||
|
|
@ -102,7 +118,7 @@ under the License.
|
||||||
<macrodef name="assertPropertyNotSet" backtrace="false">
|
<macrodef name="assertPropertyNotSet" backtrace="false">
|
||||||
<attribute name="name"/>
|
<attribute name="name"/>
|
||||||
<attribute name="message"
|
<attribute name="message"
|
||||||
default="Expected property '@{name}' to not be set but was '${@{name}}'"/>
|
default="Didn't expect property '@{name}' to be set but was '${@{name}}'"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<au:fail message="@{message}">
|
<au:fail message="@{message}">
|
||||||
<not>
|
<not>
|
||||||
|
|
@ -125,6 +141,19 @@ under the License.
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
<macrodef name="assertPropertyNotEquals" backtrace="false">
|
||||||
|
<attribute name="name"/>
|
||||||
|
<attribute name="value"/>
|
||||||
|
<attribute name="casesensitive" default="true"/>
|
||||||
|
<attribute name="message"
|
||||||
|
default="Didn't expect property '@{name}' to have value '@{value}'"/>
|
||||||
|
<sequential>
|
||||||
|
<au:assertPropertySet message="@{message}" name="@{name}"/>
|
||||||
|
<au:assertNotEquals message="@{message}" notexpected="@{value}"
|
||||||
|
actual="${@{name}}" casesensitive="@{casesensitive}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
<macrodef name="assertPropertyContains" backtrace="false">
|
<macrodef name="assertPropertyContains" backtrace="false">
|
||||||
<attribute name="name"/>
|
<attribute name="name"/>
|
||||||
<attribute name="value"/>
|
<attribute name="value"/>
|
||||||
|
|
@ -139,7 +168,24 @@ under the License.
|
||||||
</au:fail>
|
</au:fail>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
<macrodef name="assertPropertyDoesntContain" backtrace="false">
|
||||||
|
<attribute name="name"/>
|
||||||
|
<attribute name="value"/>
|
||||||
|
<attribute name="casesensitive" default="true"/>
|
||||||
|
<attribute name="message"
|
||||||
|
default="Didn't expect property '@{name}' to contain value '@{value}' but was '${@{name}}'"/>
|
||||||
|
<sequential>
|
||||||
|
<au:assertPropertySet message="@{message}" name="@{name}"/>
|
||||||
|
<au:fail message="@{message}">
|
||||||
|
<not>
|
||||||
|
<contains string="${@{name}}" substring="@{value}"
|
||||||
|
casesensitive="@{casesensitive}"/>
|
||||||
|
</not>
|
||||||
|
</au:fail>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
<macrodef name="assertFileExists" backtrace="false">
|
<macrodef name="assertFileExists" backtrace="false">
|
||||||
<attribute name="file"/>
|
<attribute name="file"/>
|
||||||
<attribute name="message"
|
<attribute name="message"
|
||||||
|
|
@ -189,11 +235,11 @@ under the License.
|
||||||
<attribute name="value"/>
|
<attribute name="value"/>
|
||||||
<attribute name="casesensitive" default="true"/>
|
<attribute name="casesensitive" default="true"/>
|
||||||
<attribute name="message"
|
<attribute name="message"
|
||||||
default="Expected resource '@{resource}' to contain value '@{value}' but was '${@{resource}}'"/>
|
default="Expected resource '@{resource}' to contain value '@{value}' but was '${@{resource}}'"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<au:assertResourceExists resource="@{resource}"/>
|
<au:assertResourceExists resource="@{resource}"/>
|
||||||
<au:fail message="@{message}">
|
<au:fail message="@{message}">
|
||||||
<resourcecontains resource="@{resource}" substring="@{value}"
|
<resourcecontains resource="@{resource}" substring="@{value}"
|
||||||
casesensitive="@{casesensitive}"/>
|
casesensitive="@{casesensitive}"/>
|
||||||
</au:fail>
|
</au:fail>
|
||||||
</sequential>
|
</sequential>
|
||||||
|
|
@ -204,10 +250,10 @@ under the License.
|
||||||
<attribute name="value"/>
|
<attribute name="value"/>
|
||||||
<attribute name="casesensitive" default="true"/>
|
<attribute name="casesensitive" default="true"/>
|
||||||
<attribute name="message"
|
<attribute name="message"
|
||||||
default="Didn't expect resource '@{resource}' to contain value '@{value}' but was '${@{resource}}'"/>
|
default="Didn't expect resource '@{resource}' to contain value '@{value}' but was '${@{resource}}'"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<au:assertFalse message="@{message}">
|
<au:assertFalse message="@{message}">
|
||||||
<resourcecontains resource="@{resource}" substring="@{value}"
|
<resourcecontains resource="@{resource}" substring="@{value}"
|
||||||
casesensitive="@{casesensitive}"/>
|
casesensitive="@{casesensitive}"/>
|
||||||
</au:assertFalse>
|
</au:assertFalse>
|
||||||
</sequential>
|
</sequential>
|
||||||
|
|
@ -264,11 +310,11 @@ under the License.
|
||||||
<attribute name="value"/>
|
<attribute name="value"/>
|
||||||
<attribute name="casesensitive" default="true"/>
|
<attribute name="casesensitive" default="true"/>
|
||||||
<attribute name="message"
|
<attribute name="message"
|
||||||
default="Expected resource '@{refid}' to contain value '@{value}'"/>
|
default="Expected resource '@{refid}' to contain value '@{value}'"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<au:assertRefResourceExists refid="@{refid}"/>
|
<au:assertRefResourceExists refid="@{refid}"/>
|
||||||
<au:fail message="@{message}">
|
<au:fail message="@{message}">
|
||||||
<resourcecontains refid="@{refid}" substring="@{value}"
|
<resourcecontains refid="@{refid}" substring="@{value}"
|
||||||
casesensitive="@{casesensitive}"/>
|
casesensitive="@{casesensitive}"/>
|
||||||
</au:fail>
|
</au:fail>
|
||||||
</sequential>
|
</sequential>
|
||||||
|
|
@ -279,10 +325,10 @@ under the License.
|
||||||
<attribute name="value"/>
|
<attribute name="value"/>
|
||||||
<attribute name="casesensitive" default="true"/>
|
<attribute name="casesensitive" default="true"/>
|
||||||
<attribute name="message"
|
<attribute name="message"
|
||||||
default="Didn't expect resource '@{refid}' to contain value '@{value}'"/>
|
default="Didn't expect resource '@{refid}' to contain value '@{value}'"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<au:assertFalse message="@{message}">
|
<au:assertFalse message="@{message}">
|
||||||
<resourcecontains refid="@{refid}" substring="@{value}"
|
<resourcecontains refid="@{refid}" substring="@{value}"
|
||||||
casesensitive="@{casesensitive}"/>
|
casesensitive="@{casesensitive}"/>
|
||||||
</au:assertFalse>
|
</au:assertFalse>
|
||||||
</sequential>
|
</sequential>
|
||||||
|
|
@ -347,6 +393,19 @@ under the License.
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
<macrodef name="assertReferenceIsNotSet" backtrace="false">
|
||||||
|
<attribute name="refid"/>
|
||||||
|
<attribute name="message"
|
||||||
|
default="Didn't expect reference '@{refid}'"/>
|
||||||
|
<sequential>
|
||||||
|
<au:fail message="@{message}">
|
||||||
|
<not>
|
||||||
|
<isreference refid="@{refid}"/>
|
||||||
|
</not>
|
||||||
|
</au:fail>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
<macrodef name="assertReferenceIsType" backtrace="false">
|
<macrodef name="assertReferenceIsType" backtrace="false">
|
||||||
<attribute name="refid"/>
|
<attribute name="refid"/>
|
||||||
<attribute name="type"/>
|
<attribute name="type"/>
|
||||||
|
|
@ -398,7 +457,7 @@ under the License.
|
||||||
default="Expected '@{string}' to match pattern '@{pattern}'"/>
|
default="Expected '@{string}' to match pattern '@{pattern}'"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<au:fail message="@{message}">
|
<au:fail message="@{message}">
|
||||||
<matches string="@{string}" pattern="@{pattern}"
|
<matches string="@{string}" pattern="@{pattern}"
|
||||||
casesensitive="@{casesensitive}"
|
casesensitive="@{casesensitive}"
|
||||||
singleline="@{singleline}"
|
singleline="@{singleline}"
|
||||||
multiline="@{multiline}"/>
|
multiline="@{multiline}"/>
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ public class AssertTest extends BuildFileTest {
|
||||||
public void testEqualsCasePass() {
|
public void testEqualsCasePass() {
|
||||||
testPass("assertEqualsCasePass");
|
testPass("assertEqualsCasePass");
|
||||||
}
|
}
|
||||||
|
public void testNotEqualsPass1() {
|
||||||
|
testPass("assertNotEqualsPass1");
|
||||||
|
}
|
||||||
|
public void testNotEqualsPass2() {
|
||||||
|
testPass("assertNotEqualsPass2");
|
||||||
|
}
|
||||||
public void testPropertySetPass() {
|
public void testPropertySetPass() {
|
||||||
testPass("assertPropertySetPass");
|
testPass("assertPropertySetPass");
|
||||||
}
|
}
|
||||||
|
|
@ -61,6 +67,18 @@ public class AssertTest extends BuildFileTest {
|
||||||
public void testPropertyEqualsCasePass() {
|
public void testPropertyEqualsCasePass() {
|
||||||
testPass("assertPropertyEqualsCasePass");
|
testPass("assertPropertyEqualsCasePass");
|
||||||
}
|
}
|
||||||
|
public void testPropertyNotEqualsPass1() {
|
||||||
|
testPass("assertPropertyNotEqualsPass1");
|
||||||
|
}
|
||||||
|
public void testPropertyNotEqualsPass2() {
|
||||||
|
testPass("assertPropertyNotEqualsPass2");
|
||||||
|
}
|
||||||
|
public void testPropertyContains() {
|
||||||
|
testPass("assertPropertyContains");
|
||||||
|
}
|
||||||
|
public void testPropertyDoesntContain() {
|
||||||
|
testPass("assertPropertyDoesntContain");
|
||||||
|
}
|
||||||
public void testFileExistsPass() {
|
public void testFileExistsPass() {
|
||||||
testPass("assertFileExistsPass");
|
testPass("assertFileExistsPass");
|
||||||
}
|
}
|
||||||
|
|
@ -88,6 +106,9 @@ public class AssertTest extends BuildFileTest {
|
||||||
public void testReferenceSetPass() {
|
public void testReferenceSetPass() {
|
||||||
testPass("assertReferenceSetPass");
|
testPass("assertReferenceSetPass");
|
||||||
}
|
}
|
||||||
|
public void testReferenceIsNotSetPass() {
|
||||||
|
testPass("assertReferenceIsNotSetPass");
|
||||||
|
}
|
||||||
public void testReferenceIsTypePass() {
|
public void testReferenceIsTypePass() {
|
||||||
testPass("assertReferenceIsTypePass");
|
testPass("assertReferenceIsTypePass");
|
||||||
}
|
}
|
||||||
|
|
@ -104,11 +125,17 @@ public class AssertTest extends BuildFileTest {
|
||||||
public void testEqualsFail2() {
|
public void testEqualsFail2() {
|
||||||
testFail("assertEqualsFail2", "Expected 'bar' but was 'BAR'");
|
testFail("assertEqualsFail2", "Expected 'bar' but was 'BAR'");
|
||||||
}
|
}
|
||||||
|
public void testNotEqualsFail() {
|
||||||
|
testFail("assertNotEqualsFail", "Didn't expect 'bar' to be 'bar'");
|
||||||
|
}
|
||||||
|
public void testNotEqualsCaseFail() {
|
||||||
|
testFail("assertNotEqualsCaseFail", "Didn't expect 'bar' to be 'BAR'");
|
||||||
|
}
|
||||||
public void testPropertySetFail() {
|
public void testPropertySetFail() {
|
||||||
testFail("assertPropertySetFail", "Expected property 'foo'");
|
testFail("assertPropertySetFail", "Expected property 'foo'");
|
||||||
}
|
}
|
||||||
public void testPropertyNotSetFail() {
|
public void testPropertyNotSetFail() {
|
||||||
testFail("assertPropertyNotSetFail", "Expected property 'foo' to not be set but was 'bar'");
|
testFail("assertPropertyNotSetFail", "Didn't expect property 'foo' to be set but was 'bar'");
|
||||||
}
|
}
|
||||||
public void testPropertyEqualsFail1() {
|
public void testPropertyEqualsFail1() {
|
||||||
testFail("assertPropertyEqualsFail1", "Expected property 'foo' to have value 'bar' but was '${foo}'");
|
testFail("assertPropertyEqualsFail1", "Expected property 'foo' to have value 'bar' but was '${foo}'");
|
||||||
|
|
@ -119,12 +146,21 @@ public class AssertTest extends BuildFileTest {
|
||||||
public void testPropertyEqualsFail3() {
|
public void testPropertyEqualsFail3() {
|
||||||
testFail("assertPropertyEqualsFail3", "Expected property 'foo' to have value 'BAR' but was 'bar'");
|
testFail("assertPropertyEqualsFail3", "Expected property 'foo' to have value 'BAR' but was 'bar'");
|
||||||
}
|
}
|
||||||
public void testPropertyContains() {
|
public void testPropertyNotEqualsFail1() {
|
||||||
testPass("assertPropertyContains");
|
testFail("assertPropertyNotEqualsFail1", "Didn't expect property 'foo' to have value 'bar'");
|
||||||
|
}
|
||||||
|
public void testPropertyNotEqualsFail2() {
|
||||||
|
testFail("assertPropertyNotEqualsFail2", "Didn't expect property 'foo' to have value 'bar'");
|
||||||
|
}
|
||||||
|
public void testPropertyNotEqualsCaseFail() {
|
||||||
|
testFail("assertPropertyNotEqualsCaseFail", "Didn't expect property 'foo' to have value 'BAR'");
|
||||||
}
|
}
|
||||||
public void testPropertyContainsFail() {
|
public void testPropertyContainsFail() {
|
||||||
testFail("assertPropertyContainsFail", "Expected property 'foo' to contain value 'foo' but was 'bar'");
|
testFail("assertPropertyContainsFail", "Expected property 'foo' to contain value 'foo' but was 'bar'");
|
||||||
}
|
}
|
||||||
|
public void testPropertyDoesntContainFail() {
|
||||||
|
testFail("assertPropertyDoesntContainFail", "Didn't expect property 'foo' to contain value 'ba' but was 'bar'");
|
||||||
|
}
|
||||||
public void testFileExistsFail() {
|
public void testFileExistsFail() {
|
||||||
testFail("assertFileExistsFail",
|
testFail("assertFileExistsFail",
|
||||||
"Expected file 'assert.txt' to exist");
|
"Expected file 'assert.txt' to exist");
|
||||||
|
|
@ -160,6 +196,9 @@ public class AssertTest extends BuildFileTest {
|
||||||
public void testReferenceSetFail() {
|
public void testReferenceSetFail() {
|
||||||
testFail("assertReferenceSetFail", "Expected reference 'foo2'");
|
testFail("assertReferenceSetFail", "Expected reference 'foo2'");
|
||||||
}
|
}
|
||||||
|
public void testReferenceIsNotSetFail() {
|
||||||
|
testFail("assertReferenceIsNotSetFail", "Didn't expect reference 'foo4'");
|
||||||
|
}
|
||||||
public void testReferenceIsTypeFailNotSet() {
|
public void testReferenceIsTypeFailNotSet() {
|
||||||
testFail("assertReferenceIsTypeFailNotSet",
|
testFail("assertReferenceIsTypeFailNotSet",
|
||||||
"Expected reference 'foo4'");
|
"Expected reference 'foo4'");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue