Search in sources :

Example 1 with MockProvisioning

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

the class MimeHandlerManagerTest method init.

@BeforeClass
public static void init() throws Exception {
    MailboxTestUtil.initServer();
    MockProvisioning prov = new MockProvisioning();
    prov.clearMimeHandlers();
    MockMimeTypeInfo mime = new MockMimeTypeInfo();
    mime.setMimeTypes("text/html");
    mime.setFileExtensions("html", "htm");
    mime.setHandlerClass(TextHtmlHandler.class.getName());
    prov.addMimeType("text/html", mime);
    mime = new MockMimeTypeInfo();
    mime.setMimeTypes("text/enriched");
    mime.setFileExtensions("txe");
    mime.setHandlerClass(TextEnrichedHandler.class.getName());
    prov.addMimeType("text/enriched", mime);
    mime = new MockMimeTypeInfo();
    mime.setHandlerClass(UnknownTypeHandler.class.getName());
    prov.addMimeType("all", mime);
    mime = new MockMimeTypeInfo();
    mime.setMimeTypes("not/exist");
    mime.setFileExtensions("NotExist");
    mime.setHandlerClass("com.zimbra.cs.mime.handler.NotExist");
    prov.addMimeType("not/exist", mime);
    Provisioning.setInstance(prov);
}
Also used : UnknownTypeHandler(com.zimbra.cs.mime.handler.UnknownTypeHandler) MockProvisioning(com.zimbra.cs.account.MockProvisioning) TextHtmlHandler(com.zimbra.cs.mime.handler.TextHtmlHandler) TextEnrichedHandler(com.zimbra.cs.mime.handler.TextEnrichedHandler) BeforeClass(org.junit.BeforeClass)

Example 2 with MockProvisioning

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

the class AclPushTest method init.

@BeforeClass
public static void init() throws Exception {
    Provisioning.setInstance(new MockProvisioning());
    LC.zimbra_class_database.setDefault(HSQLDB.class.getName());
    DbPool.startup();
    HSQLDB.createDatabase();
    MailboxTestUtil.initServer();
    Provisioning prov = Provisioning.getInstance();
    HashMap<String, Object> attrs = new HashMap<String, Object>();
    attrs.put(Provisioning.A_zimbraId, "17dd075e-2b47-44e6-8cb8-7fdfa18c1a9f");
    prov.createAccount("owner@zimbra.com", "secret", attrs);
    attrs = new HashMap<String, Object>();
    attrs.put(Provisioning.A_zimbraId, "a4e41fbe-9c3e-4ab5-8b34-c42f17e251cd");
    prov.createAccount("principal@zimbra.com", "secret", attrs);
    ScheduledTaskManager.startup();
}
Also used : HSQLDB(com.zimbra.cs.db.HSQLDB) HashMap(java.util.HashMap) MockProvisioning(com.zimbra.cs.account.MockProvisioning) MockProvisioning(com.zimbra.cs.account.MockProvisioning) Provisioning(com.zimbra.cs.account.Provisioning) BeforeClass(org.junit.BeforeClass)

Example 3 with MockProvisioning

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

the class SizeQueryTest method init.

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

Example 4 with MockProvisioning

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

the class ItemQueryTest method setUp.

@Before
public void setUp() throws Exception {
    System.out.println(testName.getMethodName());
    MockProvisioning prov = new MockProvisioning();
    prov.createAccount("zero@zimbra.com", "secret", new HashMap<String, Object>());
    Provisioning.setInstance(prov);
}
Also used : MockProvisioning(com.zimbra.cs.account.MockProvisioning) Before(org.junit.Before)

Example 5 with MockProvisioning

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

the class ModifyDataSourceTest method init.

@BeforeClass
public static void init() throws Exception {
    MailboxTestUtil.initServer();
    MockProvisioning prov = new MockProvisioning();
    Provisioning.setInstance(prov);
    Map<String, Object> attrs = Maps.newHashMap();
    prov.createDomain("zimbra.com", attrs);
    attrs = Maps.newHashMap();
    prov.createAccount("test@zimbra.com", "secret", attrs);
}
Also used : MockProvisioning(com.zimbra.cs.account.MockProvisioning) 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