本文整理汇总了Java中org.springframework.ldap.test.LdapTestUtils.shutdownEmbeddedServer方法的典型用法代码示例。如果您正苦于以下问题:Java LdapTestUtils.shutdownEmbeddedServer方法的具体用法?Java LdapTestUtils.shutdownEmbeddedServer怎么用?Java LdapTestUtils.shutdownEmbeddedServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.ldap.test.LdapTestUtils
的用法示例。
在下文中一共展示了LdapTestUtils.shutdownEmbeddedServer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tearDown
import org.springframework.ldap.test.LdapTestUtils; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
LdapTestUtils.shutdownEmbeddedServer();
contextSource=null;
converterManager=null;
}
示例2: verifyThatInvalidConnectionIsAutomaticallyPurged
import org.springframework.ldap.test.LdapTestUtils; //导入方法依赖的package包/类
/**
* This method depends on a DirObjectFactory (
* {@link org.springframework.ldap.core.support.DefaultDirObjectFactory})
* being set in the ContextSource.
*/
@Test
public void verifyThatInvalidConnectionIsAutomaticallyPurged() throws Exception {
LdapTestUtils.startEmbeddedServer(1888, "dc=261consulting,dc=com", "jayway");
LdapTestUtils.cleanAndSetup(contextSource, LdapUtils.emptyLdapName(), new ClassPathResource("/setup_data.ldif"));
DirContextOperations result = tested.lookupContext("cn=Some Person2, ou=company1,ou=Sweden");
assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person2");
assertThat(result.getStringAttribute("sn")).isEqualTo("Person2");
assertThat(result.getStringAttribute("description")).isEqualTo("Sweden, Company1, Some Person2");
// Shutdown server and kill all existing connections
LdapTestUtils.shutdownEmbeddedServer();
LdapTestUtils.startEmbeddedServer(1888, "dc=261consulting,dc=com", "jayway");
try {
tested.lookup("cn=Some Person2, ou=company1,ou=Sweden");
fail("Exception expected");
} catch (Exception expected) {
// This should fail because the target connection was closed
assertThat(true).isTrue();
}
LdapTestUtils.cleanAndSetup(contextSource, LdapUtils.emptyLdapName(), new ClassPathResource("/setup_data.ldif"));
// But this should be OK, because the dirty connection should have been automatically purged.
tested.lookup("cn=Some Person2, ou=company1,ou=Sweden");
}
示例3: tearDownClass
import org.springframework.ldap.test.LdapTestUtils; //导入方法依赖的package包/类
@AfterClass
public static void tearDownClass() throws Exception
{
LdapTestUtils.shutdownEmbeddedServer();
}
示例4: tearDownClass
import org.springframework.ldap.test.LdapTestUtils; //导入方法依赖的package包/类
@AfterClass
public static void tearDownClass() throws Exception {
LdapTestUtils.shutdownEmbeddedServer();
}
示例5: tearDownClass
import org.springframework.ldap.test.LdapTestUtils; //导入方法依赖的package包/类
@AfterClass
public static void tearDownClass() throws Exception {
// Stop the in process LDAP server
LdapTestUtils.shutdownEmbeddedServer();
}
示例6: cleanup
import org.springframework.ldap.test.LdapTestUtils; //导入方法依赖的package包/类
@After
public void cleanup() throws Exception {
LdapTestUtils.shutdownEmbeddedServer();
}