use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.
the class MailboxTestUtil method initProvisioning.
/**
* Initializes the provisioning.
*
* @param zimbraServerDir the directory that contains the ZimbraServer project
* @throws Exception
*/
public static void initProvisioning(String zimbraServerDir) throws Exception {
zimbraServerDir = getZimbraServerDir(zimbraServerDir);
System.setProperty("log4j.configuration", "log4j-test.properties");
System.setProperty("zimbra.config", zimbraServerDir + "src/java-test/localconfig-test.xml");
LC.reload();
// substitute test TZ file
String timezonefilePath = zimbraServerDir + "src/java-test/timezones-test.ics";
File d = new File(timezonefilePath);
if (!d.exists()) {
throw new FileNotFoundException("timezones-test.ics not found in " + timezonefilePath);
}
LC.timezone_file.setDefault(timezonefilePath);
LC.zimbra_rights_directory.setDefault(StringUtils.removeEnd(zimbraServerDir, "/") + "-conf" + "/conf/rights");
LC.zimbra_attrs_directory.setDefault(zimbraServerDir + "conf/attrs");
LC.zimbra_tmp_directory.setDefault(zimbraServerDir + "tmp");
// substitute test DS config file
String dsfilePath = zimbraServerDir + "src/java-test/datasource-test.xml";
d = new File(dsfilePath);
if (!d.exists()) {
throw new FileNotFoundException("datasource-test.xml not found in " + dsfilePath);
}
LC.data_source_config.setDefault(dsfilePath);
// default MIME handlers are now set up in MockProvisioning constructor
Provisioning.setInstance(new MockProvisioning());
}
use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.
the class ParsedMessageTest method init.
@BeforeClass
public static void init() {
System.setProperty("log4j.configuration", "log4j-test.properties");
Provisioning.setInstance(new MockProvisioning());
}
use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.
the class DbMailboxTest method init.
@BeforeClass
public static void init() throws Exception {
MailboxTestUtil.initServer();
Provisioning.setInstance(new MockProvisioning());
LC.zimbra_class_database.setDefault(HSQLDB.class.getName());
DbPool.startup();
HSQLDB.createDatabase();
}
use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.
the class LdapLockoutPolicyTest 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);
}
use of com.zimbra.cs.account.MockProvisioning in project zm-mailbox by Zimbra.
the class ModifyFilterRulesTest 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);
}
Aggregations