public class

AdministrationImpl

extends AbstractFuncTestUtil
implements Administration FuncTestLogger
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.AbstractFuncTestUtil
     ↳ com.atlassian.jira.functest.framework.AdministrationImpl

Class Overview

Implementation of Administration

Summary

Nested Classes
class AdministrationImpl.DefaultLink  
Constants
String LEGACY_PROJECT_PERMISSIONS_PAGE_DARK_FEATURE
[Expand]
Inherited Constants
From interface com.atlassian.jira.functest.framework.Administration
[Expand]
Inherited Fields
From class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
Public Constructors
AdministrationImpl(WebTester tester, JIRAEnvironmentData environmentData, Navigation navigation, Assertions assertions)
Note: if you need to construct this for an old-style JIRAWebTest, you may want to consider using FuncTestHelperFactory instead.
Public Methods
void activateSubTasks()
void addGlobalPermission(int permission, String group)
Add a group to a Global permission Ends up on the Global Permissions page.
void addGlobalPermission(GlobalPermissionKey permission, String group)
Add a group to a Global permission Ends up on the Global Permissions page.
void addSubTaskType(String name)
AdvancedApplicationProperties advancedApplicationProperties()
Gets an instance of the AdvancedApplicationProperties Page Object.
Attachments attachments()
Backdoor backdoor()
Allows you to perform backdoor actions
void copyFileToJiraImportDirectory(File file)
Copies a file to the JIRA import directory, presumably with the intention of testing imports directly.
CustomFields customFields()
Allows you to perform custom field actions.
void enableAccessLogging()
enable http access logging
File exportDataToFile(String fileName)
Exports the current running data to the specified absolute path
FieldConfigurationSchemes fieldConfigurationSchemes()
Allows you to modify field configuration schemes.
FieldConfigurations fieldConfigurations()
Allows you to modify field configurations.
GeneralConfiguration generalConfiguration()
Allows you to perform generalConfiguration actions.
long getBuildNumber()
Returns ths current build number.
String getCurrentAttachmentPath()
Obtains the current attachment path configured for JIRA.
String getEdition()
Returns the current edition name.
String getJiraHomeDirectory()
Returns the JIRA home directory as reported in the System Info section
String getSystemTenantHomeDirectory()
Get the system tenant home directory.
IssueLinking issueLinking()
TGo to issue linking administration section.
IssueSecuritySchemes issueSecuritySchemes()
Allows you to modify issue security schemes.
Administration.Link link()
Retrieves the administration home link in the JIRA Header.
MailServerAdministration mailServers()
Gets an instance of the Mail Server Administration page.
NotificationSchemes notificationSchemes()
'Notification Schemes' administration section
PermissionSchemes permissionSchemes()
Allows you to modify permission schemes.
Plugins plugins()
Utility function to allow you some basic plugins control
Project project()
Allows you to perform project actions.
ProjectImport projectImport()
Allows you to perform project imports.
void reIndex()
Reindex JIRA, waiting for JIRA to complete the task, in the default index directory.
void removeGlobalPermission(int permission, String group)
Remove a group from a given Global Permission.
void removeGlobalPermission(GlobalPermissionKey permissionKey, String group)
Remove a group from a given Global Permission.
File replaceTokensInFile(String originalXmlFileName, Map<StringString> replacements)
Reads in an XML file and performs token replacements on it, writes the data to a temp file which is the return value
Resolutions resolutions()
void restoreBlankInstance()
Restores the jira instance to one with no issues.
void restoreBlankInstanceWithLicense(License license)
Restores a JIRA to a well known blank instance with the supplied licence.
void restoreData(String fileName, Administration.OutgoingMailSettings outgoingMailSetting)
void restoreData(String path, String fileName, boolean useDefaultPath)
void restoreData(String fileName)
Same as restoreData(String, boolean), but with useDefaultPaths set to false.
void restoreData(String fileName, boolean useDefaultPaths)
Restores the specified fileName as JIRA data.
void restoreData(String path, String fileName)
void restoreDataAndLogin(String fileName, String username)
same as restoreDataAndLogin(String, String, boolean) but with userDefaultPaths parameter set to false.
void restoreDataAndLogin(String fileName, String username, boolean useDefaultPaths)
Restore the specified file and login to JIRA using the passed username.
void restoreDataSlowOldWay(String path, String fileName, boolean useDefaultPath)
Restores the XML file from the specified directory NOT using the clear cache mechanism.
void restoreDataSlowOldWay(String path, String fileName)
Same as restoreDataSlowOldWay(String, String, boolean), but with useDefaultPath set to false;
void restoreDataSlowOldWay(String fileName, boolean useDefaultPaths)
Restores the specified fileName as JIRA data NOT using the clear cache mechanism.
void restoreDataSlowOldWay(String fileName)
Same as restoreDataSlowOldWay(String, boolean), except with useDefaultPaths set to false.
void restoreDataSlowOldWayAndLogin(String fileName, String username)
Same as restoreDataSlowOldWayAndLogin(String, String, boolean) but with useDefaultPath set to false.
void restoreDataSlowOldWayAndLogin(String fileName, String username, boolean useDefaultPath)
Restore the specified file data NOT using the clear cache mechanism and login to JIRA using the passed username.
void restoreDataWithBuildNumber(String fileName, int expectedBuilderNumber)
Basically check the passed backup to ensure that it matches the passed build number and then restore the data.
void restoreDataWithLicense(String fileName, String licenseKey)
same as restoreDataWithLicense(String, String, boolean), except with useDefaultPaths set to false.
void restoreDataWithLicense(String fileName, String licenseKey, boolean useDefaultPaths)
Restores the specified fileName as JIRA data, using the specified License key on import.
void restoreDataWithPluginsReload(String fileName)
Same as restoreDataWithPluginsReload(String, boolean), except with useDefaultPaths set to false.
void restoreDataWithPluginsReload(String fileName, boolean useDefaultPaths)

Restores the specified fileName as JIRA data NOT using the clear cache mechanism.

void restoreDataWithReplacedTokens(String originalXmlFileName, Map<StringString> replacements, boolean useDefaultPaths)
Reads in an XML file and performs token replacements on it, writes the data to a temp file, then imports that into JIRA.
void restoreDataWithReplacedTokens(String originalXmlFileName, Map<StringString> replacements)
Same as restoreDataWithReplacedTokens(String, java.util.Map, boolean), except with useDefaultPaths set to false.
void restoreI18nData(String fileName)
Restores the specified fileName as JIRA data.
void restoreNotSetupInstance()
Restores a backup file with JIRA in an not setup state.
void restoreNotSetupInstance(String licenseKey)
Restores a backup file with JIRA in an not setup state.
@Deprecated void restoreNotSetupRenaissanceInstance(String licenseKey)
This method is deprecated. since 7.0.1, use restoreNotSetupInstance
Roles roles()
Allows you to perform role actions
SendBulkMail sendBulkMail()
Gets an instance of the Send Bulk Mail Page.
ViewServices services()
Returns the ViewServices object which allows you to run operations on the ViewServices page.
void setProfiling(boolean on)
Set JIRA's profiling on or off.
SharedDashboardsAdministration sharedDashboards()
SharedFiltersAdministration sharedFilters()
Gets an instance of the Shared Filters Administration page.
Subtasks subtasks()
void switchToLicense(String license, String description)
Changes JIRA's lincense to a given license and asserts that the description then appears on the view license
void switchToLicense(License license)
Changes JIRA's lincense to a given license object
void switchToPersonalLicense()
Switches the license to a personal license.
void switchToStarterLicense()
Switches the license to a starter license.
AdminTabs tabs()
Gets an instance of the AdminTabs Page Object.
TimeTracking timeTracking()
Get time tracking administration section util.
UsersAndGroups usersAndGroups()
Allows you to perform user and group actions.
Administration.Utilities utilities()
ViewFieldScreens viewFieldScreens()
Field screens config.
void waitForRestore()
Waits for the data import progress to complete.
ViewWorkflows workflows()
Manage the 'Workflows' administration page
[Expand]
Inherited Methods
From class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
From class java.lang.Object
From interface com.atlassian.jira.functest.framework.Administration
From interface com.atlassian.jira.testkit.client.log.FuncTestLogger

Constants

public static final String LEGACY_PROJECT_PERMISSIONS_PAGE_DARK_FEATURE

Constant Value: "com.atlassian.jira.permission-schemes.single-page-ui.disabled"

Public Constructors

public AdministrationImpl (WebTester tester, JIRAEnvironmentData environmentData, Navigation navigation, Assertions assertions)

Note: if you need to construct this for an old-style JIRAWebTest, you may want to consider using FuncTestHelperFactory instead.

Parameters
tester the tester
environmentData the environment data
navigation the navigation
assertions the assertions

Public Methods

public void activateSubTasks ()

public void addGlobalPermission (int permission, String group)

Add a group to a Global permission Ends up on the Global Permissions page.

Parameters
permission the permission to add the group to
group The group to add

public void addGlobalPermission (GlobalPermissionKey permission, String group)

Add a group to a Global permission Ends up on the Global Permissions page.

Parameters
permission the permission to add the group to
group The group to add

public void addSubTaskType (String name)

public AdvancedApplicationProperties advancedApplicationProperties ()

Gets an instance of the AdvancedApplicationProperties Page Object.

Returns
  • an instance of the AdvancedApplicationProperties Page Object.

public Attachments attachments ()

public Backdoor backdoor ()

Allows you to perform backdoor actions

Returns
  • backdoor

public void copyFileToJiraImportDirectory (File file)

Copies a file to the JIRA import directory, presumably with the intention of testing imports directly.

Parameters
file the file to copy to JIRA_HOME/import

public CustomFields customFields ()

Allows you to perform custom field actions.

Returns
  • customFields

public void enableAccessLogging ()

enable http access logging

public File exportDataToFile (String fileName)

Exports the current running data to the specified absolute path

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.

public FieldConfigurationSchemes fieldConfigurationSchemes ()

Allows you to modify field configuration schemes.

Returns
  • fieldConfigurationSchemes

public FieldConfigurations fieldConfigurations ()

Allows you to modify field configurations.

Returns
  • fieldConfigurations

public GeneralConfiguration generalConfiguration ()

Allows you to perform generalConfiguration actions.

Returns
  • generalConfiguration

public long getBuildNumber ()

Returns ths current build number. A RuntimeException will be thrown if we can't find the build number.

Returns
  • JIRA's build number.

public String getCurrentAttachmentPath ()

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.

Returns
  • the current attachment path configured for JIRA.

public String getEdition ()

Returns the current edition name. This may be useful for licensing checks

Returns
  • the current edition name

public String getJiraHomeDirectory ()

Returns the JIRA home directory as reported in the System Info section

Returns
  • the JIRA home directory as reported in the System Info section

public String getSystemTenantHomeDirectory ()

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.

Returns
  • The system tenant home directory.

public IssueLinking issueLinking ()

TGo to issue linking administration section.

Returns
  • grouping to manage issue linking

public IssueSecuritySchemes issueSecuritySchemes ()

Allows you to modify issue security schemes.

Returns
  • issue security schemes of this administration

public Administration.Link link ()

Retrieves the administration home link in the JIRA Header.

Returns
  • the administration home link in the JIRA Header.

public MailServerAdministration mailServers ()

Gets an instance of the Mail Server Administration page.

Returns
  • an instance of the Mail Server Administration page.

public NotificationSchemes notificationSchemes ()

'Notification Schemes' administration section

Returns

public PermissionSchemes permissionSchemes ()

Allows you to modify permission schemes.

Returns
  • permissionSchemes

public Plugins plugins ()

Utility function to allow you some basic plugins control

Returns
  • plugins

public Project project ()

Allows you to perform project actions.

Returns
  • project

public ProjectImport projectImport ()

Allows you to perform project imports.

Returns
  • projectImport

public void reIndex ()

Reindex JIRA, waiting for JIRA to complete the task, in the default index directory.

public void removeGlobalPermission (int permission, String group)

Remove a group from a given Global Permission. Ends up on the Global Permissions page.

Parameters
permission The permission to remove teh group from
group the group to remove

public void removeGlobalPermission (GlobalPermissionKey permissionKey, String group)

Remove a group from a given Global Permission. Ends up on the Global Permissions page.

Parameters
permissionKey The permission to remove the group from
group the group to remove

public File replaceTokensInFile (String originalXmlFileName, Map<StringString> replacements)

Reads in an XML file and performs token replacements on it, writes the data to a temp file which is the return value

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

public Resolutions resolutions ()

public void restoreBlankInstance ()

Restores the jira instance to one with no issues. Some projects have been created

public void restoreBlankInstanceWithLicense (License license)

Restores a JIRA to a well known blank instance with the supplied licence.

Parameters
license the license to be installed

public void restoreData (String fileName, Administration.OutgoingMailSettings outgoingMailSetting)

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

public void restoreData (String fileName)

Same as restoreData(String, boolean), but with useDefaultPaths set to false.

public void restoreData (String fileName, boolean useDefaultPaths)

Restores the specified fileName as JIRA data.

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

public void restoreData (String path, String fileName)

public void restoreDataAndLogin (String fileName, String username)

same as restoreDataAndLogin(String, String, boolean) but with userDefaultPaths parameter set to false.

public void restoreDataAndLogin (String fileName, String username, boolean useDefaultPaths)

Restore the specified file and login to JIRA using the passed username.

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

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

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.

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

public void restoreDataSlowOldWay (String path, String fileName)

Same as restoreDataSlowOldWay(String, String, boolean), but with useDefaultPath set to false;

public void restoreDataSlowOldWay (String fileName, boolean useDefaultPaths)

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.

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.

public void restoreDataSlowOldWay (String fileName)

Same as restoreDataSlowOldWay(String, boolean), except with useDefaultPaths set to false.

public void restoreDataSlowOldWayAndLogin (String fileName, String username)

Same as restoreDataSlowOldWayAndLogin(String, String, boolean) but with useDefaultPath set to false.

public void restoreDataSlowOldWayAndLogin (String fileName, String username, boolean useDefaultPath)

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.

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.

public void restoreDataWithBuildNumber (String fileName, int expectedBuilderNumber)

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.

Parameters
fileName the path of the backup.
expectedBuilderNumber the build number the data should have.

public void restoreDataWithLicense (String fileName, String licenseKey)

same as restoreDataWithLicense(String, String, boolean), except with useDefaultPaths set to false.

public void restoreDataWithLicense (String fileName, String licenseKey, boolean useDefaultPaths)

Restores the specified fileName as JIRA data, using the specified License key on import.

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

public void restoreDataWithPluginsReload (String fileName)

Same as restoreDataWithPluginsReload(String, boolean), except with useDefaultPaths set to false.

public void restoreDataWithPluginsReload (String fileName, boolean useDefaultPaths)

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.

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.

public void restoreDataWithReplacedTokens (String originalXmlFileName, Map<StringString> replacements, boolean useDefaultPaths)

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

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

public void restoreDataWithReplacedTokens (String originalXmlFileName, Map<StringString> replacements)

Same as restoreDataWithReplacedTokens(String, java.util.Map, boolean), except with useDefaultPaths set to false.

Throws
IOException

public void restoreI18nData (String fileName)

Restores the specified fileName as JIRA data. Does not make english assertions.

Parameters
fileName the fiel conatining the JIRA data

public void restoreNotSetupInstance ()

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!

public void restoreNotSetupInstance (String licenseKey)

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!

Parameters
licenseKey the license key to be used for restore

@Deprecated public void restoreNotSetupRenaissanceInstance (String licenseKey)

This method is 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

Parameters
licenseKey the license key to be used for restore

public Roles roles ()

Allows you to perform role actions

Returns
  • roles

public SendBulkMail sendBulkMail ()

Gets an instance of the Send Bulk Mail Page.

Returns
  • an instance of the Send Bulk Mail Page.

public ViewServices services ()

Returns the ViewServices object which allows you to run operations on the ViewServices page.

Returns
  • the ViewServices object which allows you to run operations on the ViewServices page.

public void setProfiling (boolean on)

Set JIRA's profiling on or off.

Parameters
on or off

public SharedDashboardsAdministration sharedDashboards ()

public SharedFiltersAdministration sharedFilters ()

Gets an instance of the Shared Filters Administration page.

Returns
  • an instance of the Shared Filters Administration page.

public Subtasks subtasks ()

public void switchToLicense (String license, String description)

Changes JIRA's lincense to a given license and asserts that the description then appears on the view license

Parameters
license license to switch to
description license description

public void switchToLicense (License license)

Changes JIRA's lincense to a given license object

Parameters
license license to switch to

public void switchToPersonalLicense ()

Switches the license to a personal license.

public void switchToStarterLicense ()

Switches the license to a starter license.

public AdminTabs tabs ()

Gets an instance of the AdminTabs Page Object.

Returns
  • an instance of the AdminTabs Page Object.

public TimeTracking timeTracking ()

Get time tracking administration section util.

Returns
  • time tracking configuration

public UsersAndGroups usersAndGroups ()

Allows you to perform user and group actions.

Returns
  • usersAndGroups

public Administration.Utilities utilities ()

public ViewFieldScreens viewFieldScreens ()

Field screens config.

Returns
  • field screens config

public void waitForRestore ()

Waits for the data import progress to complete.

public ViewWorkflows workflows ()

Manage the 'Workflows' administration page

Returns