@Test @SuppressWarnings("deprecation") public void exportFullXAR() throws Exception { XWikiContext context = this.oldcore.getXWikiContext(); WikiReference wikiReference = new WikiReference("mywiki"); context.setWikiReference(wikiReference); when(this.oldcore.getMockRightService().hasWikiAdminRights(context)).thenReturn(true); when(this.request.get("format")).thenReturn("xar"); assertNull(this.action.render(context)); ArgumentCaptor<DocumentInstanceInputProperties> inputProperties = ArgumentCaptor.forClass(DocumentInstanceInputProperties.class); verify(this.inputFilterStreamFactory).createInputFilterStream(inputProperties.capture()); assertTrue(inputProperties.getValue().getEntities().matches(wikiReference)); assertFalse(inputProperties.getValue().isWithJRCSRevisions()); ArgumentCaptor<XAROutputProperties> xarProperties = ArgumentCaptor.forClass(XAROutputProperties.class); verify(this.xarFilterStreamFactory).createOutputFilterStream(xarProperties.capture()); assertEquals("backup", xarProperties.getValue().getPackageName()); }
@Override public String render(XWikiContext context) throws XWikiException { String defaultPage; try { XWikiRequest request = context.getRequest(); String format = request.get("format"); if ((format == null) || (format.equals("xar"))) { defaultPage = exportXAR(context); } else if (format.equals("html")) { defaultPage = exportHTML(context); } else { defaultPage = export(format, context); } } catch (Exception e) { throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_EXPORT, "Exception while exporting", e); } return defaultPage; }
ExportAction extends XWikiAction { @Override public String render(XWikiContext context) throws XWikiException { String defaultPage; try { XWikiRequest request = context.getRequest(); String format = request.get("format"); if ((format == null) || (format.equals("xar"))) { defaultPage = exportXAR(context); } else if (format.equals("html")) { defaultPage = exportHTML(context); } else { defaultPage = export(format, context); } } catch (Exception e) { throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_EXPORT, "Exception while exporting", e); } return defaultPage; } }
ExportAction extends XWikiAction { @Override public String render(XWikiContext context) throws XWikiException { String defaultPage; try { XWikiRequest request = context.getRequest(); String format = request.get("format"); if ((format == null) || (format.equals("xar"))) { defaultPage = exportXAR(context); } else if (format.equals("html")) { defaultPage = exportHTML(context); } else { defaultPage = export(format, context); } } catch (Exception e) { throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_EXPORT, "Exception while exporting", e); } return defaultPage; }  }
ExportAction extends XWikiAction { @Override public String render(XWikiContext context) throws XWikiException { String defaultPage; try { XWikiRequest request = context.getRequest(); String format = request.get("format"); if ((format == null) || (format.equals("xar"))) { defaultPage = exportXAR(context); } else if (format.equals("html")) { defaultPage = exportHTML(context); } else { defaultPage = export(format, context); } } catch (Exception e) { throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_EXPORT, "Exception while exporting", e); } return defaultPage; }  @Override String render(XWikiContext context); }
ExportAction extends XWikiAction { @Override public String render(XWikiContext context) throws XWikiException { String defaultPage; try { XWikiRequest request = context.getRequest(); String format = request.get("format"); if ((format == null) || (format.equals("xar"))) { defaultPage = exportXAR(context); } else if (format.equals("html")) { defaultPage = exportHTML(context); } else { defaultPage = export(format, context); } } catch (Exception e) { throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_EXPORT, "Exception while exporting", e); } return defaultPage; }  @Override String render(XWikiContext context);  }