1 19 20 package org.apache.james.experimental.imapserver; 21 22 import org.apache.james.imapserver.codec.encode.main.DefaultImapEncoderFactory; 23 import org.apache.james.imapserver.mock.MailboxManagerProviderSingleton; 24 import org.apache.james.imapserver.processor.main.DefaultImapProcessorFactory; 25 import org.apache.james.test.functional.imap.HostSystem; 26 27 public class HostSystemFactory { 28 29 public static HostSystem createStandardImap() throws Exception { 30 31 ExperimentalHostSystem result = new ExperimentalHostSystem(); 32 final DefaultImapProcessorFactory defaultImapProcessorFactory = new DefaultImapProcessorFactory(); 33 defaultImapProcessorFactory.configure(result, MailboxManagerProviderSingleton.getMailboxManagerProviderInstance()); 34 result.configure(new DefaultImapDecoderFactory().buildImapDecoder(), 35 new DefaultImapEncoderFactory().buildImapEncoder(), 36 defaultImapProcessorFactory.buildImapProcessor(), new ExperimentalHostSystem.Resetable() { 37 38 public void reset() throws Exception { 39 MailboxManagerProviderSingleton.getMailboxManagerProviderInstance().deleteEverything(); 40 } 41 42 }); 43 return result; 44 } 45 } 46 | Popular Tags |