*/
public class GenericFormulaTestCase extends TestCase {
- protected final String FILENAME = System.getProperty("HSSF.testdata.path")+ "/FormulaEvalTestData.xls";
+ protected final static String FILENAME = System.getProperty("HSSF.testdata.path")+ "/FormulaEvalTestData.xls";
- protected HSSFWorkbook workbook = null;
+ protected static HSSFWorkbook workbook = null;
protected CellReference beginCell;
protected int getBeginRow() {
return beginCell.getCol();
}
- protected static final HSSFCell getExpectedValueCell(HSSFSheet sheet, HSSFRow row, HSSFCell cell) {
+ protected final HSSFCell getExpectedValueCell(HSSFSheet sheet, HSSFRow row, HSSFCell cell) {
HSSFCell retval = null;
if (sheet != null) {
row = sheet.getRow(row.getRowNum()+1);
}
}
- public GenericFormulaTestCase(String beginCell) {
- super("genericTest");
+ public GenericFormulaTestCase(String beginCell) throws Exception {
+ super("genericTest");
+ if (workbook == null) {
+ FileInputStream fin = new FileInputStream( FILENAME );
+ workbook = new HSSFWorkbook( fin );
+ fin.close();
+ }
this.beginCell = new CellReference(beginCell);
}
- public void setUp() throws Exception {
- FileInputStream fin = new FileInputStream( FILENAME );
- workbook = new HSSFWorkbook( fin );
- fin.close();
+ public void setUp() {
}
public void genericTest() throws Exception {
*/
public class TestEverything extends TestSuite {
- public static TestSuite suite() {
+ public static TestSuite suite() throws Exception {
TestSuite suite = new TestSuite("Tests for OperationEval concrete implementation classes.");
suite.addTest(new GenericFormulaTestCase("D23"));
suite.addTest(new GenericFormulaTestCase("D27"));