Project.MSG_ERR ) ;
return ;
}
- if( tests != null && tests.size() > 0 ) {
+ if( tests.size() > 0 ) {
Iterator<ExcelAntTest> testsIt = tests.iterator() ;
while( testsIt.hasNext() ) {
workbookUtil = ExcelAntWorkbookUtilFactory.getInstance( excelFileName ) ;
- if( functions != null ) {
- Iterator<ExcelAntUserDefinedFunction> functionsIt = functions.iterator() ;
- while( functionsIt.hasNext() ) {
- ExcelAntUserDefinedFunction eaUdf = functionsIt.next() ;
- try {
- workbookUtil.addFunction(eaUdf.getFunctionAlias(), eaUdf.getClassName() ) ;
- } catch ( Exception e) {
- throw new BuildException( e.getMessage(), e );
- }
+ Iterator<ExcelAntUserDefinedFunction> functionsIt = functions.iterator() ;
+ while( functionsIt.hasNext() ) {
+ ExcelAntUserDefinedFunction eaUdf = functionsIt.next() ;
+ try {
+ workbookUtil.addFunction(eaUdf.getFunctionAlias(), eaUdf.getClassName() ) ;
+ } catch ( Exception e) {
+ throw new BuildException( e.getMessage(), e );
}
}
test.setWorkbookUtil( workbookUtil ) ;
getLocation());
}
- Workbook workbook;
File workbookFile = new File( excelFileName ) ;
try {
FileInputStream fis = new FileInputStream( workbookFile ) ;
- workbook = WorkbookFactory.create( fis ) ;
+ return WorkbookFactory.create( fis ) ;
} catch (Exception e) {
throw new BuildException("Cannot load file " + excelFileName
+ ". Make sure the path and file permissions are correct.", e, getLocation());
}
- return workbook ;
}
</poi:excelant>
</target>
+ <!-- basic evaluation test -->
+ <target name="test-settext">
+ <poi:excelant fileName="${data.dir.name}/spreadsheet/excelant.xls">
+ <poi:test showSuccessDetails="true">
+ <poi:setString cell="'MortgageCalculator'!$B$1" value="sometext"/>
+ <!-- How can we evaluate text? -->
+ </poi:test>
+ </poi:excelant>
+ </target>
+
</project>