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

JUnit tests fail if run independent of maven

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: OpenMRS 1.8.0, OpenMRS 1.9.0
    • Fix Version/s: OpenMRS 1.9.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      I just ran the whole unit test suite for the first time in a long time (which makes me a bad person) and I noticed:

      • Running the "junit" ant task doesn't lead to all tests passing
      • Running in eclipse (Run As -> JUnit Test) they don't all pass either.

      Even after doing a maven install (during which all tests pass) if I immediately do Run As -> JUnit Test, I still get errors. (67 errors, 1 failure)

      Have others had the same experience? Does anyone know what's up?

      A particularly common error I'm seeing is this:
      java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@14a6a42] for key [org.hibernate.impl.SessionFactoryImpl@70c52d] bound to thread [main]
      at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:179)
      at org.openmrs.api.db.hibernate.HibernateContextDAO.openSession(HibernateContextDAO.java:240)

      Another is as follows, and this is in fact true: java.lang.AssertionError: org.openmrs.web.controller.form.FieldFormControllerTest#onSubmit_shouldPurgeField does not have the @Test annotation on it even though the method name starts with 'should'
      Why didn't this send off a CI email?

      -Darius

        Attachments

          Activity

            People

            • Assignee:
              bwolfe Ben Wolfe
              Reporter:
              darius Darius Jazayeri
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: