Search in sources :

Example 1 with AvailableZimlets

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

the class TestAttributeManager method setup.

@Before
public void setup() throws ServiceException {
    am = new AttributeManager();
    Set<AttributeClass> requiredIn = Sets.newHashSet(AttributeClass.account, AttributeClass.alias, AttributeClass.distributionList, AttributeClass.domain, AttributeClass.server, AttributeClass.alwaysOnCluster, AttributeClass.ucService, AttributeClass.cos, AttributeClass.xmppComponent, AttributeClass.group, AttributeClass.groupDynamicUnit, AttributeClass.groupStaticUnit);
    Set<AttributeFlag> flags = Sets.newHashSet(AttributeFlag.accountInfo);
    AttributeInfo ai = new AttributeInfo("zimbraId", 1, null, 0, null, AttributeType.TYPE_ID, null, "", true, null, null, AttributeCardinality.single, requiredIn, null, flags, null, null, null, null, null, "Zimbra Systems Unique ID", null, null, null);
    am.addAttribute(ai);
    requiredIn = null;
    Set<AttributeClass> optionalIn = Sets.newHashSet(AttributeClass.domain, AttributeClass.globalConfig);
    flags = Sets.newHashSet(AttributeFlag.domainInherited);
    List<Version> since = Lists.newArrayList(new Version("5.0.10"));
    ai = new AttributeInfo("zimbraZimletDomainAvailableZimlets", 710, null, 0, new AvailableZimlets(), AttributeType.TYPE_STRING, null, "", false, null, "256", AttributeCardinality.multi, requiredIn, optionalIn, flags, null, null, null, null, null, "List of Zimlets available to this domain.", null, since, null);
    am.addAttribute(ai);
    requiredIn = null;
    optionalIn = null;
    flags = null;
    since = Lists.newArrayList(new Version("8.0.8"), new Version("8.5.1"));
    ai = new AttributeInfo(ATTR_TWO_SINCE, 99996, null, 0, null, AttributeType.TYPE_STRING, null, "", false, null, null, AttributeCardinality.multi, requiredIn, optionalIn, flags, null, null, null, null, null, "test two since", null, since, null);
    am.addAttribute(ai);
    ;
    since = Lists.newArrayList(new Version("9.0.0"), new Version("8.0.8"), new Version("7.2.8"), new Version("8.5.2"));
    //out of order intentionally; attributeinfo class should handle that so we don't have bugs if someone no-brains this
    ai = new AttributeInfo(ATTR_MULTI_SINCE, 99997, null, 0, null, AttributeType.TYPE_STRING, null, "", false, null, null, AttributeCardinality.multi, requiredIn, optionalIn, flags, null, null, null, null, null, "test multi since", null, since, null);
    am.addAttribute(ai);
    ;
    since = Lists.newArrayList(new Version(Version.FUTURE));
    ai = new AttributeInfo(ATTR_FUTURE, 99998, null, 0, null, AttributeType.TYPE_STRING, null, "", false, null, null, AttributeCardinality.single, requiredIn, optionalIn, flags, null, null, null, null, null, "test future", null, since, null);
    am.addAttribute(ai);
}
Also used : Version(com.zimbra.common.util.Version) AvailableZimlets(com.zimbra.cs.account.callback.AvailableZimlets) Before(org.junit.Before)

Aggregations

Version (com.zimbra.common.util.Version)1 AvailableZimlets (com.zimbra.cs.account.callback.AvailableZimlets)1 Before (org.junit.Before)1