| org.kuali.kfs.context.KualiTestBase org.kuali.core.maintenance.MaintenanceRuleTestBase
All known Subclasses: org.kuali.module.vendor.rules.VendorRuleTest, org.kuali.module.purap.rules.PurapRuleTestBase, org.kuali.module.chart.rules.ChartRuleTestBase,
MaintenanceRuleTestBase | abstract public class MaintenanceRuleTestBase extends KualiTestBase (Code) | | |
Method Summary | |
protected void | assertErrorCount(int expectedErrorCount) This method tests whether the expected number of errors exists in the errorMap. | protected void | assertFieldErrorDoesNotExist(String fieldName, String errorKey) This method tests whether a given combination of fieldName and errorKey does NOT exist in the GlobalVariables.getErrorMap().
The assert will fail if the fieldName & errorKey combination DOES exist. | protected void | assertFieldErrorExistence(String fieldName, String errorKey, boolean expectedResult) This method tests whether the existence check on the error matches what is expected by what is passed into expectedResult. | protected void | assertFieldErrorExists(String fieldName, String errorKey) This method tests whether a given combination of fieldName and errorKey exists in the GlobalVariables.getErrorMap(). | protected void | assertGlobalErrorExists(String errorKey) This method tests whether a given errorKey exists on the document itself (ie, not tied to a specific field). | protected boolean | doesFieldErrorExist(String fieldName, String errorKey) This method tests whether the field error exists and returns the result of this test. | protected MaintenanceDocument | newMaintDoc(PersistableBusinessObject newBo) This method creates a minimal MaintenanceDocument instance, and populates it with the provided businessObject for the
newMaintainable, and null for the oldMaintainable. | protected MaintenanceDocument | newMaintDoc(PersistableBusinessObject oldBo, PersistableBusinessObject newBo) This method creates a minimal MaintenanceDocument instance, and populates it with the provided businessObjects for the
newMaintainable and oldMaintainable. | protected MaintenanceDocumentRule | setupMaintDocRule(PersistableBusinessObject newBo, Class ruleClass) This method creates a new instance of the specified ruleClass, injects the businessObject(s). | protected MaintenanceDocumentRule | setupMaintDocRule(PersistableBusinessObject oldBo, PersistableBusinessObject newBo, Class ruleClass) This method first creates a new MaintenanceDocument with the BusinessObject(s) passed in. | protected MaintenanceDocumentRule | setupMaintDocRule(MaintenanceDocument maintDoc, Class ruleClass) This method creates a new instance of the specified ruleClass, and then injects the maintenanceDocument and associated
business objects. | protected void | showErrorMap() This method is used during debugging to dump the contents of the error map, including the key names. | protected void | testDefaultExistenceCheck(PersistableBusinessObject bo, String fieldName, boolean shouldFail) |
assertErrorCount | protected void assertErrorCount(int expectedErrorCount)(Code) | | This method tests whether the expected number of errors exists in the errorMap. The assert will fail if this expected number
isnt what is returned.
Parameters: expectedErrorCount - - the number of errors expected |
assertFieldErrorDoesNotExist | protected void assertFieldErrorDoesNotExist(String fieldName, String errorKey)(Code) | | This method tests whether a given combination of fieldName and errorKey does NOT exist in the GlobalVariables.getErrorMap().
The assert will fail if the fieldName & errorKey combination DOES exist. NOTE that fieldName should NOT include the prefix
errorPath.
Parameters: fieldName - - fieldName as it would be provided when adding the error Parameters: errorKey - - errorKey as it would be provided when adding the error |
assertFieldErrorExistence | protected void assertFieldErrorExistence(String fieldName, String errorKey, boolean expectedResult)(Code) | | This method tests whether the existence check on the error matches what is expected by what is passed into expectedResult.
This method will fail the assertion if the presence of the error is not what is expected.
Parameters: fieldName - Parameters: errorKey - Parameters: expectedResult - - True if the error is expected, False if it is not. |
assertFieldErrorExists | protected void assertFieldErrorExists(String fieldName, String errorKey)(Code) | | This method tests whether a given combination of fieldName and errorKey exists in the GlobalVariables.getErrorMap(). The
assert will fail if the fieldName & errorKey combination doesnt exist. NOTE that fieldName should NOT include the prefix
errorPath.
Parameters: fieldName - - fieldName as it would be provided when adding the error Parameters: errorKey - - errorKey as it would be provided when adding the error |
assertGlobalErrorExists | protected void assertGlobalErrorExists(String errorKey)(Code) | | This method tests whether a given errorKey exists on the document itself (ie, not tied to a specific field). The assert will
fail if the errorKey already exists on the document.
Parameters: errorKey - - errorKey as it would be provided when adding the error |
doesFieldErrorExist | protected boolean doesFieldErrorExist(String fieldName, String errorKey)(Code) | | This method tests whether the field error exists and returns the result of this test.
Parameters: fieldName - Parameters: errorKey - True if the error exists in the GlobalErrors, false if not. |
newMaintDoc | protected MaintenanceDocument newMaintDoc(PersistableBusinessObject newBo)(Code) | | This method creates a minimal MaintenanceDocument instance, and populates it with the provided businessObject for the
newMaintainable, and null for the oldMaintainable.
Parameters: newSubAccount - - populated subAccount for the newMaintainable a populated MaintenanceDocument instance |
newMaintDoc | protected MaintenanceDocument newMaintDoc(PersistableBusinessObject oldBo, PersistableBusinessObject newBo)(Code) | | This method creates a minimal MaintenanceDocument instance, and populates it with the provided businessObjects for the
newMaintainable and oldMaintainable.
Parameters: oldSubAccount - - populated subAccount for the oldMaintainable Parameters: newSubAccount - - populated subAccount for the newMaintainable a populated MaintenanceDocument instance |
setupMaintDocRule | protected MaintenanceDocumentRule setupMaintDocRule(PersistableBusinessObject newBo, Class ruleClass)(Code) | | This method creates a new instance of the specified ruleClass, injects the businessObject(s). With this method, the
oldMaintainable will be set to null.
Parameters: newBo - - the populated businessObject for the newMaintainble Parameters: ruleClass - - the class of rule to instantiate a populated and ready-to-test rule, of the specified class |
setupMaintDocRule | protected MaintenanceDocumentRule setupMaintDocRule(PersistableBusinessObject oldBo, PersistableBusinessObject newBo, Class ruleClass)(Code) | | This method first creates a new MaintenanceDocument with the BusinessObject(s) passed in. Note that the maintDoc is created
and destroyed internally, and is never returned. This method then creates a new instance of the specified ruleClass, injects
the businessObject(s).
Parameters: oldBo - - the populated businessObject for the oldMaintainable Parameters: newBo - - the populated businessObject for the newMaintainable Parameters: ruleClass - - the class of rule to instantiate a populated and ready-to-test rule, of the specified class |
setupMaintDocRule | protected MaintenanceDocumentRule setupMaintDocRule(MaintenanceDocument maintDoc, Class ruleClass)(Code) | | This method creates a new instance of the specified ruleClass, and then injects the maintenanceDocument and associated
business objects.
Parameters: maintDoc - - the populated MaintenanceDocument instance Parameters: ruleClass - - the class of rule to instantiate a populated and ready-to-test rule, of the specified class |
showErrorMap | protected void showErrorMap()(Code) | | This method is used during debugging to dump the contents of the error map, including the key names. It is not used by the
application in normal circumstances at all.
|
|
|