Clover Coverage Report - Atlassian Mail
Coverage timestamp: Mon Sep 29 2008 21:26:36 CDT
12   82   11   1.2
2   58   0.92   10
10     1.1  
1    
 
 
  MockSMTPMailServer       Line # 27 12 11 83.3% 0.8333333
 
  (20)
 
1    /*
2    * Created by IntelliJ IDEA.
3    * User: owen
4    * Date: Nov 25, 2002
5    * Time: 9:23:34 AM
6    * CVS Revision: $Revision: 1.7 $
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 com.atlassian.mail.MailException;
14    import com.atlassian.mail.MailUtils;
15    import com.atlassian.mail.Email;
16    import com.atlassian.mail.server.impl.SMTPMailServerImpl;
17    import test.mock.mail.MockAuthenticator;
18    import test.mock.mail.MockSession;
19   
20    import javax.mail.Authenticator;
21    import javax.mail.internet.AddressException;
22    import javax.mail.internet.InternetAddress;
23    import javax.naming.NamingException;
24   
25    import alt.javax.mail.Session;
26   
 
27    public class MockSMTPMailServer extends SMTPMailServerImpl
28    {
29    Session mockSession;
30   
 
31  31 toggle public MockSMTPMailServer(Long id, String name, String description, String from, String prefix, boolean isSession, String location, String username, String password)
32    {
33  31 super(id, name, description, from, prefix, isSession, location, username, password);
34    }
35   
 
36  6 toggle public void send(Email email) throws MailException
37    {
38  6 super.send(email);
39    }
40   
 
41  0 toggle public InternetAddress[] parseAddresses(String addresses) throws AddressException
42    {
43  0 return MailUtils.parseAddresses(addresses);
44    }
45   
 
46  11 toggle public String getDefaultFrom()
47    {
48  11 return super.getDefaultFrom();
49    }
50   
 
51  32 toggle public void setDefaultFrom(String from)
52    {
53  32 super.setDefaultFrom(from);
54    }
55   
 
56  5 toggle public String getPrefix()
57    {
58  5 return super.getPrefix();
59    }
60   
 
61  32 toggle public void setPrefix(String prefix)
62    {
63  32 super.setPrefix(prefix);
64    }
65   
 
66  32 toggle public void setSessionServer(boolean sessionServer)
67    {
68  32 super.setSessionServer(sessionServer);
69    }
70   
 
71  0 toggle protected Authenticator getAuthenticator()
72    {
73  0 return new MockAuthenticator(getUsername(), getPassword());
74    }
75   
 
76  12 toggle public Session getSession() throws NamingException, MailException
77    {
78  12 if (mockSession == null)
79  7 mockSession = new MockSession();
80  12 return mockSession;
81    }
82    }