org.ujac.print.test
Class BasePrintTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.ujac.print.test.BasePrintTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
DocumentPrinterTest, OptionalPrinterTests, ReportTest, StyleParserTest, TableTest

public class BasePrintTest
extends junit.framework.TestCase

Name: BasePrintTests
Description: A base class for print tests.

Author:
lauerc

Field Summary
protected  DocumentPrinter docPrinter
          The document printer to use.
protected  Map docProperties
          The document properties to use.
protected  FormatHelper formatHelper
          The format helper to use.
protected  ResourceLoader resourceLoader
          The resource loader.
protected  TemplateInterpreter templateInterpreter
          The template interpreter to test.
 
Constructor Summary
BasePrintTest()
           
 
Method Summary
protected  void addTagTest(String tagId, AbstractTagTest test)
          Adds a single test to the test tag interceptor.
protected  void clearTagTests()
          Adds a single test to the test tag interceptor.
protected  boolean isAllTagTestsPassed()
          Tells, whether or not all test have been passed.
protected  void loadProperties(String location)
          Loads the properties file from the given location.
protected  void printDocument(String destFile)
          Prints the document to the given destination.
protected  void printDocument(String destFile, boolean supportToc)
          Prints the document to the given destination.
protected  void setTemplateSource(String location)
          Sets the document template source.
protected  void setUp()
          Sets up the test data.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

templateInterpreter

protected TemplateInterpreter templateInterpreter
The template interpreter to test.


formatHelper

protected FormatHelper formatHelper
The format helper to use.


docPrinter

protected DocumentPrinter docPrinter
The document printer to use.


docProperties

protected Map docProperties
The document properties to use.


resourceLoader

protected ResourceLoader resourceLoader
The resource loader.

Constructor Detail

BasePrintTest

public BasePrintTest()
Method Detail

setUp

protected void setUp()
              throws Exception
Sets up the test data.

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception - In case a problem occured during the set up.

setTemplateSource

protected void setTemplateSource(String location)
                          throws IOException
Sets the document template source.

Parameters:
location - The location of the document template file.
Throws:
IOException - In case the document template file could not be opened.

loadProperties

protected void loadProperties(String location)
                       throws IOException
Loads the properties file from the given location.

Parameters:
location - The location of the properties file to read.
Throws:
IOException - In case the properties file could not be loaded.

printDocument

protected void printDocument(String destFile)
                      throws DocumentHandlerException,
                             IOException
Prints the document to the given destination.

Parameters:
destFile - The destination file name.
Throws:
DocumentHandlerException - If something went wrong at document handling.
IOException - In case something went wrong during output.

printDocument

protected void printDocument(String destFile,
                             boolean supportToc)
                      throws DocumentHandlerException,
                             IOException
Prints the document to the given destination.

Parameters:
destFile - The destination file name.
supportToc - Tells whether or not to support the output of a leading table of contents.
Throws:
DocumentHandlerException - If something went wrong at document handling.
IOException - In case something went wrong during output.

addTagTest

protected void addTagTest(String tagId,
                          AbstractTagTest test)
Adds a single test to the test tag interceptor.

Parameters:
tagId - The ID of the tag to test.
test - The test to perform.

clearTagTests

protected void clearTagTests()
Adds a single test to the test tag interceptor.

Parameters:
tagId - The ID of the tag to test.
test - The test to perform.

isAllTagTestsPassed

protected boolean isAllTagTestsPassed()
Tells, whether or not all test have been passed.

Returns:
true in case all tests have been performed successfully, else falses.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.