dlr 00/10/22 15:08:32
Modified: src/java/org/apache/velocity/test BaseTestCase.java
VelocityTest.java
Log:
Broke BaseTestCase into another piece--TemplateTestCase--which subclasses
BaseTestCase. I apologize for any compiler errors (I can't build the rest of the
tree).
Revision Changes Path
1.2 +2 -63
jakarta-velocity/src/java/org/apache/velocity/test/BaseTestCase.java
Index: BaseTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/BaseTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BaseTestCase.java 2000/10/15 03:21:41 1.1
+++ BaseTestCase.java 2000/10/22 22:08:31 1.2
@@ -54,21 +54,18 @@
* <http://www.apache.org/>.
*/
-import java.io.*;
-
import junit.framework.*;
import org.apache.velocity.runtime.Runtime;
-import org.apache.velocity.io.FastWriter;
/**
* Base functionality to be extended by all Apache Velocity test cases. Test
* case implementations are used to automatate testing via JUnit.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: BaseTestCase.java,v 1.1 2000/10/15 03:21:41 dlr Exp $
+ * @version $Id: BaseTestCase.java,v 1.2 2000/10/22 22:08:31 dlr Exp $
*/
-abstract class BaseTestCase extends TestCase
+public abstract class BaseTestCase extends TestCase
{
/**
* The properties file name of the application.
@@ -76,11 +73,6 @@
private static final String PROPS_FILE_NAME = "velocity.properties";
/**
- * The writer used to output evaluated templates.
- */
- private FastWriter writer;
-
- /**
* Creates a new instance.
*/
public BaseTestCase (String name)
@@ -106,58 +98,5 @@
public static junit.framework.Test suite ()
{
return new VelocityTestSuite();
- }
-
- /**
- * Performs cleanup activities for this test case.
- */
- protected void tearDown ()
- {
- try
- {
- closeWriter();
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
- }
-
- /**
- * Returns a <code>FastWriter</code> instance.
- *
- * @param out The output stream for the writer to write to. If
- * <code>null</code>, defaults to <code>System.out</code>.
- * @return The writer.
- */
- protected Writer getWriter (OutputStream out)
- throws UnsupportedEncodingException, IOException
- {
- if (writer == null)
- {
- if (out == null)
- {
- out = System.out;
- }
-
- writer = new FastWriter
- (out, Runtime.getString(Runtime.TEMPLATE_ENCODING));
- writer.setAsciiHack
- (Runtime.getBoolean(Runtime.TEMPLATE_ASCIIHACK));
- }
- return writer;
- }
-
- /**
- * Closes the writer (if it has been opened).
- */
- protected void closeWriter ()
- throws IOException
- {
- if (writer != null)
- {
- writer.flush();
- writer.close();
- }
}
}
1.4 +3 -3
jakarta-velocity/src/java/org/apache/velocity/test/VelocityTest.java
Index: VelocityTest.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/VelocityTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VelocityTest.java 2000/10/22 16:00:02 1.3
+++ VelocityTest.java 2000/10/22 22:08:31 1.4
@@ -69,9 +69,9 @@
* Automated test case for Apache Velocity.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: VelocityTest.java,v 1.3 2000/10/22 16:00:02 jvanzyl Exp $
+ * @version $Id: VelocityTest.java,v 1.4 2000/10/22 22:08:31 dlr Exp $
*/
-public class VelocityTest extends BaseTestCase
+public class VelocityTest extends TemplateTestCase
{
/**
* The name of the test case's template file.
@@ -101,7 +101,7 @@
*/
public static junit.framework.Test suite ()
{
- return BaseTestCase.suite();
+ return TemplateTestCase.suite();
}
/**