this.init();
}
public void testReadConfig() throws Throwable {
String xml = this._configManager.getConfigItem("jpwttMailConfig");
WttMailConfig config = new WttMailConfigDOM().extractConfig(xml);
assertEquals(true, config.isUniqueMail());
assertEquals("CODE1", config.getSenderCode());
assertEquals("email", config.getMailAttrName());
assertEquals("Wtt Alert", config.getSubject());
Map<Integer, MailTemplate> templates = config.getTemplates();
assertEquals(6, templates.size());
MailTemplate mailTemplate = templates.get(new Integer(5));
Map<String, String> bodies = mailTemplate.getTemplateBodies();
assertEquals("Op3: Testo della mail admin", bodies.get(MailTemplate.TEMPLATE_TYPE_ADMIN));
assertEquals("Op3: Testo della mail user", bodies.get(MailTemplate.TEMPLATE_TYPE_USER));
assertEquals("Op3: Testo della mail allOperators", bodies.get(MailTemplate.TEMPLATE_TYPE_ALLOPERATORS));
List<String> adminAddresses = config.getCommonAdminAddresses();
assertEquals(2, adminAddresses.size());
List<String> operatorAddresses = config.getCommonOperatorAddresses();
assertEquals(1, operatorAddresses.size());
Map<Integer, List<String>> intervTypesAdminAddresses = config.getIntervTypesAdminAddresses();
assertEquals(1, intervTypesAdminAddresses.size());
adminAddresses = intervTypesAdminAddresses.get(1);
assertEquals(2, adminAddresses.size());
Map<Integer, List<String>> intervTypesOperatorAddresses = config.getIntervTypesOperatorAddresses();
assertEquals(1, intervTypesOperatorAddresses.size());
operatorAddresses = intervTypesOperatorAddresses.get(1);
assertEquals(3, operatorAddresses.size());
}