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 String
BASEDIR
static String
DEFAULT_CONTEXT
By default assume that XWiki is deployed under the "xwiki" Servlet context.static String
DEFAULT_PORT
static String
DEFAULT_RMIPORT
static String
DEFAULT_STOPPORT
protected static org.slf4j.Logger
LOGGER
static String
URL
static String
VERIFY_RUNNING_XWIKI_AT_START
If 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 void
addEnvironmentVariable(String key, String value)
int
getDebugPort()
String
getExecutionDirectory()
int
getPort()
int
getRMIPort()
int
getStopPort()
String
getURL()
String
getWebInfDirectory()
String
getXWikiCfgPath()
String
getXWikiPropertiesPath()
boolean
isManaged()
Properties
loadXWikiCfg()
Properties
loadXWikiProperties()
org.apache.commons.configuration2.PropertiesConfiguration
loadXWikiPropertiesConfiguration()
void
saveXWikiCfg(Properties properties)
void
saveXWikiProperties()
void
saveXWikiProperties(Properties properties)
Deprecated.since 4.2M1 usesaveXWikiProperties()
insteadvoid
setTimeoutSeconds(long timeoutSeconds)
Change the timeout checked when starting and initializing XWiki.void
setXWikiOpts(String opts)
void
start()
Start XWiki using the following strategy: If thexwiki.test.startXWiki
system property is set to "false" then don't start/stop XWiki If theVERIFY_RUNNING_XWIKI_AT_START
property 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_START
property is set to false then verify if some XWiki instance is already running by verifying if the port is free and fail if so.void
stop()
-
-
-
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 Exception
Start XWiki using the following strategy:- If the
xwiki.test.startXWiki
system property is set to "false" then don't start/stop XWiki - If the
VERIFY_RUNNING_XWIKI_AT_START
property 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_START
property 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()
-
-