Package com.atlassian.confluence.it
Class ServerStateManager
- java.lang.Object
-
- com.atlassian.confluence.it.ServerStateManager
-
public class ServerStateManager extends Object
High-level manager for manipulating server state before and after acceptance tests.- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description ServerStateManager(ConfluenceRpc rpc, TestData testData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
createTestData()
Deprecated.Since 5.6 UsecreateTestData(boolean)
to be explicit about test user creation.void
createTestData(boolean autoCreateTestUsers)
DirectoryConfiguration
getDirectoryConfiguration()
UserManagementHelper
getUserHelper()
static boolean
isInstanceOk()
Label the instance as broken, so that future tests can Skip fast.void
onlyRemoveTestData()
Removes all test data, including users, groups, permission, spaces and content.void
pauseJobs()
Pauses either all jobs, or a subset of jobs, to stop them interfering with test-running, particularly subsequent calls topauseJobsAndRemoveTestData()
orresetTestData(boolean)
.void
pauseJobsAndRemoveTestData()
Removes all test data, including users, groups, permission, spaces and content.void
removeTestData()
Deprecated.since 7.9 because it is misleadingly named.void
resetTestData()
Deprecated.since 5.6 UseresetTestData(boolean)
to be explicit about auto-test-user creation.void
resetTestData(boolean autoCreateTestUsers)
Resets all test data, including users, groups, permission, spaces, content, etc, to a stable state.static void
skipFurtherTests()
Label the instance as broken, so that future tests can Skip fast.void
waitForUpgradeTasks()
We need to wait for plugin upgrade tasks to complete before removing test data as it can break things.
-
-
-
Constructor Detail
-
ServerStateManager
public ServerStateManager(ConfluenceRpc rpc, TestData testData)
-
-
Method Detail
-
getUserHelper
public UserManagementHelper getUserHelper()
-
getDirectoryConfiguration
public DirectoryConfiguration getDirectoryConfiguration()
-
resetTestData
@Deprecated public void resetTestData()
Deprecated.since 5.6 UseresetTestData(boolean)
to be explicit about auto-test-user creation.
-
resetTestData
public void resetTestData(boolean autoCreateTestUsers)
Resets all test data, including users, groups, permission, spaces, content, etc, to a stable state.Called from every test setUp.
-
skipFurtherTests
public static void skipFurtherTests()
Label the instance as broken, so that future tests can Skip fast.
-
isInstanceOk
public static boolean isInstanceOk()
Label the instance as broken, so that future tests can Skip fast.
-
waitForUpgradeTasks
public void waitForUpgradeTasks()
We need to wait for plugin upgrade tasks to complete before removing test data as it can break things. Plugin builds which usually run upgrade tasks on test data can start running tests even before the upgrade tasks have finished.
-
pauseJobsAndRemoveTestData
public void pauseJobsAndRemoveTestData()
Removes all test data, including users, groups, permission, spaces and content.If possible, call
resetTestData(boolean)
instead to create common data at the same time.
-
removeTestData
@Deprecated public void removeTestData()
Deprecated.since 7.9 because it is misleadingly named. UsepauseJobsAndRemoveTestData()
, oronlyRemoveTestData()
.Removes all test data, including users, groups, permission, spaces and content.If possible, call
resetTestData(boolean)
instead to create common data at the same time.
-
onlyRemoveTestData
public void onlyRemoveTestData()
Removes all test data, including users, groups, permission, spaces and content.If possible, call
resetTestData(boolean)
instead to create common data at the same time.
-
pauseJobs
public void pauseJobs()
Pauses either all jobs, or a subset of jobs, to stop them interfering with test-running, particularly subsequent calls topauseJobsAndRemoveTestData()
orresetTestData(boolean)
.
-
createTestData
@Deprecated public void createTestData()
Deprecated.Since 5.6 UsecreateTestData(boolean)
to be explicit about test user creation.
-
createTestData
public void createTestData(boolean autoCreateTestUsers)
-
-