org.kuali.rice.kew.xml
Class RuleTemplateXmlParserTest

java.lang.Object
  extended by org.kuali.rice.test.BaseRiceTestCase
      extended by org.kuali.rice.test.RiceTestCase
          extended by org.kuali.rice.test.RiceInternalSuiteDataTestCase
              extended by org.kuali.rice.test.BaseModuleTestCase
                  extended by org.kuali.rice.test.BaselineTestCase
                      extended by org.kuali.rice.kew.test.KEWTestCase
                          extended by org.kuali.rice.kew.xml.RuleTemplateXmlParserTest
All Implemented Interfaces:
MethodAware

public class RuleTemplateXmlParserTest
extends KEWTestCase

This is a Test class to test the rule template xml parser

Author:
Kuali Rice Team (rice.collab@kuali.org)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.kuali.rice.kew.test.KEWTestCase
KEWTestCase.ClearCacheLifecycle
 
Nested classes/interfaces inherited from class org.kuali.rice.test.BaselineTestCase
BaselineTestCase.BaselineMode, BaselineTestCase.Mode
 
Field Summary
 
Fields inherited from class org.kuali.rice.test.BaselineTestCase
dirty
 
Fields inherited from class org.kuali.rice.test.BaseModuleTestCase
moduleName
 
Fields inherited from class org.kuali.rice.test.RiceTestCase
DEFAULT_TEST_HARNESS_SPRING_BEANS, failedSuiteTestName, perTestLifeCycles, SUITE_LIFE_CYCLES_FAILED, SUITE_LIFE_CYCLES_RAN, suiteLifeCycles
 
Fields inherited from class org.kuali.rice.test.BaseRiceTestCase
log, method
 
Constructor Summary
RuleTemplateXmlParserTest()
           
 
Method Summary
protected  void assertDefaultRuleDefaults(RuleTemplate template)
          Asserts that if the defaults element is omitted, the correct template rule defaults are set
protected  void assertDefaultTemplateOptions(RuleTemplate template)
          Asserts that if the defaults element is omitted, the correct RuleTemplateOptions are set (or not set)
protected  void assertNoDefaultsSpecified(RuleTemplate template)
          Asserts that if the defaults element is omitted, the correct defaults are set
protected  void assertOptionPresence(RuleTemplate template, String key, boolean present)
          Asserts that the rule template has a specific rule template option defined (with any value)
protected  void assertOptionValue(RuleTemplate template, String key, String value)
          Asserts that the rule template has a specific rule template option defined with a specific value
protected  void assertRuleDefaultsAreNull(RuleTemplate template)
          Tests that the rule default template options are present and set to null.
protected  void assertRuleDefaultsArePresent(RuleTemplate template, boolean present)
          Tests that the rule default template options are present.
protected  void loadTestData()
           
 void testAttributeActivationAndRemoval()
           
 void testLoadInvalidTemplateWithOverwrite()
          Tests attempting to overwrite a template without the allowOverwrite flag set to true
 void testLoadValidTemplate()
          Loads valid template definitions
 void testLoadValidTemplateFullWithOverwrite()
          Loads a "full" template definition and then updates/overwrites it
 void testLoadValidTemplateWithDescriptionDefault()
          Tests loading a template with the minimal required ruleDefaults
 void testLoadValidTemplateWithFullDefaults()
          Tests loading a template with a full ruleDefaults section
 void testLoadValidTemplateWithOverwrite()
          Loads a "minimal" template definition and then updates/overwrites it
 void testLoadValidTemplateWithSomeDefaults()
          Tests loading a template with a partial ruleDefaults section
 void testLoadValidTemplateWithSomeDefaultsOverwrite()
          Tests loading a template with a partial ruleDefaults section and then updating/overwriting it
 void testLoadValidTemplateWithSomeRemovedDefaults()
          Tests loading a template with a partial ruleDefaults section, and then updating/overwriting it with one with no ruleDefaults section defined at all
 
Methods inherited from class org.kuali.rice.kew.test.KEWTestCase
getGroupIdForName, getLoadApplicationLifecycle, getPerTestLifecycles, getPerTestTablesNotToClear, getPerTestTablesToClear, getPrincipalIdForName, getPrincipalNameForId, getSuiteLifecycles, getTransactionTemplate, loadDefaultTestData, loadPerTestData, loadSuiteTestData, loadXmlFile, loadXmlFile, loadXmlFileFromFileSystem, loadXmlStream, setUpAfterDataLoad
 
Methods inherited from class org.kuali.rice.test.BaselineTestCase
getClearDbPerTestLifecycles, getMode, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles, setUp
 
Methods inherited from class org.kuali.rice.test.BaseModuleTestCase
getModuleName
 
Methods inherited from class org.kuali.rice.test.RiceInternalSuiteDataTestCase
getKIMDataLoadOrderFile, getKIMSqlFileBaseLocation, getKNSDefaultSuiteTestData
 
Methods inherited from class org.kuali.rice.test.RiceTestCase
configureLogging, dumpMemory, getBaseDir, getConfigLocations, getFullTestName, getModuleTestConfigLocation, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setClearTables, setModuleName, setUpInternal, startLifecycles, startSuiteDataLoaderLifecycles, stopLifecycles, tearDown
 
Methods inherited from class org.kuali.rice.test.BaseRiceTestCase
getName, getPerTestDataLoaderLifecycle, resetLogLevels, setLogLevel, setName, setTestMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleTemplateXmlParserTest

public RuleTemplateXmlParserTest()
Method Detail

loadTestData

protected void loadTestData()
                     throws Exception
Overrides:
loadTestData in class KEWTestCase
Throws:
Exception

testLoadValidTemplate

public void testLoadValidTemplate()
                           throws Exception
Loads valid template definitions

Throws:
Exception

testLoadValidTemplateWithOverwrite

public void testLoadValidTemplateWithOverwrite()
                                        throws Exception
Loads a "minimal" template definition and then updates/overwrites it

Throws:
Exception

testLoadValidTemplateFullWithOverwrite

public void testLoadValidTemplateFullWithOverwrite()
                                            throws Exception
Loads a "full" template definition and then updates/overwrites it

Throws:
Exception

testLoadInvalidTemplateWithOverwrite

public void testLoadInvalidTemplateWithOverwrite()
                                          throws Exception
Tests attempting to overwrite a template without the allowOverwrite flag set to true

Throws:
Exception

testLoadValidTemplateWithFullDefaults

public void testLoadValidTemplateWithFullDefaults()
                                           throws Exception
Tests loading a template with a full ruleDefaults section

Throws:
Exception

testLoadValidTemplateWithSomeDefaults

public void testLoadValidTemplateWithSomeDefaults()
                                           throws Exception
Tests loading a template with a partial ruleDefaults section

Throws:
Exception

testLoadValidTemplateWithSomeDefaultsOverwrite

public void testLoadValidTemplateWithSomeDefaultsOverwrite()
                                                    throws Exception
Tests loading a template with a partial ruleDefaults section and then updating/overwriting it

Throws:
Exception

testLoadValidTemplateWithSomeRemovedDefaults

public void testLoadValidTemplateWithSomeRemovedDefaults()
                                                  throws Exception
Tests loading a template with a partial ruleDefaults section, and then updating/overwriting it with one with no ruleDefaults section defined at all

Throws:
Exception

testLoadValidTemplateWithDescriptionDefault

public void testLoadValidTemplateWithDescriptionDefault()
                                                 throws Exception
Tests loading a template with the minimal required ruleDefaults

Throws:
Exception

assertNoDefaultsSpecified

protected void assertNoDefaultsSpecified(RuleTemplate template)
Asserts that if the defaults element is omitted, the correct defaults are set

Parameters:
template - the RuleTemplate to check

assertDefaultTemplateOptions

protected void assertDefaultTemplateOptions(RuleTemplate template)
Asserts that if the defaults element is omitted, the correct RuleTemplateOptions are set (or not set)

Parameters:
template - the RuleTemplate to check

assertDefaultRuleDefaults

protected void assertDefaultRuleDefaults(RuleTemplate template)
Asserts that if the defaults element is omitted, the correct template rule defaults are set

Parameters:
template - the RuleTemplate to check

assertRuleDefaultsArePresent

protected void assertRuleDefaultsArePresent(RuleTemplate template,
                                            boolean present)
Tests that the rule default template options are present. Must be kept in sync with defaults defined in RuleTemplate object

Parameters:
ruleTemplate - the ruleTemplate to check
present - whether the option should be present or not

assertRuleDefaultsAreNull

protected void assertRuleDefaultsAreNull(RuleTemplate template)
Tests that the rule default template options are present and set to null. Must be kept in sync with defaults defined in RuleTemplate object

Parameters:
ruleTemplate - the ruleTemplate to check

assertOptionPresence

protected void assertOptionPresence(RuleTemplate template,
                                    String key,
                                    boolean present)
Asserts that the rule template has a specific rule template option defined (with any value)

Parameters:
template - the rule template
key - the RuleTemplateOption key
present - whether the option should be present

assertOptionValue

protected void assertOptionValue(RuleTemplate template,
                                 String key,
                                 String value)
Asserts that the rule template has a specific rule template option defined with a specific value

Parameters:
template - the rule template
key - the RuleTemplateOption key
value - the RuleTemplateOption value

testAttributeActivationAndRemoval

public void testAttributeActivationAndRemoval()
                                       throws Exception
Throws:
Exception


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.