Class 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 String PROPERTY_KEY
      The key used to store an instance of this class in the context.
    • 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 methods
        adminCredentials - 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 uninstall
        keepLocalCache - whether to keep the local cached extension or not
        Throws:
        Exception
      • install

        public void install​(org.xwiki.extension.ExtensionId extensionId)
                     throws Exception
        Installs the specified extension.
        Parameters:
        extensionId - the id of the extension to install
        Throws:
        Exception
      • finishCurrentJob

        public void finishCurrentJob()
                              throws Exception
        Finishes 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
      • isInstalled

        public boolean isInstalled​(org.xwiki.extension.ExtensionId extensionId,
                                   org.xwiki.component.namespace.Namespace namespace)
                            throws Exception
        Throws:
        Exception