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

Create test case for getFormCriteria

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Code Review (Initial)
    • Priority: Should
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      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));
        }
      

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              andu033 Andrei Stanila
              Reporter:
              sherlocktech Sean Stamm
              Designated Committer:
              Ethan Penn [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:

                  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