whitespace
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1763999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d5c20ccb0d
commit
95e8c4b4a2
@ -97,68 +97,68 @@ public class TestWorkbookProtection {
|
||||
|
||||
@Test
|
||||
public void shouldReadWorkbookProtection() throws Exception {
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
|
||||
workbook = openSampleWorkbook("workbookProtection_workbook_structure_protected.xlsx");
|
||||
assertTrue(workbook.isStructureLocked());
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
workbook = openSampleWorkbook("workbookProtection_workbook_structure_protected.xlsx");
|
||||
assertTrue(workbook.isStructureLocked());
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
|
||||
workbook = openSampleWorkbook("workbookProtection_workbook_windows_protected.xlsx");
|
||||
assertTrue(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
workbook = openSampleWorkbook("workbookProtection_workbook_windows_protected.xlsx");
|
||||
assertTrue(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
|
||||
workbook = openSampleWorkbook("workbookProtection_workbook_revision_protected.xlsx");
|
||||
assertTrue(workbook.isRevisionLocked());
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
}
|
||||
workbook = openSampleWorkbook("workbookProtection_workbook_revision_protected.xlsx");
|
||||
assertTrue(workbook.isRevisionLocked());
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldWriteStructureLock() throws Exception {
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
public void shouldWriteStructureLock() throws Exception {
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
|
||||
workbook.lockStructure();
|
||||
workbook.lockStructure();
|
||||
|
||||
assertTrue(workbook.isStructureLocked());
|
||||
assertTrue(workbook.isStructureLocked());
|
||||
|
||||
workbook.unLockStructure();
|
||||
workbook.unLockStructure();
|
||||
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
}
|
||||
assertFalse(workbook.isStructureLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldWriteWindowsLock() throws Exception {
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
public void shouldWriteWindowsLock() throws Exception {
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
|
||||
workbook.lockWindows();
|
||||
workbook.lockWindows();
|
||||
|
||||
assertTrue(workbook.isWindowsLocked());
|
||||
assertTrue(workbook.isWindowsLocked());
|
||||
|
||||
workbook.unLockWindows();
|
||||
workbook.unLockWindows();
|
||||
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
}
|
||||
assertFalse(workbook.isWindowsLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldWriteRevisionLock() throws Exception {
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
public void shouldWriteRevisionLock() throws Exception {
|
||||
XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx");
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
|
||||
workbook.lockRevision();
|
||||
workbook.lockRevision();
|
||||
|
||||
assertTrue(workbook.isRevisionLocked());
|
||||
assertTrue(workbook.isRevisionLocked());
|
||||
|
||||
workbook.unLockRevision();
|
||||
workbook.unLockRevision();
|
||||
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
}
|
||||
assertFalse(workbook.isRevisionLocked());
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
@ -175,19 +175,19 @@ public class TestWorkbookProtection {
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testIntegration() throws Exception {
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
wb.createSheet("Testing purpose sheet");
|
||||
assertFalse(wb.isRevisionLocked());
|
||||
public void testIntegration() throws Exception {
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
wb.createSheet("Testing purpose sheet");
|
||||
assertFalse(wb.isRevisionLocked());
|
||||
|
||||
wb.lockRevision();
|
||||
wb.setRevisionsPassword("test", null);
|
||||
wb.lockRevision();
|
||||
wb.setRevisionsPassword("test", null);
|
||||
|
||||
wb = writeOutAndReadBack(wb);
|
||||
wb = writeOutAndReadBack(wb);
|
||||
|
||||
assertTrue(wb.isRevisionLocked());
|
||||
assertTrue(wb.validateRevisionsPassword("test"));
|
||||
}
|
||||
assertTrue(wb.isRevisionLocked());
|
||||
assertTrue(wb.validateRevisionsPassword("test"));
|
||||
}
|
||||
|
||||
@Ignore("bug 60230: currently failing due to regression from bug 59857 r1762726")
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user