use of com.sun.appserv.management.config.MailResourceConfig in project Payara by payara.
the class MailResourceConfigTest method ensureDefaultInstance.
/**
* synchronized because multiple instances are created, and we've chosen to remove/add
* this resource multiple times for some specific tests.
*/
public static synchronized MailResourceConfig ensureDefaultInstance(final DomainConfig dc) {
MailResourceConfig result = dc.getResourcesConfig().getMailResourceConfigMap().get(getDefaultInstanceName());
if (result == null) {
result = createInstance(dc, getDefaultInstanceName(), MAIL_RESOURCE_HOST, MAIL_RESOURCE_USER, MAIL_RESOURCE_FROM, OPTIONS);
assert !AttributeResolverHelper.resolveBoolean(result, "Enabled");
final StandaloneServerConfig serverConfig = dc.getServersConfig().getStandaloneServerConfigMap().get("server");
final Map<String, String> options = new HashMap<String, String>();
options.put(ResourceConfigKeys.ENABLED_KEY, "false");
final ResourceRefConfig ref = serverConfig.createResourceRefConfig(result.getName(), options);
assert !AttributeResolverHelper.resolveBoolean(ref, "Enabled");
RefHelper.removeAllRefsTo(result, false);
}
return result;
}
use of com.sun.appserv.management.config.MailResourceConfig in project Payara by payara.
the class ReferencesTest method removeMailResourceConfig.
void removeMailResourceConfig() {
final Map<String, MailResourceConfig> mails = getDomainConfig().getResourcesConfig().getMailResourceConfigMap();
MailResourceConfig mr = mails.get(MAIL_RESOURCE_NAME);
if (mr != null) {
getDomainConfig().getResourcesConfig().removeMailResourceConfig(mr.getName());
}
}
use of com.sun.appserv.management.config.MailResourceConfig in project Payara by payara.
the class ReferencesTest method ensureMailResourceConfig.
MailResourceConfig ensureMailResourceConfig() {
final Map<String, MailResourceConfig> mails = getDomainConfig().getResourcesConfig().getMailResourceConfigMap();
MailResourceConfig mr = mails.get(MAIL_RESOURCE_NAME);
if (mr == null) {
mr = createMailResourceConfig();
}
return mr;
}
Aggregations