Added new <code>assert:assertFileContains</code> tag that verifies if a file contains a specific string.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@156960 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol
2005-03-10 16:33:28 +00:00
parent e6048460ef
commit 596fb953b0
4 changed files with 47 additions and 11 deletions

View File

@@ -27,7 +27,8 @@
xmlns:maven="jelly:maven"
xmlns:plugin="plugin"
xmlns:u="jelly:util"
xmlns:x="jelly:xml">
xmlns:x="jelly:xml"
xmlns:assert="assert">
<j:if test="${bootstrapping == null}">
<!-- Poor mans version check - plugin dependencies still suck for multiple versions -->
@@ -379,6 +380,16 @@
<ant:fail>${file} does not exist.${msg}</ant:fail>
</j:if>
</define:tag>
<define:tag name="assertFileContains">
<!-- @file : Full file path -->
<!-- @match: the matching value expected -->
<!-- @msg : optional message to be displayed -->
<assert:assertFileExists file="${file}" msg="${msg}"/>
<u:loadText var="fileContent" file="${file}"/>
<j:if test="${fileContent.indexOf(match) lt 0}">
<ant:fail>${file} does not contain string [${match}].${msg}</ant:fail>
</j:if>
</define:tag>
<define:tag name="assertFileNotFound">
<!-- @file : Full file path -->
<!-- @msg : optional message to be displayed -->