クラス LdapTestUtils

java.lang.ObjectSE
org.springframework.ldap.test.unboundid.LdapTestUtils

public final class LdapTestUtils extends ObjectSE
統合テストの目的で使用するインプロセス Apache Directory サーバーを起動、停止、設定するためのユーティリティ。
  • メソッドの詳細

    • startEmbeddedServer

      public static void startEmbeddedServer(int port, StringSE defaultPartitionSuffix, StringSE defaultPartitionName)
      組み込み Apache Directory サーバーを起動します。同じ JVM で許可される組み込みサーバーは 1 つだけです。
      パラメーター:
      port - サーバーがリッスンするポート。
      defaultPartitionSuffix - LDAP サーバーに使用されるデフォルトの基本サフィックス。
      defaultPartitionName - デフォルトの基本サフィックスのディレクトリサーバー構成で使用する名前。
      例外:
      IllegalStateExceptionSE - 組み込みサーバーがすでに開始されている場合。
    • shutdownEmbeddedServer

      public static void shutdownEmbeddedServer() throws ExceptionSE
      組み込みサーバーがある場合は、それをシャットダウンします。この JVM で以前にサーバーが起動されていない場合、これは確認なしで無視されます。
      例外:
      ExceptionSE
    • clearSubContexts

      public static void clearSubContexts(ContextSource contextSource, NameSE name) throws NamingExceptionSE
      指定された識別名で表されるノードから始まるディレクトリサブツリーをクリアします。
      パラメーター:
      contextSource - DirContext を取得するために使用する ContextSource。
      name - ルートノードの識別名。
      例外:
      NamingExceptionSE - 何か問題が発生した場合は、サブツリーを削除します。
    • clearSubContexts

      public static void clearSubContexts(DirContextSE ctx, NameSE name) throws NamingExceptionSE
      指定された識別名で表されるノードから始まるディレクトリサブツリーをクリアします。
      パラメーター:
      ctx - 木の掃除に使う DirContext。
      name - ルートノードの識別名。
      例外:
      NamingExceptionSE - 何か問題が発生した場合は、サブツリーを削除します。
    • loadLdif

      public static void loadLdif(ContextSource contextSource, org.springframework.core.io.Resource ldifFile) throws IOExceptionSE
      Ldif ファイルを LDAP サーバーにロードします。
      パラメーター:
      contextSource - DirContext を取得して LDAP サーバーと対話するために使用する ContextSource。
      ldifFile - 有効な LDIF ファイルを表す Resource。
      例外:
      IOExceptionSE - リソースを読み取れない場合。
    • cleanAndSetup

      public static void cleanAndSetup(ContextSource contextSource, NameSE rootNode, org.springframework.core.io.Resource ldifFile) throws NamingExceptionSE, IOExceptionSE
      例外:
      NamingExceptionSE
      IOExceptionSE
    • loadLdif

      public static void loadLdif(com.unboundid.ldap.listener.InMemoryDirectoryServer directoryServer, org.springframework.core.io.Resource ldifFile) throws IOExceptionSE
      例外:
      IOExceptionSE