Author: hibou
Date: Sat Oct 17 10:41:04 2009
New Revision: 826221
URL: http://svn.apache.org/viewvc?rev=826221&view=rev
Log:
fix: assertPropertyContains was not checking the value of the property but the
name of the property.
Modified:
ant/antlibs/antunit/trunk/changes.xml
ant/antlibs/antunit/trunk/src/etc/testcases/assert.xml
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml
ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java
Modified: ant/antlibs/antunit/trunk/changes.xml
URL:
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/changes.xml?rev=826221&r1=826220&r2=826221&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/changes.xml (original)
+++ ant/antlibs/antunit/trunk/changes.xml Sat Oct 17 10:41:04 2009
@@ -48,6 +48,10 @@
Default XSLT stylesheets now properly escape XML in exception
stack traces.
</action>
+ <action type="fix">
+ assertPropertyContains was not checking the value of the property but
+ the name of the property.
+ </action>
</release>
<release version="1.1" date="2008-09-26">
Modified: ant/antlibs/antunit/trunk/src/etc/testcases/assert.xml
URL:
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/etc/testcases/assert.xml?rev=826221&r1=826220&r2=826221&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/etc/testcases/assert.xml (original)
+++ ant/antlibs/antunit/trunk/src/etc/testcases/assert.xml Sat Oct 17 10:41:04
2009
@@ -102,6 +102,16 @@
<au:assertPropertyEquals name="foo" value="BAR"/>
</target>
+ <target name="assertPropertyContains">
+ <property name="foo" value="bar"/>
+ <au:assertPropertyContains name="foo" value="ba"/>
+ </target>
+
+ <target name="assertPropertyContainsFail">
+ <property name="foo" value="bar"/>
+ <au:assertPropertyContains name="foo" value="foo"/>
+ </target>
+
<target name="assertFileExistsPass">
<au:assertFileExists file="assert.xml"/>
</target>
Modified: ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml
URL:
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml?rev=826221&r1=826220&r2=826221&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml
(original)
+++ ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml Sat
Oct 17 10:41:04 2009
@@ -104,7 +104,7 @@
<sequential>
<au:assertPropertySet message="@{message}" name="@{name}"/>
<au:assertTrue message="@{message}">
- <contains string="@{name}" substring="@{value}"
+ <contains string="$...@{name}}" substring="@{value}"
casesensitive="@{casesensitive}"/>
</au:assertTrue>
</sequential>
Modified:
ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java
URL:
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java?rev=826221&r1=826220&r2=826221&view=diff
==============================================================================
---
ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java
(original)
+++
ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java
Sat Oct 17 10:41:04 2009
@@ -101,6 +101,12 @@
public void testPropertyEqualsFail3() {
testFail("assertPropertyEqualsFail3", "Expected property 'foo' to have
value 'BAR' but was 'bar'");
}
+ public void testPropertyContains() {
+ testPass("assertPropertyContains");
+ }
+ public void testPropertyContainsFail() {
+ testFail("assertPropertyContainsFail", "Expected property 'foo' to
contain value 'foo' but was 'bar'");
+ }
public void testFileExistsFail() {
testFail("assertFileExistsFail",
"Expected file 'assert.txt' to exist");