1   /*
2    * Created by IntelliJ IDEA.
3    * User: owen
4    * Date: Nov 25, 2002
5    * Time: 10:45:16 AM
6    * CVS Revision: $Revision: 1.11 $
7    * Last CVS Commit: $Date: 2004/01/06 05:43:19 $
8    * Author of last CVS Commit: $Author: dloeng $
9    * To change this template use Options | File Templates.
10   */
11  package test.mock.mail.server;
12  
13  import alt.javax.mail.Session;
14  import com.atlassian.mail.server.PopMailServer;
15  import com.atlassian.mail.server.managers.AbstractMailServerManager;
16  import com.atlassian.mail.server.MailServer;
17  import com.atlassian.mail.server.SMTPMailServer;
18  import com.atlassian.mail.MailException;
19  
20  import javax.mail.Authenticator;
21  import java.util.List;
22  import java.util.Properties;
23  
24  import test.mock.mail.MockSession;
25  
26  public class MockMailServerManager extends AbstractMailServerManager
27  {
28      private MockSession mockSession = new MockSession();
29      private MailServer server;
30  
31      public MailServer getMailServer(final Long id) throws MailException
32      {
33          return server;
34      }
35  
36      public MailServer getMailServer(final String name) throws MailException
37      {
38          return null;
39      }
40  
41      public List getServerNames() throws MailException
42      {
43          return null;
44      }
45  
46      public List getSmtpMailServers() throws MailException
47      {
48          return null;
49      }
50  
51      public List getPopMailServers() throws MailException
52      {
53          return null;
54      }
55  
56      public Long create(final MailServer mailServer) throws MailException
57      {
58          return null;
59      }
60  
61      public void update(final MailServer mailServer) throws MailException
62      {
63      }
64  
65      public void delete(final Long mailServerId) throws MailException
66      {
67      }
68  
69      public SMTPMailServer getDefaultSMTPMailServer() throws MailException
70      {
71          return new MockSMTPMailServer(null, "default", "", "", "", false, "mail.atlassian.com", "", "");
72      }
73  
74      public PopMailServer getDefaultPopMailServer() throws MailException
75      {
76          return null;
77      }
78  
79  
80      public Session getSession(Properties props, Authenticator auth)
81      {
82          return mockSession.getInstance(props, auth);
83      }
84  }