public void testSetNotifierConfig() throws Throwable { WorkflowNotifierDOM configDOM = new WorkflowNotifierDOM(); NotifierConfig newConfig = this.prepareNotifierConfig(); String xml = configDOM.createConfigXml(newConfig); NotifierConfig extractedConfig = configDOM.extractConfig(xml); this.compareNotifiers(newConfig, extractedConfig); }
public void testExtractConfig() throws Throwable { WorkflowNotifierDOM configDOM = new WorkflowNotifierDOM(); String xml = this._configManager.getConfigItem( JpcontentworkflowSystemConstants.WORKFLOW_NOTIFIER_CONFIG_ITEM); NotifierConfig notifierConfig = configDOM.extractConfig(xml); assertFalse(notifierConfig.isActive()); assertEquals(24, notifierConfig.getHoursDelay()); assertTrue(notifierConfig.getStartScheduler().getTime() < (new Date()).getTime()); assertEquals("CODE1", notifierConfig.getSenderCode()); // assertEquals("email", notifierConfig.getMailAttrName()); assertFalse(notifierConfig.isHtml()); assertEquals("[My Own Portal]: A content changed", notifierConfig.getSubject()); assertEquals( "Hi {user},<br />these contents require your attention<br /><br />", notifierConfig.getHeader()); assertEquals( "<br />Content {type} - {descr} - Status {status}<br />", notifierConfig.getTemplate()); assertEquals("<br />End (footer)", notifierConfig.getFooter()); }