Class DbCachingTestHelper

java.lang.Object
com.atlassian.crowd.acceptance.utils.DbCachingTestHelper

public class DbCachingTestHelper extends Object
Helper class for testing DB caching directories.
Since:
v2.1
  • Constructor Details

    • DbCachingTestHelper

      public DbCachingTestHelper(String baseUrl)
  • 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 of DbCachingTestHelper.
      Parameters:
      baseUrl - Crowd base URL
      directoryName - name of the directory to synchronise
      maxWaitTime - maximum time to wait for the synchronisation to finish
      Throws:
      AssertionError - if the synchronisation doesn't finish within maxWaitTime.
    • 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 of DbCachingTestHelper.
      Parameters:
      baseUrl - Crowd base URL
      directoryName - name of the directory to synchronise
      maxWaitTime - maximum time to wait for the synchronisation to finish
      shortDescription - description about the synchronisation task
      Throws:
      AssertionError - if the synchronisation doesn't finish within maxWaitTime.
    • 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 synchronise
      maxWaitTime - maximum time to wait for the synchronisation to finish
      Returns:
      SyncInfo
      Throws:
      AssertionError - if the synchronisation doesn't finish within maxWaitTime.
    • 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 synchronise
      maxWaitTime - maximum time to wait for the synchronisation to finish
      shortDescription - description about the synchronisation task
      Returns:
      SyncInfo
      Throws:
      AssertionError - if the synchronisation doesn't finish within maxWaitTime.
    • 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 within maxWaitTime.
    • isSynchronising

      public boolean isSynchronising(long directoryId)
      Returns true if the directory is currently being synchronised.
      Parameters:
      directoryId -
      Returns:
      true if the directory is currently being synchronised
    • isSynchronising

      public boolean isSynchronising(String directoryName)
      Returns true if the directory is currently being synchronised.
      Parameters:
      directoryName -
      Returns:
      true if the directory is currently being synchronised