当前位置: 首页>>代码示例>>Java>>正文


Java ImapHostManagerImpl类代码示例

本文整理汇总了Java中com.icegreen.greenmail.imap.ImapHostManagerImpl的典型用法代码示例。如果您正苦于以下问题:Java ImapHostManagerImpl类的具体用法?Java ImapHostManagerImpl怎么用?Java ImapHostManagerImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ImapHostManagerImpl类属于com.icegreen.greenmail.imap包,在下文中一共展示了ImapHostManagerImpl类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testListUsers

import com.icegreen.greenmail.imap.ImapHostManagerImpl; //导入依赖的package包/类
@Test
public void testListUsers() throws UserException {
    ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore());
    UserManager userManager = new UserManager(imapHostManager);

    assertEquals(0, userManager.listUser().size());

    GreenMailUser u1 = userManager.createUser("[email protected]", "foo", "pwd");

    assertEquals(1, userManager.listUser().size());
    assertTrue(userManager.listUser().contains(u1));

    GreenMailUser u2 = userManager.createUser("[email protected]", "foo2", "pwd");
    assertEquals(2, userManager.listUser().size());
    assertTrue(userManager.listUser().contains(u1));
    assertTrue(userManager.listUser().contains(u2));
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:18,代码来源:UserManagerTest.java

示例2: testFindByEmailAndLogin

import com.icegreen.greenmail.imap.ImapHostManagerImpl; //导入依赖的package包/类
@Test
public void testFindByEmailAndLogin() throws UserException {
    ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore());
    UserManager userManager = new UserManager(imapHostManager);
    GreenMailUser u1 = userManager.createUser("[email protected]", "foo", "pwd");

    assertEquals(u1, userManager.getUserByEmail(u1.getEmail()));
    assertEquals(u1, userManager.getUser(u1.getLogin()));

    GreenMailUser u2 = userManager.createUser("[email protected]", "foo2", "pwd");
    assertEquals(u1, userManager.getUserByEmail(u1.getEmail()));
    assertEquals(u2, userManager.getUserByEmail(u2.getEmail()));
    assertEquals(u1, userManager.getUser(u1.getLogin()));
    assertEquals(u2, userManager.getUser(u2.getLogin()));
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:16,代码来源:UserManagerTest.java

示例3: testCreateAndDeleteUser

import com.icegreen.greenmail.imap.ImapHostManagerImpl; //导入依赖的package包/类
@Test
public void testCreateAndDeleteUser() throws UserException {
    ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore());
    UserManager userManager = new UserManager(imapHostManager);

    assertTrue(userManager.listUser().isEmpty());

    GreenMailUser user = userManager.createUser("[email protected]", "foo", "pwd");
    assertEquals(1, userManager.listUser().size());

    userManager.deleteUser(user);
    assertTrue(userManager.listUser().isEmpty());
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:14,代码来源:UserManagerTest.java

示例4: testNoAuthRequired

import com.icegreen.greenmail.imap.ImapHostManagerImpl; //导入依赖的package包/类
@Test
public void testNoAuthRequired() {
    ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore());
    UserManager userManager = new UserManager(imapHostManager);
    userManager.setAuthRequired(false);

    assertTrue(userManager.listUser().isEmpty());
    assertTrue(userManager.test("[email protected]",null));
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:10,代码来源:UserManagerTest.java

示例5: testNoAuthRequiredWithExistingUser

import com.icegreen.greenmail.imap.ImapHostManagerImpl; //导入依赖的package包/类
@Test
public void testNoAuthRequiredWithExistingUser() throws UserException {
    ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore());
    UserManager userManager = new UserManager(imapHostManager);
    userManager.setAuthRequired(false);

    userManager.createUser("[email protected]","foo",null);
    assertFalse(userManager.listUser().isEmpty());
    assertTrue(userManager.test("foo",null));
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:11,代码来源:UserManagerTest.java

示例6: testAuthRequired

import com.icegreen.greenmail.imap.ImapHostManagerImpl; //导入依赖的package包/类
@Test
public void testAuthRequired() {
    ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore());
    UserManager userManager = new UserManager(imapHostManager);
    userManager.setAuthRequired(true);

    assertTrue(userManager.listUser().isEmpty());
    assertFalse(userManager.test("[email protected]",null));
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:10,代码来源:UserManagerTest.java

示例7: testAuthRequiredWithExistingUser

import com.icegreen.greenmail.imap.ImapHostManagerImpl; //导入依赖的package包/类
@Test
public void testAuthRequiredWithExistingUser() throws UserException {
    ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore());
    UserManager userManager = new UserManager(imapHostManager);
    userManager.setAuthRequired(true);
    userManager.createUser("[email protected]","foo","bar");

    assertFalse(userManager.listUser().isEmpty());
    assertTrue(userManager.test("foo","bar"));
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:11,代码来源:UserManagerTest.java


注:本文中的com.icegreen.greenmail.imap.ImapHostManagerImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。