FileDocCategorySizeDatePackage
AbstractPtgTestCase.javaAPI DocApache Poi 3.0.12183Mon Jan 01 12:39:46 GMT 2007org.apache.poi.hssf.record.formula

AbstractPtgTestCase

public class AbstractPtgTestCase extends TestCase
Convenient abstract class to reduce the amount of boilerplate code needed in ptg-related unit tests.
author
Daniel Noll (daniel at nuix dot com dot au)

Fields Summary
private static String
dataDir
Directory containing the test data.
Constructors Summary
Methods Summary
protected static org.apache.poi.hssf.usermodel.HSSFWorkbookloadWorkbook(java.lang.String filename)
Loads a workbook from the given filename in the test data dir.

param
filename the filename.
return
the loaded workbook.
throws
IOException if an error occurs loading the workbook.


                                      
        
              
        File file = new File(dataDir, filename);
        InputStream stream = new BufferedInputStream(new FileInputStream(file));
        try
        {
            return new HSSFWorkbook(stream);
        }
        finally
        {
            stream.close();
        }