@Test public void startServer() throws OfficeServerException { when(this.modelContext.getCurrentEntityReference()).thenReturn(new WikiReference("xwiki")); when(this.documentAccessBridge.hasProgrammingRights()).thenReturn(true); assertTrue(this.officeServerScriptService.startServer()); verify(this.officeServer).start(); }
public boolean startServer() { if (!isMainXWiki()) { setErrorMessage(ERROR_FORBIDDEN); } else if (!this.docBridge.hasProgrammingRights()) { setErrorMessage(ERROR_PRIVILEGES); } else { try { this.officeServer.start(); return true; } catch (OfficeServerException ex) { logger.error(ex.getMessage(), ex); setErrorMessage(ex.getMessage()); } } return false; }
OfficeServerScriptService implements ScriptService { public boolean startServer() { if (!isMainXWiki()) { setErrorMessage(ERROR_FORBIDDEN); } else if (!this.docBridge.hasProgrammingRights()) { setErrorMessage(ERROR_PRIVILEGES); } else { try { this.officeServer.start(); return true; } catch (OfficeServerException ex) { logger.error(ex.getMessage(), ex); setErrorMessage(ex.getMessage()); } } return false; } }
OfficeServerScriptService implements ScriptService { public boolean startServer() { if (!isMainXWiki()) { setErrorMessage(ERROR_FORBIDDEN); } else if (!this.docBridge.hasProgrammingRights()) { setErrorMessage(ERROR_PRIVILEGES); } else { try { this.officeServer.start(); return true; } catch (OfficeServerException ex) { logger.error(ex.getMessage(), ex); setErrorMessage(ex.getMessage()); } } return false; }  }
OfficeServerScriptService implements ScriptService { public boolean startServer() { if (!isMainXWiki()) { setErrorMessage(ERROR_FORBIDDEN); } else if (!this.docBridge.hasProgrammingRights()) { setErrorMessage(ERROR_PRIVILEGES); } else { try { this.officeServer.start(); return true; } catch (OfficeServerException ex) { logger.error(ex.getMessage(), ex); setErrorMessage(ex.getMessage()); } } return false; }  boolean startServer(); boolean stopServer(); @Unstable boolean isConnected(); @Unstable String displayServerState(); @Deprecated String getServerState(); OfficeServerConfiguration getConfig(); String getLastErrorMessage(); }
OfficeServerScriptService implements ScriptService { public boolean startServer() { if (!isMainXWiki()) { setErrorMessage(ERROR_FORBIDDEN); } else if (!this.docBridge.hasProgrammingRights()) { setErrorMessage(ERROR_PRIVILEGES); } else { try { this.officeServer.start(); return true; } catch (OfficeServerException ex) { logger.error(ex.getMessage(), ex); setErrorMessage(ex.getMessage()); } } return false; }  boolean startServer(); boolean stopServer(); @Unstable boolean isConnected(); @Unstable String displayServerState(); @Deprecated String getServerState(); OfficeServerConfiguration getConfig(); String getLastErrorMessage(); static final String OFFICE_MANAGER_ERROR; }