From 2e0ffe0ee85a9b4f0bf71620aff5f1022bd8bcc8 Mon Sep 17 00:00:00 2001 From: Nicolas Lalevee Date: Sat, 17 Oct 2009 10:41:04 +0000 Subject: [PATCH] fix: assertPropertyContains was not checking the value of the property but the name of the property. git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@826221 13f79535-47bb-0310-9956-ffa450edef68 --- changes.xml | 4 ++++ src/etc/testcases/assert.xml | 10 ++++++++++ src/main/org/apache/ant/antunit/antlib.xml | 2 +- src/tests/junit/org/apache/ant/antunit/AssertTest.java | 6 ++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/changes.xml b/changes.xml index c9e4a70..45cb0cd 100644 --- a/changes.xml +++ b/changes.xml @@ -48,6 +48,10 @@ Default XSLT stylesheets now properly escape XML in exception stack traces. + + assertPropertyContains was not checking the value of the property but + the name of the property. + diff --git a/src/etc/testcases/assert.xml b/src/etc/testcases/assert.xml index adac596..60075cf 100644 --- a/src/etc/testcases/assert.xml +++ b/src/etc/testcases/assert.xml @@ -102,6 +102,16 @@ under the License. + + + + + + + + + + diff --git a/src/main/org/apache/ant/antunit/antlib.xml b/src/main/org/apache/ant/antunit/antlib.xml index 7c8c154..c8edb02 100644 --- a/src/main/org/apache/ant/antunit/antlib.xml +++ b/src/main/org/apache/ant/antunit/antlib.xml @@ -104,7 +104,7 @@ under the License. - diff --git a/src/tests/junit/org/apache/ant/antunit/AssertTest.java b/src/tests/junit/org/apache/ant/antunit/AssertTest.java index 3a78a62..5494cdd 100644 --- a/src/tests/junit/org/apache/ant/antunit/AssertTest.java +++ b/src/tests/junit/org/apache/ant/antunit/AssertTest.java @@ -101,6 +101,12 @@ public class AssertTest extends BuildFileTest { 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");