Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5307

Create test case for getFormCriteria

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Won't Fix
    • None
    • None
    • None
    • Low

    Description

      From TODO in HibernateFormDAO.java in org.openmrs.api.db.hibernate on line 455:

      Create a corresponding test to test the method getFormCriteria. The test is should be created in test.java.org.openmrs.api.db.hibernate.HibernateFormDAOTest.java which seems not to exist so it has to be created.  

        // TODO junit test
        if (!containingAnyFormField.isEmpty()) {
         // Convert form field persistents to integers
         Set<Integer> anyFormFieldIds = new HashSet<>();
         for (FormField ff : containingAnyFormField) {
          anyFormFieldIds.add(ff.getFormFieldId());
         }
         
         DetachedCriteria subquery = DetachedCriteria.forClass(FormField.class, "ff");
         subquery.setProjection(Projections.property("ff.form.formId"));
         subquery.add(Restrictions.in("ff.formFieldId", anyFormFieldIds));
         crit.add(Subqueries.propertyIn("form.formId", subquery));
        }
      

       

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                andu033 Andrei Stanila
                sherlocktech Sean Stamm
                Ethan Penn Ethan Penn
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - 1 week
                    1w
                    Remaining:
                    Time Spent - 4 days, 4 hours Remaining Estimate - 4 hours
                    4h
                    Logged:
                    Time Spent - 4 days, 4 hours Remaining Estimate - 4 hours
                    4d 4h