Search in sources :

Example 6 with MockProvisioning

use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.

the class ParseMailboxIDTest method init.

@BeforeClass
public static void init() throws Exception {
    MailboxTestUtil.initServer();
    LC.zimbra_attrs_directory.setDefault(MailboxTestUtil.getZimbraServerDir("") + "conf/attrs");
    MockProvisioning prov = new MockProvisioning();
    prov.createAccount("test@zimbra.com", "secret", new HashMap<String, Object>());
    Provisioning.setInstance(prov);
}
Also used : MockProvisioning(com.zimbra.cs.account.MockProvisioning) BeforeClass(org.junit.BeforeClass)

Example 7 with MockProvisioning

use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.

the class JMSessionTest method init.

@BeforeClass
public static void init() throws Exception {
    MailboxTestUtil.initServer();
    LC.zimbra_attrs_directory.setDefault(MailboxTestUtil.getZimbraServerDir("") + "conf/attrs");
    MockProvisioning prov = new MockProvisioning();
    prov.getLocalServer().setSmtpPort(25);
    Provisioning.setInstance(prov);
}
Also used : MockProvisioning(com.zimbra.cs.account.MockProvisioning) BeforeClass(org.junit.BeforeClass)

Example 8 with MockProvisioning

use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.

the class NotifyMailtoTest method init.

@BeforeClass
public static void init() throws Exception {
    MailboxTestUtil.initServer();
    MailboxTestUtil.clearData();
    MockProvisioning prov = new MockProvisioning();
    Provisioning.setInstance(prov);
    Map<String, Object> attrs = Maps.newHashMap();
    attrs = Maps.newHashMap();
    prov.createDomain("zimbra.com", attrs);
    attrs = Maps.newHashMap();
    attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString());
    attrs.put(Provisioning.A_zimbraSieveNotifyActionRFCCompliant, "TRUE");
    prov.createAccount("test1@zimbra.com", "secret", attrs);
    attrs = Maps.newHashMap();
    attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString());
    attrs.put(Provisioning.A_zimbraSieveNotifyActionRFCCompliant, "TRUE");
    prov.createAccount("test2@zimbra.com", "secret", attrs);
    attrs = Maps.newHashMap();
    attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString());
    attrs.put(Provisioning.A_zimbraSieveNotifyActionRFCCompliant, "TRUE");
    prov.createAccount("\"tes\\\\t2\"@zimbra.com", "secret", attrs);
    attrs = Maps.newHashMap();
    attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString());
    attrs.put(Provisioning.A_zimbraSieveNotifyActionRFCCompliant, "TRUE");
    prov.createAccount("test3@zimbra.com", "secret", attrs);
    // this MailboxManager does everything except actually send mail
    MailboxManager.setInstance(new DirectInsertionMailboxManager());
}
Also used : MockProvisioning(com.zimbra.cs.account.MockProvisioning) DirectInsertionMailboxManager(com.zimbra.cs.service.mail.SendMsgTest.DirectInsertionMailboxManager) BeforeClass(org.junit.BeforeClass)

Example 9 with MockProvisioning

use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.

the class SpamTest method init.

@BeforeClass
public static void init() throws Exception {
    MailboxTestUtil.initServer();
    MockProvisioning prov = new MockProvisioning();
    Provisioning.setInstance(prov);
    Config config = prov.getConfig();
    config.setSpamWhitelistHeader("X-Whitelist-Flag");
    config.setSpamWhitelistHeaderValue("YES");
}
Also used : Config(com.zimbra.cs.account.Config) MockProvisioning(com.zimbra.cs.account.MockProvisioning) BeforeClass(org.junit.BeforeClass)

Example 10 with MockProvisioning

use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.

the class EscapeSequencesTest method init.

@BeforeClass
public static void init() throws Exception {
    MailboxTestUtil.initServer();
    MailboxTestUtil.clearData();
    MockProvisioning prov = new MockProvisioning();
    Provisioning.setInstance(prov);
    Map<String, Object> attrs = Maps.newHashMap();
    attrs = Maps.newHashMap();
    prov.createDomain("zimbra.com", attrs);
    attrs = Maps.newHashMap();
    attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString());
    attrs.put(Provisioning.A_zimbraSieveNotifyActionRFCCompliant, "TRUE");
    Account account = prov.createAccount("test1@zimbra.com", "secret", attrs);
    attrs = Maps.newHashMap();
    attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString());
    attrs.put(Provisioning.A_zimbraSieveNotifyActionRFCCompliant, "TRUE");
    prov.createAccount("test2@zimbra.com", "secret", attrs);
    attrs = Maps.newHashMap();
    attrs.put(Provisioning.A_zimbraId, UUID.randomUUID().toString());
    attrs.put(Provisioning.A_zimbraSieveNotifyActionRFCCompliant, "TRUE");
    prov.createAccount("test3@zimbra.com", "secret", attrs);
    // this MailboxManager does everything except actually send mail
    MailboxManager.setInstance(new DirectInsertionMailboxManager());
}
Also used : Account(com.zimbra.cs.account.Account) MockProvisioning(com.zimbra.cs.account.MockProvisioning) DirectInsertionMailboxManager(com.zimbra.cs.service.mail.SendMsgTest.DirectInsertionMailboxManager) BeforeClass(org.junit.BeforeClass)

Aggregations

MockProvisioning (com.zimbra.cs.account.MockProvisioning)16 BeforeClass (org.junit.BeforeClass)14 DirectInsertionMailboxManager (com.zimbra.cs.service.mail.SendMsgTest.DirectInsertionMailboxManager)2 Account (com.zimbra.cs.account.Account)1 Config (com.zimbra.cs.account.Config)1 Provisioning (com.zimbra.cs.account.Provisioning)1 HSQLDB (com.zimbra.cs.db.HSQLDB)1 TextEnrichedHandler (com.zimbra.cs.mime.handler.TextEnrichedHandler)1 TextHtmlHandler (com.zimbra.cs.mime.handler.TextHtmlHandler)1 UnknownTypeHandler (com.zimbra.cs.mime.handler.UnknownTypeHandler)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 HashMap (java.util.HashMap)1 Before (org.junit.Before)1