Package org.xwiki.extension.test
Class ExtensionTestUtils
- java.lang.Object
-
- org.xwiki.extension.test.ExtensionTestUtils
-
public class ExtensionTestUtils extends Object
Utility methods for extension manager functional tests.- Since:
- 4.2M1
- Version:
- $Id: 3f97fdd3fe4313d8c23d96b29a6d66b3f72c1159 $
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_KEYThe key used to store an instance of this class in the context.
-
Constructor Summary
Constructors Constructor Description ExtensionTestUtils(TestUtils utils)Creates a new instance.ExtensionTestUtils(TestUtils utils, org.apache.commons.httpclient.UsernamePasswordCredentials adminCredentials)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishCurrentJob()Finishes the current job if there is one and its current state is WAITING.voidinstall(org.xwiki.extension.ExtensionId extensionId)Installs the specified extension.booleanisInstalled(org.xwiki.extension.ExtensionId extensionId)booleanisInstalled(org.xwiki.extension.ExtensionId extensionId, org.xwiki.component.namespace.Namespace namespace)voiduninstall(String extensionId)Uninstalls the specified extension removing it also from the local cache.voiduninstall(String extensionId, boolean keepLocalCache)Uninstalls the specified extension, optionally removing it from the local cache.
-
-
-
Field Detail
-
PROPERTY_KEY
public static final String PROPERTY_KEY
The key used to store an instance of this class in the context.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExtensionTestUtils
public ExtensionTestUtils(TestUtils utils)
Creates a new instance.- Parameters:
utils- the generic test utility methods
-
ExtensionTestUtils
public ExtensionTestUtils(TestUtils utils, org.apache.commons.httpclient.UsernamePasswordCredentials adminCredentials)
Creates a new instance.- Parameters:
utils- the generic test utility methodsadminCredentials- the admin credentials to use
-
-
Method Detail
-
uninstall
public void uninstall(String extensionId) throws Exception
Uninstalls the specified extension removing it also from the local cache.- Parameters:
extensionId- the id of the extension to uninstall- Throws:
Exception
-
uninstall
public void uninstall(String extensionId, boolean keepLocalCache) throws Exception
Uninstalls the specified extension, optionally removing it from the local cache.- Parameters:
extensionId- the id of the extension to uninstallkeepLocalCache- whether to keep the local cached extension or not- Throws:
Exception
-
install
public void install(org.xwiki.extension.ExtensionId extensionId) throws ExceptionInstalls the specified extension.- Parameters:
extensionId- the id of the extension to install- Throws:
Exception
-
finishCurrentJob
public void finishCurrentJob() throws ExceptionFinishes the current job if there is one and its current state is WAITING.- Throws:
Exception
-
isInstalled
public boolean isInstalled(org.xwiki.extension.ExtensionId extensionId) throws Exception- Throws:
Exception
-
-