1 19 20 package org.apache.james.imapserver.handler.session; 21 22 import java.io.IOException ; 23 24 import javax.mail.MessagingException ; 25 import javax.mail.internet.MimeMessage ; 26 27 import org.apache.james.imapserver.ProtocolException; 28 import org.apache.james.imapserver.client.CreateClientCommand; 29 import org.apache.james.imapserver.client.LoginCommand; 30 import org.apache.james.imapserver.client.LogoutClientCommand; 31 import org.apache.james.imapserver.client.SelectCommand; 32 import org.apache.james.imapserver.store.MailboxException; 33 import org.apache.james.mailboxmanager.MailboxManagerException; 34 35 public class CreateSessionTest extends AbstractSessionTest { 36 37 String [] folders = {USER_MAILBOX_ROOT+".INBOX",USER_MAILBOX_ROOT+".test",USER_MAILBOX_ROOT+".test1",USER_MAILBOX_ROOT+".test1.test1a",USER_MAILBOX_ROOT+".test1.test1b",USER_MAILBOX_ROOT+".test2.test2a",USER_MAILBOX_ROOT+".test2.test2b"}; 38 39 public void setUp() throws MailboxException, MessagingException , IOException , MailboxManagerException { 40 super.setUp(); 41 createFolders(folders); 42 } 43 44 public void testCreateSelect() throws ProtocolException, IOException , MessagingException , MailboxManagerException { 45 verifyCommand(new LoginCommand(USER_NAME,USER_PASSWORD)); 46 47 verifyCommand(new CreateClientCommand("Drafts")); 48 assertTrue(folderExists(USER_MAILBOX_ROOT+".Drafts")); 49 50 verifyCommand(new SelectCommand("Drafts", new MimeMessage [0],getUidValidity(USER_MAILBOX_ROOT+".Drafts"))); 51 52 verifyCommand(new LogoutClientCommand()); 53 } 54 55 } 56 | Popular Tags |