Package org.xwiki.test.integration
Class XWikiExecutor
- java.lang.Object
-
- org.xwiki.test.integration.XWikiExecutor
-
public class XWikiExecutor extends Object
Start and stop an XWiki instance.- Since:
- 2.0RC1
- Version:
- $Id: 61145a9ebd8e77403636435b25c940599492ffd4 $
-
-
Field Summary
Fields Modifier and Type Field Description static StringBASEDIRstatic StringDEFAULT_CONTEXTBy default assume that XWiki is deployed under the "xwiki" Servlet context.static StringDEFAULT_PORTstatic StringDEFAULT_RMIPORTstatic StringDEFAULT_STOPPORTprotected static org.slf4j.LoggerLOGGERstatic StringURLstatic StringVERIFY_RUNNING_XWIKI_AT_STARTIf defined then we check for an existing running XWiki instance before trying to start XWiki.
-
Constructor Summary
Constructors Constructor Description XWikiExecutor(int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddEnvironmentVariable(String key, String value)intgetDebugPort()StringgetExecutionDirectory()intgetPort()intgetRMIPort()intgetStopPort()StringgetURL()StringgetWebInfDirectory()StringgetXWikiCfgPath()StringgetXWikiPropertiesPath()booleanisManaged()PropertiesloadXWikiCfg()PropertiesloadXWikiProperties()org.apache.commons.configuration2.PropertiesConfigurationloadXWikiPropertiesConfiguration()voidsaveXWikiCfg(Properties properties)voidsaveXWikiProperties()voidsaveXWikiProperties(Properties properties)Deprecated.since 4.2M1 usesaveXWikiProperties()insteadvoidsetTimeoutSeconds(long timeoutSeconds)Change the timeout checked when starting and initializing XWiki.voidsetXWikiOpts(String opts)voidstart()Start XWiki using the following strategy: If thexwiki.test.startXWikisystem property is set to "false" then don't start/stop XWiki If theVERIFY_RUNNING_XWIKI_AT_STARTproperty is set then checks if an XWiki instance is already running before trying to start XWiki and if so, reuse it and don't start XWiki If theVERIFY_RUNNING_XWIKI_AT_STARTproperty is set to false then verify if some XWiki instance is already running by verifying if the port is free and fail if so.voidstop()
-
-
-
Field Detail
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
VERIFY_RUNNING_XWIKI_AT_START
public static final String VERIFY_RUNNING_XWIKI_AT_START
If defined then we check for an existing running XWiki instance before trying to start XWiki.
-
BASEDIR
public static final String BASEDIR
-
URL
public static final String URL
-
DEFAULT_CONTEXT
public static final String DEFAULT_CONTEXT
By default assume that XWiki is deployed under the "xwiki" Servlet context. Pass an empty string to singify the root context. Note the "/" suffix which is required.
-
DEFAULT_PORT
public static final String DEFAULT_PORT
-
DEFAULT_STOPPORT
public static final String DEFAULT_STOPPORT
-
DEFAULT_RMIPORT
public static final String DEFAULT_RMIPORT
-
-
Method Detail
-
getPort
public int getPort()
-
getStopPort
public int getStopPort()
-
getRMIPort
public int getRMIPort()
-
getDebugPort
public int getDebugPort()
-
getExecutionDirectory
public String getExecutionDirectory()
-
setXWikiOpts
public void setXWikiOpts(String opts)
-
setTimeoutSeconds
public void setTimeoutSeconds(long timeoutSeconds)
Change the timeout checked when starting and initializing XWiki.- Since:
- 10.11RC1
-
isManaged
public boolean isManaged()
- Returns:
- true the XWiki instance was (successfully) started by the executor itself (other possibilities being failed startup or already running instance).
- Since:
- 9.7RC1
-
start
public void start() throws ExceptionStart XWiki using the following strategy:- If the
xwiki.test.startXWikisystem property is set to "false" then don't start/stop XWiki - If the
VERIFY_RUNNING_XWIKI_AT_STARTproperty is set then checks if an XWiki instance is already running before trying to start XWiki and if so, reuse it and don't start XWiki - If the
VERIFY_RUNNING_XWIKI_AT_STARTproperty is set to false then verify if some XWiki instance is already running by verifying if the port is free and fail if so. Otherwise start XWiki.
- Throws:
Exception- when failing to start XWiki
- If the
-
getWebInfDirectory
public String getWebInfDirectory()
-
getXWikiCfgPath
public String getXWikiCfgPath()
-
getXWikiPropertiesPath
public String getXWikiPropertiesPath()
-
loadXWikiCfg
public Properties loadXWikiCfg() throws Exception
- Throws:
Exception
-
loadXWikiProperties
public Properties loadXWikiProperties() throws Exception
- Throws:
Exception
-
loadXWikiPropertiesConfiguration
public org.apache.commons.configuration2.PropertiesConfiguration loadXWikiPropertiesConfiguration() throws Exception- Throws:
Exception
-
saveXWikiCfg
public void saveXWikiCfg(Properties properties) throws Exception
- Throws:
Exception
-
saveXWikiProperties
@Deprecated public void saveXWikiProperties(Properties properties) throws Exception
Deprecated.since 4.2M1 usesaveXWikiProperties()instead- Throws:
Exception
-
saveXWikiProperties
public void saveXWikiProperties() throws Exception- Throws:
Exception- Since:
- 4.2M1
-
getURL
public String getURL()
-
-