use of org.apache.poi.hssf.usermodel.HSSFDataValidation in project poi by apache.
the class TestPLVRecord method testPLVRecord.
public void testPLVRecord() throws Exception {
InputStream is = HSSFTestDataSamples.openSampleFileStream(XLS_FILENAME);
HSSFWorkbook workbook = new HSSFWorkbook(is);
CellRangeAddressList cellRange = new CellRangeAddressList(0, 0, 1, 1);
DataValidationConstraint constraint = DVConstraint.createFormulaListConstraint(DV_DEFINITION);
HSSFDataValidation dataValidation = new HSSFDataValidation(cellRange, constraint);
// This used to throw an error before
try {
workbook.getSheet(SHEET_NAME).addValidationData(dataValidation);
} catch (IllegalStateException ex) {
throw new AssertionFailedError("Identified bug 53972, PLV record breaks addDataValidation()");
}
}
Aggregations