use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method globalConfig.
@Test
public void globalConfig() throws Exception {
String filter = LegacyLdapFilter.globalConfig();
ZLdapFilter zLdapFilter = filterDactory.globalConfig();
verify(FilterId.GLOBAL_CONFIG, filter, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method allZimlets.
@Test
public void allZimlets() throws Exception {
String filter = LegacyLdapFilter.allZimlets();
ZLdapFilter zLdapFilter = filterDactory.allZimlets();
verify(FilterId.ALL_ZIMLETS, filter, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method CMBSearchNonSystemResourceAccountsOnly.
@Test
public void CMBSearchNonSystemResourceAccountsOnly() throws Exception {
/*
orig filter before refactoring
String legacyFilter =
"(&(&(!(zimbraIsSystemResource=*))(|(!(zimbraExcludeFromCMBSearch=*))(zimbraExcludeFromCMBSearch=FALSE)))(&(objectClass=zimbraAccount)(!(objectClass=zimbraCalendarResource))))";
*/
String legacyFilter = "(&(&(objectClass=zimbraAccount)(!(objectClass=zimbraCalendarResource)))(&(!(zimbraIsSystemResource=*))(|(!(zimbraExcludeFromCMBSearch=*))(zimbraExcludeFromCMBSearch=FALSE))))";
String filter = LegacyLdapFilter.CMBSearchNonSystemResourceAccountsOnly();
assertEquals(legacyFilter, filter);
ZLdapFilter zLdapFilter = filterDactory.CMBSearchNonSystemResourceAccountsOnly();
String zFilter = zLdapFilter.toFilterString();
// This assertion fails because we optimized it in the new code
// it is now:
// (&(&(objectClass=zimbraAccount)(!(objectClass=zimbraCalendarResource)))(!(zimbraIsSystemResource=TRUE))(|(!(zimbraExcludeFromCMBSearch=*))(zimbraExcludeFromCMBSearch=FALSE)))
// System.out.println(zLdapFilter.toFilterString());
// assertEquals(filter, zFilter);
// assertEquals(legacyFilter, zFilter);
verifyStatString(FilterId.CMB_SEARCH_NON_SYSTEM_RESOURCE_ACCOUNTS_ONLY, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method domainByName.
@Test
public void domainByName() throws Exception {
String NAME = getTestName();
String filter = LegacyLdapFilter.domainByName(NAME);
ZLdapFilter zLdapFilter = filterDactory.domainByName(NAME);
verify(FilterId.DOMAIN_BY_NAME, filter, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method distributionListsByMemberAddrs.
@Test
public void distributionListsByMemberAddrs() throws Exception {
String[] MEMBER_ADDRS = new String[] { "addr1@test.com", "addr2@test.com", "addr3@test.com" };
String filter = LegacyLdapFilter.distributionListsByMemberAddrs(MEMBER_ADDRS);
ZLdapFilter zLdapFilter = filterDactory.distributionListsByMemberAddrs(MEMBER_ADDRS);
verify(FilterId.DISTRIBUTION_LISTS_BY_MEMBER_ADDRS, filter, zLdapFilter);
}
Aggregations