Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 13590 invoked from network); 5 Dec 2007 16:42:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2007 16:42:09 -0000 Received: (qmail 25909 invoked by uid 500); 5 Dec 2007 16:41:57 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 25886 invoked by uid 500); 5 Dec 2007 16:41:57 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 25877 invoked by uid 99); 5 Dec 2007 16:41:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 08:41:57 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 16:42:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6A7381A9832; Wed, 5 Dec 2007 08:41:44 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r601404 - in /ant/antlibs/antunit/trunk: changes.xml docs/assertions.html src/etc/testcases/assert.xml src/main/org/apache/ant/antunit/antlib.xml src/tests/junit/org/apache/ant/antunit/AssertTest.java Date: Wed, 05 Dec 2007 16:41:43 -0000 To: notifications@ant.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071205164144.6A7381A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bodewig Date: Wed Dec 5 08:41:42 2007 New Revision: 601404 URL: http://svn.apache.org/viewvc?rev=601404&view=rev Log: new assertDoesntMatch assertion, bugzilla issue 43639, submitted by David Jackman Modified: ant/antlibs/antunit/trunk/changes.xml ant/antlibs/antunit/trunk/docs/assertions.html 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=601404&r1=601403&r2=601404&view=diff ============================================================================== --- ant/antlibs/antunit/trunk/changes.xml (original) +++ ant/antlibs/antunit/trunk/changes.xml Wed Dec 5 08:41:42 2007 @@ -32,6 +32,9 @@ assertMatches' casesensitive attribute didn't default to true as documented + + added a new assertDoesntMatch assertion + Modified: ant/antlibs/antunit/trunk/docs/assertions.html URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/docs/assertions.html?rev=601404&r1=601403&r2=601404&view=diff ============================================================================== --- ant/antlibs/antunit/trunk/docs/assertions.html (original) +++ ant/antlibs/antunit/trunk/docs/assertions.html Wed Dec 5 08:41:42 2007 @@ -522,6 +522,65 @@ <assertMatches string="${abc}" pattern="abc" casesensitive="false"/> + +

assertDoesntMatch

+ +

Asserts that a string doesn't match a given regular expression.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
stringThe string to test.Yes
patternThe pattern to test the string against.Yes
casesensitive + Perform a case sensitive match. + Default is true. + No.
multiline + Perform a multi line match. + Default is false. + No.
singleline + This allows '.' to match new lines. + SingleLine is not to be confused with multiline, + SingleLine is a perl + regex term, it corresponds to dotall in java regex. + Default is false. + No.
+ +

Examples

+ +

Make the build fail if the property abc contains + "abc" regardless of case: +

+
+      <assertDoesntMatch string="${abc}" pattern="abc" 
+                     casesensitive="false"/>
+

assertLogContains

Asserts that the build log contains a given message.

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=601404&r1=601403&r2=601404&view=diff ============================================================================== --- ant/antlibs/antunit/trunk/src/etc/testcases/assert.xml (original) +++ ant/antlibs/antunit/trunk/src/etc/testcases/assert.xml Wed Dec 5 08:41:42 2007 @@ -197,4 +197,10 @@ pattern="abc"/> + + + + 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=601404&r1=601403&r2=601404&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 Wed Dec 5 08:41:42 2007 @@ -258,4 +258,24 @@ + + + + + + + + + + + + + + + + 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=601404&r1=601403&r2=601404&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 Wed Dec 5 08:41:42 2007 @@ -141,6 +141,10 @@ executeTarget("assertMatches"); } + public void testDoesntMatch() { + executeTarget("assertDoesntMatch"); + } + public void testMatchesDefaultCaseSensitivity() { executeTarget("assertMatchesDefaultCaseSensitivity"); }