Class DbCachingTestHelper
java.lang.Object
com.atlassian.crowd.acceptance.utils.DbCachingTestHelper
Helper class for testing DB caching directories.
- Since:
- v2.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Information about the synchronisation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isSynchronising
(long directoryId) Returnstrue
if the directory is currently being synchronised.boolean
isSynchronising
(String directoryName) Returnstrue
if the directory is currently being synchronised.static DbCachingTestHelper.SyncInfo
synchroniseDirectory
(String baseUrl, String directoryName, Duration maxWaitTime) Synchronises the directory and waits until the synchronisation has finished.static DbCachingTestHelper.SyncInfo
synchroniseDirectory
(String baseUrl, String directoryName, Duration maxWaitTime, String shortDescription) Synchronises the directory and waits until the synchronisation has finished.synchroniseDirectory
(String directoryName, Duration maxWaitTime) Synchronises the directory and waits until the synchronisation has finished.synchroniseDirectory
(String directoryName, Duration maxWaitTime, String shortDescription) Synchronises the directory and waits until the synchronisation has finished.waitTillSyncFinished
(String directoryName, Duration maxWaitTime) Waits until the synchronisation finishes.
-
Constructor Details
-
DbCachingTestHelper
-
-
Method Details
-
synchroniseDirectory
public static DbCachingTestHelper.SyncInfo synchroniseDirectory(String baseUrl, String directoryName, Duration maxWaitTime) Synchronises the directory and waits until the synchronisation has finished. Use as a convenience method for a one-off synchronisation. Otherwise instantiate an instance ofDbCachingTestHelper
.- Parameters:
baseUrl
- Crowd base URLdirectoryName
- name of the directory to synchronisemaxWaitTime
- maximum time to wait for the synchronisation to finish- Throws:
AssertionError
- if the synchronisation doesn't finish withinmaxWaitTime
.
-
synchroniseDirectory
public static DbCachingTestHelper.SyncInfo synchroniseDirectory(String baseUrl, String directoryName, Duration maxWaitTime, String shortDescription) Synchronises the directory and waits until the synchronisation has finished. Use as a convenience method for a one-off synchronisation. Otherwise instantiate an instance ofDbCachingTestHelper
.- Parameters:
baseUrl
- Crowd base URLdirectoryName
- name of the directory to synchronisemaxWaitTime
- maximum time to wait for the synchronisation to finishshortDescription
- description about the synchronisation task- Throws:
AssertionError
- if the synchronisation doesn't finish withinmaxWaitTime
.
-
synchroniseDirectory
public DbCachingTestHelper.SyncInfo synchroniseDirectory(String directoryName, Duration maxWaitTime) Synchronises the directory and waits until the synchronisation has finished.- Parameters:
directoryName
- name of the directory to synchronisemaxWaitTime
- maximum time to wait for the synchronisation to finish- Returns:
- SyncInfo
- Throws:
AssertionError
- if the synchronisation doesn't finish withinmaxWaitTime
.
-
synchroniseDirectory
public DbCachingTestHelper.SyncInfo synchroniseDirectory(String directoryName, Duration maxWaitTime, String shortDescription) Synchronises the directory and waits until the synchronisation has finished.- Parameters:
directoryName
- name of the directory to synchronisemaxWaitTime
- maximum time to wait for the synchronisation to finishshortDescription
- description about the synchronisation task- Returns:
- SyncInfo
- Throws:
AssertionError
- if the synchronisation doesn't finish withinmaxWaitTime
.
-
waitTillSyncFinished
public DetailedDirectorySynchronizationData waitTillSyncFinished(String directoryName, Duration maxWaitTime) Waits until the synchronisation finishes. Polls every 1 second to check if the synchronisation has finished.- Parameters:
maxWaitTime
- maximum time to wait for the synchronisation to finish- Throws:
AssertionError
- if the synchronisation doesn't finish withinmaxWaitTime
.
-
isSynchronising
public boolean isSynchronising(long directoryId) Returnstrue
if the directory is currently being synchronised.- Parameters:
directoryId
-- Returns:
true
if the directory is currently being synchronised
-
isSynchronising
Returnstrue
if the directory is currently being synchronised.- Parameters:
directoryName
-- Returns:
true
if the directory is currently being synchronised
-