polx 2005/01/23 14:36:53
Modified: jelly/src/test/org/apache/commons/jelly suite.jelly
jelly/src/java/org/apache/commons/jelly/tags/core
FileTag.java
Removed: jelly/src/test/org/apache/commons/jelly testFile.jelly
Log:
testFile.jelly was not used... removing!
Migrated the tests for file into suite.jelly and converted the property
appends to append in FileTag.
paul
Revision Changes Path
1.22 +16 -1
jakarta-commons/jelly/src/test/org/apache/commons/jelly/suite.jelly
Index: suite.jelly
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/suite.jelly,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- suite.jelly 21 Jan 2005 14:44:27 -0000 1.21
+++ suite.jelly 23 Jan 2005 22:36:53 -0000 1.22
@@ -344,5 +344,20 @@
</j:forEach>
<test:assertEquals expected="abc" actual="${j}"/>
- </test:case>
+ </test:case>
+
+ <!-- tests the file output provided by j:file -->
+ <test:case name="testFileTag">
+ <j:file name="target/test_iso.xml" encoding="ISO-8859-1"
omitXmlDeclaration="true">
+ <l>é#\ü</l></j:file>
+ <!-- how to check result without xml-unit ? -->
+ <j:new var="f" className="java.io.File"><j:arg
value="target/test_iso.xml"/></j:new>
+ <j:set var="singleSize" value="${f.length()}"/>
+ <!-- try outputting a second time -->
+ <j:file name="target/test_iso.xml" encoding="ISO-8859-1"
+ omitXmlDeclaration="true" append="true">
+ <l>é#\ü</l></j:file>
+ <j:set var="doubleSize" value="${f.length()}"/>
+ <test:assertEquals expected="${singleSize*2}" actual="${doubleSize}"/>
+ </test:case>
</test:suite>
1.17 +1 -1
jakarta-commons/jelly/src/java/org/apache/commons/jelly/tags/core/FileTag.java
Index: FileTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/tags/core/FileTag.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- FileTag.java 21 Jan 2005 20:42:16 -0000 1.16
+++ FileTag.java 23 Jan 2005 22:36:53 -0000 1.17
@@ -119,7 +119,7 @@
* Sets wether to append at the end of the file
* (not really something you normally do with an XML file).
*/
- public void setAppends(boolean doAppend) {
+ public void setAppend(boolean doAppend) {
this.doAppend = doAppend;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]