1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
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 |
|
|
|
|
| 83.3% |
Uncovered Elements: 4 (24) |
Complexity: 11 |
Complexity Density: 0.92 |
|
27 |
|
public class MockSMTPMailServer extends SMTPMailServerImpl |
28 |
|
{ |
29 |
|
Session mockSession; |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
31 |
31
|
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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
36 |
6
|
public void send(Email email) throws MailException... |
37 |
|
{ |
38 |
6
|
super.send(email); |
39 |
|
} |
40 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
0
|
public InternetAddress[] parseAddresses(String addresses) throws AddressException... |
42 |
|
{ |
43 |
0
|
return MailUtils.parseAddresses(addresses); |
44 |
|
} |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
11
|
public String getDefaultFrom()... |
47 |
|
{ |
48 |
11
|
return super.getDefaultFrom(); |
49 |
|
} |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
32
|
public void setDefaultFrom(String from)... |
52 |
|
{ |
53 |
32
|
super.setDefaultFrom(from); |
54 |
|
} |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
5
|
public String getPrefix()... |
57 |
|
{ |
58 |
5
|
return super.getPrefix(); |
59 |
|
} |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
32
|
public void setPrefix(String prefix)... |
62 |
|
{ |
63 |
32
|
super.setPrefix(prefix); |
64 |
|
} |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
32
|
public void setSessionServer(boolean sessionServer)... |
67 |
|
{ |
68 |
32
|
super.setSessionServer(sessionServer); |
69 |
|
} |
70 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
0
|
protected Authenticator getAuthenticator()... |
72 |
|
{ |
73 |
0
|
return new MockAuthenticator(getUsername(), getPassword()); |
74 |
|
} |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
76 |
12
|
public Session getSession() throws NamingException, MailException... |
77 |
|
{ |
78 |
12
|
if (mockSession == null) |
79 |
7
|
mockSession = new MockSession(); |
80 |
12
|
return mockSession; |
81 |
|
} |
82 |
|
} |