records.add(new InterfaceHdrRecord(CODEPAGE));
records.add(createMMS());
records.add(InterfaceEndRecord.instance);
- records.add(createWriteAccess());
+ // store the write-access record at the proper position
+ retval.getWriteAccess();
records.add(createCodepage());
records.add(createDSF());
records.add(createTabId());
wb.close();
}
+
+ @Test
+ public void testWriteAccess() {
+ HSSFWorkbook wb = new HSSFWorkbook();
+ InternalWorkbook iwb = TestHSSFWorkbook.getInternalWorkbook(wb);
+
+ int oldRecordsCount = iwb.getNumRecords();
+ //System.out.println("records count = " + oldRecordsCount);
+ assertEquals("records count", 68, oldRecordsCount);
+
+ WriteAccessRecord writeAccess = iwb.getWriteAccess();
+ assertNotNull(writeAccess);
+ assertEquals(WriteAccessRecord.sid, writeAccess.getSid());
+
+ int newRecordsCount = iwb.getNumRecords();
+ //System.out.println("records count after 'getWriteAccess' = " + newRecordsCount);
+ assertEquals("records count after getWriteAccess", oldRecordsCount, newRecordsCount);
+ }
}