Package com.agiletec.plugins.jpmail.aps.services.mail.parse

Examples of com.agiletec.plugins.jpmail.aps.services.mail.parse.MailConfigDOM


      ConfigInterface configManager = this.getConfigManager();
      String xml = configManager.getConfigItem(JpmailSystemConstants.MAIL_CONFIG_ITEM);
      if (xml == null) {
        throw new ApsSystemException("Configuration item not present: " + JpmailSystemConstants.MAIL_CONFIG_ITEM);
      }
      MailConfigDOM configDOM = new MailConfigDOM();
      this.setConfig(configDOM.extractConfig(xml));
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "loadConfigs");
      throw new ApsSystemException("Errore in fase di inizializzazione", t);
    }
  }
View Full Code Here


   * @see com.agiletec.plugins.jpmail.aps.services.mail.IMailManager#updateMailConfig(com.agiletec.plugins.jpmail.aps.services.mail.MailConfig)
   */
  @Override
  public void updateMailConfig(MailConfig config) throws ApsSystemException {
    try {
      String xml = new MailConfigDOM().createConfigXml(config);
      this.getConfigManager().updateConfigItem(JpmailSystemConstants.MAIL_CONFIG_ITEM, xml);
      this.setConfig(config);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "updateMailConfig");
      throw new ApsSystemException("Errore in fase di aggiornamento configurazione mail", t);
View Full Code Here

   * Tests the extraction of the configuration from the XML.
   * @throws Throwable
   */
  public void testExtractConfig() throws Throwable {
    String xml = this._configManager.getConfigItem(JpmailSystemConstants.MAIL_CONFIG_ITEM);
    MailConfig mailConfig = new MailConfigDOM().extractConfig(xml);
    this.checkOriginaryConfig(mailConfig);
  }
View Full Code Here

  /**
   * Tests the updating of the configuration.
   * @throws Throwable
   */
  public void testUpdateConfig() throws Throwable {
    MailConfigDOM mailConfigDom = new MailConfigDOM();
    String xml = this._configManager.getConfigItem(JpmailSystemConstants.MAIL_CONFIG_ITEM);
    MailConfig originaryConfig = mailConfigDom.extractConfig(xml);
    try {
      MailConfig config = this.createMailConfig();
      xml = mailConfigDom.createConfigXml(config);
      MailConfig updatedConfig = mailConfigDom.extractConfig(xml);
      this.compareConfigs(config, updatedConfig);
    } catch (Throwable t) {
      throw t;
    } finally {
      xml = mailConfigDom.createConfigXml(originaryConfig);
      MailConfig updatedConfig = mailConfigDom.extractConfig(xml);
      this.compareConfigs(originaryConfig, updatedConfig);
    }
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpmail.aps.services.mail.parse.MailConfigDOM

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.