クラス LdapTestUtils
java.lang.ObjectSE
org.springframework.ldap.test.unboundid.LdapTestUtils
統合テストの目的で使用するインプロセス Apache Directory サーバーを起動、停止、設定するためのユーティリティ。
メソッドのサマリー
修飾子と型メソッド説明static voidcleanAndSetup(ContextSource contextSource, NameSE rootNode, org.springframework.core.io.Resource ldifFile) static voidclearSubContexts(DirContextSE ctx, NameSE name) 指定された識別名で表されるノードから始まるディレクトリサブツリーをクリアします。static voidclearSubContexts(ContextSource contextSource, NameSE name) 指定された識別名で表されるノードから始まるディレクトリサブツリーをクリアします。static voidloadLdif(com.unboundid.ldap.listener.InMemoryDirectoryServer directoryServer, org.springframework.core.io.Resource ldifFile) static voidloadLdif(ContextSource contextSource, org.springframework.core.io.Resource ldifFile) Ldif ファイルを LDAP サーバーにロードします。static void組み込みサーバーがある場合は、それをシャットダウンします。static voidstartEmbeddedServer(int port, StringSE defaultPartitionSuffix, StringSE defaultPartitionName) 組み込み Apache Directory サーバーを起動します。
メソッドの詳細
startEmbeddedServer
public static void startEmbeddedServer(int port, StringSE defaultPartitionSuffix, StringSE defaultPartitionName) 組み込み Apache Directory サーバーを起動します。同じ JVM で許可される組み込みサーバーは 1 つだけです。- パラメーター:
port- サーバーがリッスンするポート。defaultPartitionSuffix- LDAP サーバーに使用されるデフォルトの基本サフィックス。defaultPartitionName- デフォルトの基本サフィックスのディレクトリサーバー構成で使用する名前。- 例外:
IllegalStateExceptionSE- 組み込みサーバーがすでに開始されている場合。
shutdownEmbeddedServer
組み込みサーバーがある場合は、それをシャットダウンします。この JVM で以前にサーバーが起動されていない場合、これは確認なしで無視されます。- 例外:
ExceptionSE
clearSubContexts
public static void clearSubContexts(ContextSource contextSource, NameSE name) throws NamingExceptionSE 指定された識別名で表されるノードから始まるディレクトリサブツリーをクリアします。- パラメーター:
contextSource- DirContext を取得するために使用する ContextSource。name- ルートノードの識別名。- 例外:
NamingExceptionSE- 何か問題が発生した場合は、サブツリーを削除します。
clearSubContexts
指定された識別名で表されるノードから始まるディレクトリサブツリーをクリアします。- パラメーター:
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 loadLdif
public static void loadLdif(com.unboundid.ldap.listener.InMemoryDirectoryServer directoryServer, org.springframework.core.io.Resource ldifFile) throws IOExceptionSE