NamedOdsDocument implements OdsDocument, StylesContainer { public void save() throws IOException { this.odsElements.saveAsync(); this.logger.log(Level.FINE, "file saved"); } NamedOdsDocument(final Logger logger, final XMLUtil xmlUtil, final OdsElements odsElements,
                     final CommonOdsDocument commonOdsDocument); @Override Table addTable(final String name); @Override Table addTable(final String name, final int rowCapacity, final int columnCapacity); @Override boolean addTable(final Table table); @Override Table createTable(final String name); @Override Table createTable(final String name, final int rowCapacity, final int columnCapacity); @Override Table getTable(final int n); @Override Table getTable(final String name); @Override Table getOrAddTable(final String name); @Override String getTableName(final int n); @Override int getTableNumber(final String name); @Override List<Table> getTables(); @Override boolean setActiveTable(final int tableIndex); @Override void setViewSetting(final String viewId, final String item, final String value); @Override int tableCount(); @Override @Deprecated void addAutoFilter(final String rangeName, final Table table, final int r1, final int c1,
                              final int r2, final int c2); @Override void freezeCells(final Table table, final int rowCount, final int colCount); void addCellStyle(final TableCellStyle style, final CellType... types); @Override boolean addDataStyle(final DataStyle dataStyle); @Override boolean addMasterPageStyle(final MasterPageStyle masterPageStyle); @Override boolean addNewDataStyleFromCellStyle(final TableCellStyle style); @Override boolean addPageLayoutStyle(final PageLayoutStyle pageLayoutStyle); @Override boolean addPageStyle(final PageStyle ps); @Override boolean addContentStyle(final ObjectStyle objectStyle); @Override boolean addStylesStyle(final ObjectStyle objectStyle); @Override TableCellStyle addChildCellStyle(final TableCellStyle style, final DataStyle dataStyle); @Override boolean addContentFontFaceContainerStyle(final FontFaceContainerStyle objectStyle); @Override boolean addStylesFontFaceContainerStyle(final FontFaceContainerStyle ffcStyle); @Override void setDataStylesMode(final Container.Mode mode); @Override void setMasterPageStyleMode(final Container.Mode mode); @Override void setPageLayoutStyleMode(final Container.Mode mode); @Override void setPageStyleMode(final Container.Mode mode); @Override void setObjectStyleMode(final Container.Mode mode); void debugStyles(); void freezeStyles(); void prepare(); @Override void addExtraFile(final String fullPath, final String mediaType, final byte[] bytes); @Override void addExtraDir(final String fullPath); @Override void addExtraObject(final String fullPath, final String mediaType,
                               final String version); @Override void addEvents(final ScriptEventListener... events); @Override void addPilotTable(final PilotTable pilot); @Override void addAutoFilter(final AutoFilter autoFilter); void save();  }
@Test public final void testSaveTo() throws IOException { PowerMock.resetAll(); TestHelper.initMockDocument(this.odsElements); this.odsElements.saveAsync(); PowerMock.replayAll(); final NamedOdsDocument d = this.getDocument(); d.save(); PowerMock.verifyAll(); }
@Test public final void testSaveToCloseException() throws IOException { PowerMock.resetAll(); TestHelper.initMockDocument(this.odsElements); this.odsElements.saveAsync(); EasyMock.expectLastCall().andThrow(new IOException("@")); PowerMock.replayAll(); final NamedOdsDocument document = this.getDocument(); this.thrown.expect(IOException.class); this.thrown.expectMessage("@"); document.save(); PowerMock.verifyAll(); }
@Test public final void testSaveWriterException() throws IOException { PowerMock.resetAll(); TestHelper.initMockDocument(this.odsElements); this.odsElements.saveAsync(); EasyMock.expectLastCall().andThrow(new RuntimeException("@")); PowerMock.replayAll(); this.thrown.expect(RuntimeException.class); this.thrown.expectMessage("@"); final NamedOdsDocument d = this.getDocument(); d.save(); PowerMock.verifyAll(); }
@Test public void testSave() throws IOException { PowerMock.resetAll(); TestHelper.initMockDocument(this.odsElements); this.odsElements.saveAsync(); PowerMock.replayAll(); final NamedOdsDocument document = this.getDocument(); document.save(); PowerMock.verifyAll(); }