| MailFactory | Line # 16 | 8 | 6 | 81.2% |
0.8125
|
| (5) | |||
| Result | |||
|
0.8125
|
test.atlassian.mail.TestMailFactory.testFactory
test.atlassian.mail.TestMailFactory.testFactory
|
1 PASS | |
|
0.375
|
test.atlassian.mail.server.TestSMTPMailServer.testGetSessionWithUser
test.atlassian.mail.server.TestSMTPMailServer.testGetSessionWithUser
|
1 PASS | |
|
0.375
|
test.atlassian.mail.server.TestSMTPMailServer.testSendFail
test.atlassian.mail.server.TestSMTPMailServer.testSendFail
|
1 PASS | |
|
0.125
|
test.atlassian.mail.server.TestSMTPMailServer.testSend
test.atlassian.mail.server.TestSMTPMailServer.testSend
|
1 PASS | |
|
0.125
|
test.atlassian.mail.server.TestSMTPMailServer.testSendWithAttachment
test.atlassian.mail.server.TestSMTPMailServer.testSendWithAttachment
|
1 PASS | |
| 1 | /** | |
| 2 | * Created by IntelliJ IDEA. | |
| 3 | * User: Edwin | |
| 4 | * Date: Dec 5, 2002 | |
| 5 | * Time: 2:50:38 PM | |
| 6 | * To change this template use Options | File Templates. | |
| 7 | */ | |
| 8 | package com.atlassian.mail; | |
| 9 | ||
| 10 | import com.atlassian.mail.config.ConfigLoader; | |
| 11 | import com.atlassian.mail.server.MailServerManager; | |
| 12 | import com.atlassian.mail.server.SMTPMailServer; | |
| 13 | ||
| 14 | import javax.mail.Multipart; | |
| 15 | ||
| 16 | public class MailFactory | |
| 17 | { | |
| 18 | public static final String MAIL_DISABLED_KEY = "atlassian.mail.senddisabled"; | |
| 19 | ||
| 20 | private static MailServerManager serverManager; | |
| 21 | ||
| 22 | 1 |
public static void refresh() |
| 23 | { | |
| 24 | 1 | serverManager = null; |
| 25 | } | |
| 26 | ||
| 27 | 5 |
public static MailServerManager getServerManager() |
| 28 | { | |
| 29 | 5 | if (serverManager == null) |
| 30 | { | |
| 31 | 1 | synchronized (MailFactory.class) |
| 32 | { | |
| 33 | 1 | if (serverManager == null) |
| 34 | { | |
| 35 | 1 | serverManager = ConfigLoader.getServerManager(); |
| 36 | } | |
| 37 | } | |
| 38 | } | |
| 39 | ||
| 40 | 5 | return serverManager; |
| 41 | } | |
| 42 | ||
| 43 | 5 |
public static void setServerManager(MailServerManager serverManager) |
| 44 | { | |
| 45 | 5 | MailFactory.serverManager = serverManager; |
| 46 | } | |
| 47 | ||
| 48 | 0 |
public static boolean isSendingDisabled() |
| 49 | { | |
| 50 | 0 | return Boolean.getBoolean(MAIL_DISABLED_KEY); |
| 51 | } | |
| 52 | } | |
|
||||||||||