Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-3686

Write Data Dictionary based doc search unit tests

    Details

    • Type: Task
    • Status: Closed
    • Priority: Critical
    • Resolution: Complete
    • Affects Version/s: 1.0.1, 1.0.1.1
    • Fix Version/s: 1.0.1.1, KFS Release 3.0.1
    • Component/s: Unit Testing
    • Labels:
      None
    • Rice Module:
      KEW

      Description

      For the 1.0.1.1 patch release I would like to have the Data Dictionary Document search unit tested.

      This task will be broken down into two parts.

      Part one will be the generation of the data dictionary test data.
      Part two will be the testing of that data via various doc search tests.

        Attachments

          Issue Links

            Activity

            Hide
            chagstrom Chad Hagstrom added a comment -

            I've committed another minor unit test change, where I've now set the "businessRulesClass" property on the AccountWithDDAttributesDocument to ensure that allowable data is being used in the test documents. As a result, the test documents now populate their headers' doc description fields to prevent validation errors, and the document with the name of " " had to be modified since the name was interpreted as being empty and AccountWithDDAttributesDocument currently requires that field to be nonempty. Thus, verifying the system behavior when " " is specified no longer seems to be a problem, although my other TODO notes still need to be addressed.

            Show
            chagstrom Chad Hagstrom added a comment - I've committed another minor unit test change, where I've now set the "businessRulesClass" property on the AccountWithDDAttributesDocument to ensure that allowable data is being used in the test documents. As a result, the test documents now populate their headers' doc description fields to prevent validation errors, and the document with the name of " " had to be modified since the name was interpreted as being empty and AccountWithDDAttributesDocument currently requires that field to be nonempty. Thus, verifying the system behavior when " " is specified no longer seems to be a problem, although my other TODO notes still need to be addressed.
            Hide
            chagstrom Chad Hagstrom added a comment -

            I'm almost finished with the DD searchable attribute unit tests, but I still have one detail to fix first. Specifically, I've been having difficulty with testing boolean DD searchable attributes because the TypeUtils.isBoolean() sections in the SqlBuilder and JDBC Criteria objects do not appear to be getting used for such fields (which poses problems for my tests involving search expressions other than "Y" and "N", and possibly other than "1" and "0" as well). I believe the problem lies with the fact that Rice currently lacks a SearchableAttributeValue implementation for booleans, since StandardDocumentSearchGenerator.getSearchableAttributeSql uses StandardDocumentSearchGenerator.getSearchableAttributeClass for retrieving the object's class type, which in turn relies on the attribute's SearchableAttributeValue for determining the Class of the datatype. This results in SearchableAttributeStringValue being used for boolean fields (at least for those that store their boolean values in the database as strings, though I believe it could be the same for numeric boolean database columns as well). Should a new boolean-handling SearchableAttributeValue be added to Rice, or should some alternative means be used to identify boolean fields properly? Or is this something that does not need to be addressed?

            Show
            chagstrom Chad Hagstrom added a comment - I'm almost finished with the DD searchable attribute unit tests, but I still have one detail to fix first. Specifically, I've been having difficulty with testing boolean DD searchable attributes because the TypeUtils.isBoolean() sections in the SqlBuilder and JDBC Criteria objects do not appear to be getting used for such fields (which poses problems for my tests involving search expressions other than "Y" and "N", and possibly other than "1" and "0" as well). I believe the problem lies with the fact that Rice currently lacks a SearchableAttributeValue implementation for booleans, since StandardDocumentSearchGenerator.getSearchableAttributeSql uses StandardDocumentSearchGenerator.getSearchableAttributeClass for retrieving the object's class type, which in turn relies on the attribute's SearchableAttributeValue for determining the Class of the datatype. This results in SearchableAttributeStringValue being used for boolean fields (at least for those that store their boolean values in the database as strings, though I believe it could be the same for numeric boolean database columns as well). Should a new boolean-handling SearchableAttributeValue be added to Rice, or should some alternative means be used to identify boolean fields properly? Or is this something that does not need to be addressed?
            Hide
            chagstrom Chad Hagstrom added a comment -

            Discussed the boolean issue with Garey. It was decided that the current boolean-interpreting functionality is sufficient for now, and that the task of adding better support for boolean values should be deferred to a future release. I'll be creating an issue addressing this boolean problem shortly, and I'll also create an issue for applying the remaining database changes to the master DBs.

            However, there is one minor problem remaining. The DataDictionarySearchableAttributeTest class (which extends from KNSTestCase) does not appear to be clearing the saved/routed test documents out of the database when transitioning from test to test. Is there an easy way to configure the test case so that it deletes those test documents before/after each test?

            Show
            chagstrom Chad Hagstrom added a comment - Discussed the boolean issue with Garey. It was decided that the current boolean-interpreting functionality is sufficient for now, and that the task of adding better support for boolean values should be deferred to a future release. I'll be creating an issue addressing this boolean problem shortly, and I'll also create an issue for applying the remaining database changes to the master DBs. However, there is one minor problem remaining. The DataDictionarySearchableAttributeTest class (which extends from KNSTestCase) does not appear to be clearing the saved/routed test documents out of the database when transitioning from test to test. Is there an easy way to configure the test case so that it deletes those test documents before/after each test?
            Hide
            chagstrom Chad Hagstrom added a comment -

            Discussed the unit-testing problem with Garey, and it seems that adding the @TransactionalTest annotation to the unit test class fixed the problem. Thus, the bootstrapping and unit testing portions of this issue are now complete; all that remains is to apply the necessary changes to the master databases, which I will be including in a separate issue shortly. Also, the @Ignore annotation needs to be removed from the DataDictionarySearchableAttributeTest class once the new SQL has been executed.

            Show
            chagstrom Chad Hagstrom added a comment - Discussed the unit-testing problem with Garey, and it seems that adding the @TransactionalTest annotation to the unit test class fixed the problem. Thus, the bootstrapping and unit testing portions of this issue are now complete; all that remains is to apply the necessary changes to the master databases, which I will be including in a separate issue shortly. Also, the @Ignore annotation needs to be removed from the DataDictionarySearchableAttributeTest class once the new SQL has been executed.
            Hide
            chagstrom Chad Hagstrom added a comment -

            Resolving now since the necessary SQL has been applied to the master DBs and the @Ignore annotation has been removed from the associated unit test class.

            Show
            chagstrom Chad Hagstrom added a comment - Resolving now since the necessary SQL has been applied to the master DBs and the @Ignore annotation has been removed from the associated unit test class.

              People

              • Assignee:
                chagstrom Chad Hagstrom
                Reporter:
                gtaylor Garey Taylor
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: