*
*/
public final class TestColumnHelper extends TestCase {
public void testCleanColumns() {
CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
CTCols cols1 = worksheet.addNewCols();
CTCol col1 = cols1.addNewCol();
col1.setMin(1);
col1.setMax(1);
col1.setWidth(88);
col1.setHidden(true);
CTCol col2 = cols1.addNewCol();
col2.setMin(2);
col2.setMax(3);
CTCols cols2 = worksheet.addNewCols();
CTCol col4 = cols2.addNewCol();
col4.setMin(13);
col4.setMax(16384);
// Test cleaning cols
assertEquals(2, worksheet.sizeOfColsArray());
int count = countColumns(worksheet);
assertEquals(16375, count);
// Clean columns and test a clean worksheet
ColumnHelper helper = new ColumnHelper(worksheet);
assertEquals(1, worksheet.sizeOfColsArray());
count = countColumns(worksheet);
assertEquals(16375, count);
// Remember - POI column 0 == OOXML column 1
assertEquals(88.0, helper.getColumn(0, false).getWidth(), 0.0);
assertTrue(helper.getColumn(0, false).getHidden());