geirm 01/06/10 14:55:34
Modified: src/java/org/apache/velocity/test EncodingTestCase.java
Log:
Bringing to parity with 1.1 (didn't do this before I left). It simply
adds the russian KOI8-R test.
Revision Changes Path
1.3 +27 -5
jakarta-velocity/src/java/org/apache/velocity/test/EncodingTestCase.java
Index: EncodingTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/EncodingTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EncodingTestCase.java 2001/05/30 05:50:36 1.2
+++ EncodingTestCase.java 2001/06/10 21:55:34 1.3
@@ -79,13 +79,13 @@
*
*
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: EncodingTestCase.java,v 1.2 2001/05/30 05:50:36 geirm Exp $
+ * @version $Id: EncodingTestCase.java,v 1.3 2001/06/10 21:55:34 geirm Exp $
*/
public class EncodingTestCase extends BaseTestCase implements TemplateTestBase
{
public EncodingTestCase()
{
- super("ContextSafetyTestCase");
+ super("EncodingTestCase");
try
{
@@ -145,7 +145,7 @@
if (!isMatch(RESULT_DIR,COMPARE_DIR,"encodingtest",
RESULT_FILE_EXT,CMP_FILE_EXT) )
{
- fail("Output incorrect.");
+ fail("Output 1 incorrect.");
}
/*
@@ -168,7 +168,7 @@
if (!isMatch(RESULT_DIR,COMPARE_DIR,"encodingtest2",
RESULT_FILE_EXT,CMP_FILE_EXT) )
{
- fail("Output incorrect.");
+ fail("Output 2 incorrect.");
}
/*
@@ -191,9 +191,31 @@
if (!isMatch(RESULT_DIR,COMPARE_DIR,"encodingtest3",
RESULT_FILE_EXT,CMP_FILE_EXT) )
{
- fail("Output incorrect.");
+ fail("Output 3 incorrect.");
}
+ /*
+ * Russian example from Vitaly Repetenko
+ */
+
+ template = Velocity.getTemplate(
+ getFileName( null, "encodingtest_KOI8-R", TMPL_FILE_EXT),
"KOI8-R");
+
+ fos =
+ new FileOutputStream (
+ getFileName(RESULT_DIR, "encodingtest_KOI8-R",
RESULT_FILE_EXT));
+
+ writer = new BufferedWriter(new OutputStreamWriter(fos, "KOI8-R"));
+
+ template.merge(context, writer);
+ writer.flush();
+ writer.close();
+
+ if (!isMatch(RESULT_DIR,COMPARE_DIR,"encodingtest_KOI8-R",
+ RESULT_FILE_EXT,CMP_FILE_EXT) )
+ {
+ fail("Output 4 incorrect.");
+ }
}
catch (Exception e)
{