Class AdministrationImpl

java.lang.Object
com.atlassian.jira.functest.framework.AdministrationImpl
All Implemented Interfaces:
Administration

public class AdministrationImpl extends Object implements Administration
Implementation of Administration
Since:
v3.13
  • Field Details

    • LEGACY_PROJECT_PERMISSIONS_PAGE_DARK_FEATURE

      public static final String LEGACY_PROJECT_PERMISSIONS_PAGE_DARK_FEATURE
      See Also:
  • Constructor Details

    • AdministrationImpl

      @Inject public AdministrationImpl(net.sourceforge.jwebunit.WebTester tester, JIRAEnvironmentData environmentData, Navigation navigation, Assertions assertions)
      Note: if you need to construct this for an old-style com.atlassian.jira.webtests.JIRAWebTest, you may want to consider using com.atlassian.jira.functest.framework.FuncTestHelperFactory instead.
      Parameters:
      tester - the tester
      environmentData - the environment data
      navigation - the navigation
      assertions - the assertions
      See Also:
      • FuncTestHelperFactory#getAdministration()
  • Method Details

    • reIndex

      public void reIndex()
      Description copied from interface: Administration
      Reindex JIRA, waiting for JIRA to complete the task, in the default index directory.
      Specified by:
      reIndex in interface Administration
    • setProfiling

      public void setProfiling(boolean on)
      Description copied from interface: Administration
      Set JIRA's profiling on or off.
      Specified by:
      setProfiling in interface Administration
      Parameters:
      on - or off
    • restoreBlankInstance

      public void restoreBlankInstance()
      Restores the jira instance to one with no issues. Some projects have been created
      Specified by:
      restoreBlankInstance in interface Administration
    • restoreBlankServerInstance

      public void restoreBlankServerInstance()
      Description copied from interface: Administration
      Restores a JIRA to blank instance with Server License. Use this when your test relies on Server license.
      Specified by:
      restoreBlankServerInstance in interface Administration
    • restoreBlankDataCenterInstance

      public void restoreBlankDataCenterInstance()
      Description copied from interface: Administration
      Restores a JIRA to blank instance with Data Center License. Use this when your test relies on DC license.
      Specified by:
      restoreBlankDataCenterInstance in interface Administration
    • restoreBlankInstanceWithLicense

      public void restoreBlankInstanceWithLicense(License license)
      Description copied from interface: Administration
      Restores a JIRA to a well known blank instance with the supplied licence.
      Specified by:
      restoreBlankInstanceWithLicense in interface Administration
      Parameters:
      license - the license to be installed
    • restoreNotSetupInstance

      public void restoreNotSetupInstance()
      Description copied from interface: Administration
      Restores a backup file with JIRA in an not setup state.

      If you use this method, you will have to then set up JIRA from scratch!

      Specified by:
      restoreNotSetupInstance in interface Administration
    • restoreNotSetupInstance

      public void restoreNotSetupInstance(String licenseKey)
      Description copied from interface: Administration
      Restores a backup file with JIRA in an not setup state.

      If you use this method, you will have to then set up JIRA from scratch!

      Specified by:
      restoreNotSetupInstance in interface Administration
      Parameters:
      licenseKey - the license key to be used for restore
    • restoreNotSetupRenaissanceInstance

      @Deprecated public void restoreNotSetupRenaissanceInstance(String licenseKey)
      Deprecated.
      since 7.0.1, use restoreNotSetupInstance
      This can be removed after JIRA renaissance has been released (7.0) as roles would be enabled by default. Tracked in HIROL-1075
      Specified by:
      restoreNotSetupRenaissanceInstance in interface Administration
      Parameters:
      licenseKey - the license key to be used for restore
    • copyFileToJiraImportDirectory

      public void copyFileToJiraImportDirectory(File file)
      Description copied from interface: Administration
      Copies a file to the JIRA import directory, presumably with the intention of testing imports directly.
      Specified by:
      copyFileToJiraImportDirectory in interface Administration
      Parameters:
      file - the file to copy to JIRA_HOME/import
    • replaceTokensInFile

      public File replaceTokensInFile(String originalXmlFileName, Map<String,String> replacements) throws IOException
      Description copied from interface: Administration
      Reads in an XML file and performs token replacements on it, writes the data to a temp file which is the return value
      Specified by:
      replaceTokensInFile in interface Administration
      Parameters:
      originalXmlFileName - the name of the XML file to read in; must be located in the standard XML file directory
      replacements - a map of token replacements
      Returns:
      a new temporary file that has its tokens replaced
      Throws:
      IOException - if there is a problem reading/writing the files
    • restoreDataWithReplacedTokens

      public void restoreDataWithReplacedTokens(String originalXmlFileName, Map<String,String> replacements) throws IOException
      Description copied from interface: Administration
      Same as Administration.restoreDataWithReplacedTokens(String, java.util.Map, boolean), except with useDefaultPaths set to false.
      Specified by:
      restoreDataWithReplacedTokens in interface Administration
      Throws:
      IOException
    • restoreDataWithReplacedTokens

      public void restoreDataWithReplacedTokens(String originalXmlFileName, Map<String,String> replacements, boolean useDefaultPaths) throws IOException
      Description copied from interface: Administration
      Reads in an XML file and performs token replacements on it, writes the data to a temp file, then imports that into JIRA.

      Note: this only works when the FuncTest client is running on the same host as the JIRA server.

      For methods to create date strings to use as your tokens, check out the DateUtil class

      Specified by:
      restoreDataWithReplacedTokens in interface Administration
      Parameters:
      originalXmlFileName - the name of the XML file to read in; must be located in the standard XML file directory
      replacements - a map of token replacements
      useDefaultPaths - if set to true, the paths (e.g., attachment, index) in the xml backup will be ignored, and the default used instead. If the token being replaced is part of the default paths, it is still replaced prior to restore.
      Throws:
      IOException - if there is a problem reading/writing the files
    • restoreData

      public void restoreData(String fileName)
      Description copied from interface: Administration
      Same as Administration.restoreData(String, boolean), but with useDefaultPaths set to false.
      Specified by:
      restoreData in interface Administration
    • restoreData

      public void restoreData(String fileName, boolean useDefaultPaths)
      Description copied from interface: Administration
      Restores the specified fileName as JIRA data.
      Specified by:
      restoreData in interface Administration
      Parameters:
      fileName - the XML file inside the standard backup file directory containing the JIRA data
      useDefaultPaths - if set to true, the xml backup's paths (e.g., index, attachment etc) will be ignored, and the default for those used in stead
    • restoreData

      public void restoreData(String fileName, Administration.OutgoingMailSettings outgoingMailSetting)
      Specified by:
      restoreData in interface Administration
    • link

      public Administration.Link link()
      Description copied from interface: Administration
      Retrieves the administration home link in the JIRA Header.
      Specified by:
      link in interface Administration
      Returns:
      the administration home link in the JIRA Header.
    • restoreDataAndLogin

      public void restoreDataAndLogin(String fileName, String username)
      Description copied from interface: Administration
      same as Administration.restoreDataAndLogin(String, String, boolean) but with userDefaultPaths parameter set to false.
      Specified by:
      restoreDataAndLogin in interface Administration
    • restoreDataAndLogin

      public void restoreDataAndLogin(String fileName, String username, boolean useDefaultPaths)
      Description copied from interface: Administration
      Restore the specified file and login to JIRA using the passed username.
      Specified by:
      restoreDataAndLogin in interface Administration
      Parameters:
      fileName - the name of the xml file to restore.
      username - the username used to login to JIRA after the restore. The username and the password are assumed to be the same.
      useDefaultPaths - if set to true, the xml backup's paths (e.g., index, attachment etc) will be ignored, and the default for those used in stead
    • restoreDataSlowOldWayAndLogin

      public void restoreDataSlowOldWayAndLogin(String fileName, String username)
      Description copied from interface: Administration
      Same as Administration.restoreDataSlowOldWayAndLogin(String, String, boolean) but with useDefaultPath set to false.
      Specified by:
      restoreDataSlowOldWayAndLogin in interface Administration
    • restoreDataSlowOldWayAndLogin

      public void restoreDataSlowOldWayAndLogin(String fileName, String username, boolean useDefaultPath)
      Description copied from interface: Administration
      Restore the specified file data NOT using the clear cache mechanism and login to JIRA using the passed username. This is much slower than using the default methods and should only be used if there is a real reason for it. If you find yourself using this method perhaps we should be fixing the cache clearing stuff instead.
      Specified by:
      restoreDataSlowOldWayAndLogin in interface Administration
      Parameters:
      fileName - the name of the xml file to restore.
      username - the username used to login to JIRA after the restore. The username and the password are assumed to be the same.
      useDefaultPath - if set to true, the paths in the xml backup (e.g., index, and attachment) will be ignored, and their default paths used instead.
    • restoreDataSlowOldWay

      public void restoreDataSlowOldWay(String fileName)
      Description copied from interface: Administration
      Same as Administration.restoreDataSlowOldWay(String, boolean), except with useDefaultPaths set to false.
      Specified by:
      restoreDataSlowOldWay in interface Administration
    • restoreDataSlowOldWay

      public void restoreDataSlowOldWay(String fileName, boolean useDefaultPaths)
      Description copied from interface: Administration
      Restores the specified fileName as JIRA data NOT using the clear cache mechanism. This is much slower than using the default methods and should only be used if there is a real reason for it. If you find yourself using this method perhaps we should be fixing the cache clearing stuff instead.
      Specified by:
      restoreDataSlowOldWay in interface Administration
      Parameters:
      fileName - the XML file inside the standard backup file directory containing the JIRA data
      useDefaultPaths - if set to true, the paths in the xml backup (e.g., index, and attachment) will be ignored, and their default paths used instead.
    • restoreDataWithPluginsReload

      public void restoreDataWithPluginsReload(String fileName)
      Description copied from interface: Administration
      Same as Administration.restoreDataWithPluginsReload(String, boolean), except with useDefaultPaths set to false.
      Specified by:
      restoreDataWithPluginsReload in interface Administration
    • restoreDataWithPluginsReload

      public void restoreDataWithPluginsReload(String fileName, boolean useDefaultPaths)
      Description copied from interface: Administration

      Restores the specified fileName as JIRA data NOT using the clear cache mechanism. The plugins system is restarted.

      This restore uses the full Pico refresh the same as in Production. ie it does not do a "Quick Import".

      This is much slower than using the default methods and should only be used if there is a real reason for it.

      Specified by:
      restoreDataWithPluginsReload in interface Administration
      Parameters:
      fileName - the XML file inside the standard backup file directory containing the JIRA data
      useDefaultPaths - if set to true, the paths in the xml backup (e.g., index, and attachment) will be ignored, and their default paths used instead.
    • restoreData

      public void restoreData(String path, String fileName)
    • restoreData

      public void restoreData(String path, String fileName, boolean useDefaultPath)
    • restoreDataSlowOldWay

      public void restoreDataSlowOldWay(String path, String fileName)
      Description copied from interface: Administration
      Same as Administration.restoreDataSlowOldWay(String, String, boolean), but with useDefaultPath set to false;
      Specified by:
      restoreDataSlowOldWay in interface Administration
    • restoreDataSlowOldWay

      public void restoreDataSlowOldWay(String path, String fileName, boolean useDefaultPath)
      Description copied from interface: Administration
      Restores the XML file from the specified directory NOT using the clear cache mechanism. This is much slower than using the default methods and should only be used if there is a real reason for it. If you find yourself using this method perhaps we should be fixing the cache clearing stuff instead.
      Specified by:
      restoreDataSlowOldWay in interface Administration
      Parameters:
      path - the directory in which the XML file is located
      fileName - the name of the XML file
      useDefaultPath - if set to true, the paths (e.g., attachment, index) in the xml backup will be ignored, and the default used instead
    • restoreDataWithLicense

      public void restoreDataWithLicense(String fileName, String licenseKey, boolean useDefaultPaths)
      Description copied from interface: Administration
      Restores the specified fileName as JIRA data, using the specified License key on import.
      Specified by:
      restoreDataWithLicense in interface Administration
      Parameters:
      fileName - the file conatining the JIRA data
      licenseKey - the license key to be installed
      useDefaultPaths - if set to true, the paths (e.g., attachment, index) in the xml backup will be ignored, and the default used instead
    • restoreDataWithLicense

      public void restoreDataWithLicense(String fileName, String licenseKey)
      Description copied from interface: Administration
      same as Administration.restoreDataWithLicense(String, String, boolean), except with useDefaultPaths set to false.
      Specified by:
      restoreDataWithLicense in interface Administration
    • restoreI18nData

      public void restoreI18nData(String fileName)
      Description copied from interface: Administration
      Restores the specified fileName as JIRA data. Does not make english assertions.
      Specified by:
      restoreI18nData in interface Administration
      Parameters:
      fileName - the fiel conatining the JIRA data
    • restoreDataWithBuildNumber

      public void restoreDataWithBuildNumber(String fileName, int expectedBuilderNumber)
      Description copied from interface: Administration
      Basically check the passed backup to ensure that it matches the passed build number and then restore the data. An exception will be thrown if the backup does not match the passed build number.
      Specified by:
      restoreDataWithBuildNumber in interface Administration
      Parameters:
      fileName - the path of the backup.
      expectedBuilderNumber - the build number the data should have.
    • exportDataToFile

      public File exportDataToFile(String fileName)
      Description copied from interface: Administration
      Exports the current running data to the specified absolute path
      Specified by:
      exportDataToFile in interface Administration
      Parameters:
      fileName - to backup to. This should just be a filename because JIRA always appends ${JIRA.HOME}/export to it before doing the export. Passing a directory may make it fail on windows.
      Returns:
      export file. it will be absolute.
    • getCurrentAttachmentPath

      public String getCurrentAttachmentPath()
      Description copied from interface: Administration
      Obtains the current attachment path configured for JIRA.

      This method does not check whether Attachments are enabled or not. If JIRA is configured to use the "default" attachment path, then this method still returns the ACTUAL path that is used.

      The implementation navigates to the Admin Attachments Settings page and screenscrapes, so don't expect to remain on the same page as when you called the method.

      Specified by:
      getCurrentAttachmentPath in interface Administration
      Returns:
      the current attachment path configured for JIRA.
    • activateSubTasks

      public void activateSubTasks()
      Specified by:
      activateSubTasks in interface Administration
    • addSubTaskType

      public void addSubTaskType(String name)
      Specified by:
      addSubTaskType in interface Administration
    • generalConfiguration

      public GeneralConfiguration generalConfiguration()
      Description copied from interface: Administration
      Allows you to perform generalConfiguration actions.
      Specified by:
      generalConfiguration in interface Administration
      Returns:
      generalConfiguration
    • backdoor

      public Backdoor backdoor()
      Description copied from interface: Administration
      Allows you to perform backdoor actions
      Specified by:
      backdoor in interface Administration
      Returns:
      backdoor
    • project

      public Project project()
      Description copied from interface: Administration
      Allows you to perform project actions.
      Specified by:
      project in interface Administration
      Returns:
      project
    • usersAndGroups

      public UsersAndGroups usersAndGroups()
      Description copied from interface: Administration
      Allows you to perform user and group actions.
      Specified by:
      usersAndGroups in interface Administration
      Returns:
      usersAndGroups
    • roles

      public Roles roles()
      Description copied from interface: Administration
      Allows you to perform role actions
      Specified by:
      roles in interface Administration
      Returns:
      roles
    • customFields

      public CustomFields customFields()
      Description copied from interface: Administration
      Allows you to perform custom field actions.
      Specified by:
      customFields in interface Administration
      Returns:
      customFields
    • permissionSchemes

      @Deprecated public PermissionSchemes permissionSchemes()
      Deprecated.
      all new tests with the Single Page Permission Schemes page should be written in a web driver test using EditPermissionsSinglePage. For backdoor based PermissionSchemes control use Backdoor.permissionSchemes()
      Description copied from interface: Administration
      Allows you to modify permission schemes.
      Specified by:
      permissionSchemes in interface Administration
      Returns:
      permissionSchemes
    • issueSecuritySchemes

      public IssueSecuritySchemes issueSecuritySchemes()
      Description copied from interface: Administration
      Allows you to modify issue security schemes.
      Specified by:
      issueSecuritySchemes in interface Administration
      Returns:
      issue security schemes of this administration
    • fieldConfigurations

      public FieldConfigurations fieldConfigurations()
      Description copied from interface: Administration
      Allows you to modify field configurations.
      Specified by:
      fieldConfigurations in interface Administration
      Returns:
      fieldConfigurations
    • fieldConfigurationSchemes

      public FieldConfigurationSchemes fieldConfigurationSchemes()
      Description copied from interface: Administration
      Allows you to modify field configuration schemes.
      Specified by:
      fieldConfigurationSchemes in interface Administration
      Returns:
      fieldConfigurationSchemes
    • projectImport

      public ProjectImport projectImport()
      Description copied from interface: Administration
      Allows you to perform project imports.
      Specified by:
      projectImport in interface Administration
      Returns:
      projectImport
    • plugins

      public Plugins plugins()
      Description copied from interface: Administration
      Utility function to allow you some basic plugins control
      Specified by:
      plugins in interface Administration
      Returns:
      plugins
    • removeGlobalPermission

      public void removeGlobalPermission(GlobalPermissionKey permissionKey, String group)
      Description copied from interface: Administration
      Remove a group from a given Global Permission. Ends up on the Global Permissions page.
      Specified by:
      removeGlobalPermission in interface Administration
      Parameters:
      permissionKey - The permission to remove the group from
      group - the group to remove
    • removeGlobalPermission

      public void removeGlobalPermission(int permission, String group)
      Description copied from interface: Administration
      Remove a group from a given Global Permission. Ends up on the Global Permissions page.
      Specified by:
      removeGlobalPermission in interface Administration
      Parameters:
      permission - The permission to remove teh group from
      group - the group to remove
    • addGlobalPermission

      public void addGlobalPermission(GlobalPermissionKey permission, String group)
      Description copied from interface: Administration
      Add a group to a Global permission Ends up on the Global Permissions page.
      Specified by:
      addGlobalPermission in interface Administration
      Parameters:
      permission - the permission to add the group to
      group - The group to add
    • addGlobalPermission

      public void addGlobalPermission(int permission, String group)
      Description copied from interface: Administration
      Add a group to a Global permission Ends up on the Global Permissions page.
      Specified by:
      addGlobalPermission in interface Administration
      Parameters:
      permission - the permission to add the group to
      group - The group to add
    • switchToLicense

      public void switchToLicense(License license)
      Description copied from interface: Administration
      Changes JIRA's lincense to a given license object
      Specified by:
      switchToLicense in interface Administration
      Parameters:
      license - license to switch to
    • switchToLicense

      public void switchToLicense(String license, String description)
      Description copied from interface: Administration
      Changes JIRA's lincense to a given license and asserts that the description then appears on the view license
      Specified by:
      switchToLicense in interface Administration
      Parameters:
      license - license to switch to
      description - license description
    • switchToPersonalLicense

      public void switchToPersonalLicense()
      Description copied from interface: Administration
      Switches the license to a personal license.
      Specified by:
      switchToPersonalLicense in interface Administration
    • switchToStarterLicense

      public void switchToStarterLicense()
      Description copied from interface: Administration
      Switches the license to a starter license.
      Specified by:
      switchToStarterLicense in interface Administration
    • getJiraHomeDirectory

      public String getJiraHomeDirectory()
      Description copied from interface: Administration
      Returns the JIRA home directory as reported in the System Info section
      Specified by:
      getJiraHomeDirectory in interface Administration
      Returns:
      the JIRA home directory as reported in the System Info section
    • getSystemTenantHomeDirectory

      public String getSystemTenantHomeDirectory()
      Description copied from interface: Administration
      Get the system tenant home directory. This does the same thing as getJiraHomeDirectory, except it doesn't cache it in a thread local. It assumes that the environment data for this administration object is for the system tenant. It should only be called when a tenant is provisioned, which should only be done on the first test to that tenant.
      Specified by:
      getSystemTenantHomeDirectory in interface Administration
      Returns:
      The system tenant home directory.
    • mailServers

      public MailServerAdministration mailServers()
      Description copied from interface: Administration
      Gets an instance of the Mail Server Administration page.
      Specified by:
      mailServers in interface Administration
      Returns:
      an instance of the Mail Server Administration page.
    • sharedFilters

      public SharedFiltersAdministration sharedFilters()
      Description copied from interface: Administration
      Gets an instance of the Shared Filters Administration page.
      Specified by:
      sharedFilters in interface Administration
      Returns:
      an instance of the Shared Filters Administration page.
    • sharedDashboards

      public SharedDashboardsAdministration sharedDashboards()
      Specified by:
      sharedDashboards in interface Administration
    • sendBulkMail

      public SendBulkMail sendBulkMail()
      Description copied from interface: Administration
      Gets an instance of the Send Bulk Mail Page.
      Specified by:
      sendBulkMail in interface Administration
      Returns:
      an instance of the Send Bulk Mail Page.
    • tabs

      public AdminTabs tabs()
      Description copied from interface: Administration
      Gets an instance of the AdminTabs Page Object.
      Specified by:
      tabs in interface Administration
      Returns:
      an instance of the AdminTabs Page Object.
    • advancedApplicationProperties

      public AdvancedApplicationProperties advancedApplicationProperties()
      Description copied from interface: Administration
      Gets an instance of the AdvancedApplicationProperties Page Object.
      Specified by:
      advancedApplicationProperties in interface Administration
      Returns:
      an instance of the AdvancedApplicationProperties Page Object.
    • statuses

      public Statuses statuses()
      Description copied from interface: Administration
      Gets the instance of the Statuses page
      Specified by:
      statuses in interface Administration
    • subtasks

      public Subtasks subtasks()
      Specified by:
      subtasks in interface Administration
      Returns:
      grouping to manage administration of subtasks
    • issueLinking

      public IssueLinking issueLinking()
      Description copied from interface: Administration
      TGo to issue linking administration section.
      Specified by:
      issueLinking in interface Administration
      Returns:
      grouping to manage issue linking
    • timeTracking

      public TimeTracking timeTracking()
      Description copied from interface: Administration
      Get time tracking administration section util.
      Specified by:
      timeTracking in interface Administration
      Returns:
      time tracking configuration
    • resolutions

      public Resolutions resolutions()
      Specified by:
      resolutions in interface Administration
      Returns:
      resolution configuration
    • services

      public ViewServices services()
      Description copied from interface: Administration
      Returns the ViewServices object which allows you to run operations on the ViewServices page.
      Specified by:
      services in interface Administration
      Returns:
      the ViewServices object which allows you to run operations on the ViewServices page.
    • getEdition

      public String getEdition()
      Description copied from interface: Administration
      Returns the current edition name. This may be useful for licensing checks
      Specified by:
      getEdition in interface Administration
      Returns:
      the current edition name
      See Also:
    • getBuildNumber

      public long getBuildNumber()
      Description copied from interface: Administration
      Returns ths current build number. A RuntimeException will be thrown if we can't find the build number.
      Specified by:
      getBuildNumber in interface Administration
      Returns:
      JIRA's build number.
    • enableAccessLogging

      public void enableAccessLogging()
      Description copied from interface: Administration
      enable http access logging
      Specified by:
      enableAccessLogging in interface Administration
    • attachments

      public Attachments attachments()
      Specified by:
      attachments in interface Administration
      Returns:
      attachments
    • viewFieldScreens

      public ViewFieldScreens viewFieldScreens()
      Description copied from interface: Administration
      Field screens config.
      Specified by:
      viewFieldScreens in interface Administration
      Returns:
      field screens config
    • utilities

      public Administration.Utilities utilities()
      Specified by:
      utilities in interface Administration
      Returns:
      utilities
    • workflows

      public ViewWorkflows workflows()
      Description copied from interface: Administration
      Manage the 'Workflows' administration page
      Specified by:
      workflows in interface Administration
      Returns:
      ViewWorkflows instance
    • notificationSchemes

      public NotificationSchemes notificationSchemes()
      Description copied from interface: Administration
      'Notification Schemes' administration section
      Specified by:
      notificationSchemes in interface Administration
      Returns:
      NotificationSchemes instance
    • waitForRestore

      public void waitForRestore()
      Description copied from interface: Administration
      Waits for the data import progress to complete.
      Specified by:
      waitForRestore in interface Administration