本文整理汇总了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));
}
示例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()));
}
示例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());
}
示例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));
}
示例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));
}
示例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));
}
示例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"));
}