Class DbCachingTestHelper
java.lang.Object
com.atlassian.crowd.acceptance.utils.DbCachingTestHelper
Helper class for testing DB caching directories.
- Since:
- v2.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInformation about the synchronisation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisSynchronising(long directoryId) Returnstrueif the directory is currently being synchronised.booleanisSynchronising(String directoryName) Returnstrueif the directory is currently being synchronised.static DbCachingTestHelper.SyncInfosynchroniseDirectory(String baseUrl, String directoryName, Duration maxWaitTime) Synchronises the directory and waits until the synchronisation has finished.static DbCachingTestHelper.SyncInfosynchroniseDirectory(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) Returnstrueif the directory is currently being synchronised.- Parameters:
directoryId-- Returns:
trueif the directory is currently being synchronised
-
isSynchronising
Returnstrueif the directory is currently being synchronised.- Parameters:
directoryName-- Returns:
trueif the directory is currently being synchronised
-