private void exportRuleTemplate(Element parent, RuleTemplateBo ruleTemplate) { Element templateElement = renderer.renderElement(parent, RULE_TEMPLATE); renderer.renderTextElement(templateElement, NAME, ruleTemplate.getName()); renderer.renderTextElement(templateElement, DESCRIPTION, ruleTemplate.getDescription()); if (ruleTemplate.getDelegationTemplate() != null) { renderer.renderTextElement( templateElement, DELEGATION_TEMPLATE, ruleTemplate.getDelegationTemplate().getName()); } exportAttributes(templateElement, ruleTemplate.getActiveRuleTemplateAttributes()); exportDefaults(templateElement, ruleTemplate); }
private void assertRuleTemplateExport( RuleTemplateBo oldRuleTemplate, RuleTemplateBo newRuleTemplate) { assertFalse( "Ids should be different.", oldRuleTemplate.getId().equals(newRuleTemplate.getId())); assertEquals(oldRuleTemplate.getDescription(), newRuleTemplate.getDescription()); assertEquals(oldRuleTemplate.getName(), newRuleTemplate.getName()); if (oldRuleTemplate.getDelegationTemplate() != null) { assertRuleTemplateExport( oldRuleTemplate.getDelegationTemplate(), newRuleTemplate.getDelegationTemplate()); } else { assertNull(newRuleTemplate.getDelegationTemplate()); } assertAttributes( oldRuleTemplate.getRuleTemplateAttributes(), newRuleTemplate.getRuleTemplateAttributes(), "attribute"); assertAttributes( oldRuleTemplate.getActiveRuleTemplateAttributes(), newRuleTemplate.getActiveRuleTemplateAttributes(), "active attribute"); assertOptions( oldRuleTemplate.getRuleTemplateOptions(), newRuleTemplate.getRuleTemplateOptions()); }