use of com.zimbra.cs.account.DataSource in project zm-mailbox by Zimbra.
the class TestAccess method ModifyDataSource.
public void ModifyDataSource(Role role, Perm perm) throws Exception {
String dateSourceName = "datasource-modify-" + random();
DataSource ds = mProvAdmin.setup_createDataSource(this, role, perm, ACCT_1_EMAIL, dateSourceName);
XMLElement req = new XMLElement(MailConstants.MODIFY_DATA_SOURCE_REQUEST);
Element dataSource = req.addElement(MailConstants.E_DS_POP3);
dataSource.addAttribute(MailConstants.A_ID, ds.getId());
dataSource.addAttribute(MailConstants.A_DS_IS_ENABLED, "false");
accessTest(role, perm, req);
}
use of com.zimbra.cs.account.DataSource in project zm-mailbox by Zimbra.
the class TestLdapProvRenameDomain method createDataSources.
private void createDataSources(Account acct, String[] sigIds) throws Exception {
for (int i = 0; i < NUM_DATASOURCES; i++) {
Map<String, Object> attrs = new HashMap<String, Object>();
attrs.put(Provisioning.A_zimbraDataSourceEnabled, "TRUE");
attrs.put(Provisioning.A_zimbraDataSourceConnectionType, "ssl");
attrs.put(Provisioning.A_zimbraDataSourceFolderId, "inbox");
attrs.put(Provisioning.A_zimbraDataSourceHost, "pop.google.com");
attrs.put(Provisioning.A_zimbraDataSourceLeaveOnServer, "TRUE");
attrs.put(Provisioning.A_zimbraDataSourcePassword, PASSWORD);
attrs.put(Provisioning.A_zimbraDataSourcePort, "9999");
attrs.put(Provisioning.A_zimbraDataSourceUsername, "mickymouse");
attrs.put(Provisioning.A_zimbraDataSourceEmailAddress, "micky@google.com");
// just some random id, not used anywhere
attrs.put(Provisioning.A_zimbraPrefDefaultSignatureId, LdapUtil.generateUUID());
attrs.put(Provisioning.A_zimbraPrefFromDisplay, "Micky Mouse");
attrs.put(Provisioning.A_zimbraPrefReplyToAddress, "goofy@yahoo.com");
attrs.put(Provisioning.A_zimbraPrefReplyToDisplay, "Micky");
if (i < NUM_SIGNATURES)
attrs.put(Provisioning.A_zimbraPrefDefaultSignatureId, sigIds[i]);
DataSource entry = prov.createDataSource(acct, DataSourceType.pop3, DATASOURCE_NAME(acct, i), attrs);
}
}
use of com.zimbra.cs.account.DataSource in project zm-mailbox by Zimbra.
the class TestLdapProvDataSource method createDataSourceAlreadyExists.
@Test
public void createDataSourceAlreadyExists() throws Exception {
String ACCT_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart());
String DATA_SOURCE_NAME = Names.makeDataSourceName(genDataSourceName());
Account acct = createAccount(ACCT_NAME_LOCALPART);
DataSource dataSource = createDataSource(acct, DATA_SOURCE_NAME);
boolean caughtException = false;
try {
createDataSourceRaw(acct, DATA_SOURCE_NAME);
} catch (AccountServiceException e) {
if (AccountServiceException.DATA_SOURCE_EXISTS.equals(e.getCode())) {
caughtException = true;
}
}
assertTrue(caughtException);
deleteDataSource(acct, dataSource);
deleteAccount(acct);
}
use of com.zimbra.cs.account.DataSource in project zm-mailbox by Zimbra.
the class TestLdapProvDataSource method createDataSource.
@Test
public void createDataSource() throws Exception {
String ACCT_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart());
String DATA_SOURCE_NAME = Names.makeDataSourceName(genDataSourceName());
Account acct = createAccount(ACCT_NAME_LOCALPART);
DataSource dataSource = createDataSource(acct, DATA_SOURCE_NAME);
assertEquals(acct.getId(), dataSource.getAccount().getId());
deleteDataSource(acct, dataSource);
deleteAccount(acct);
}
use of com.zimbra.cs.account.DataSource in project zm-mailbox by Zimbra.
the class TestLdapProvAccount method createDataSource.
private DataSource createDataSource(Account acct, String dataSourceName) throws Exception {
Map<String, Object> attrs = new HashMap<String, Object>();
attrs.put(Provisioning.A_zimbraDataSourceEnabled, LdapConstants.LDAP_TRUE);
attrs.put(Provisioning.A_zimbraDataSourceFolderId, "123");
attrs.put(Provisioning.A_zimbraDataSourceConnectionType, "ssl");
attrs.put(Provisioning.A_zimbraDataSourceHost, "zimbra.com");
attrs.put(Provisioning.A_zimbraDataSourcePort, "9999");
DataSource ds = prov.createDataSource(acct, DataSourceType.pop3, dataSourceName, attrs);
return ds;
}
Aggregations