# Regression test dataset

**URL:** <https://talk.openmrs.org/t/regression-test-dataset/28867>\
**Category:** Development\
**Tags:** unit-tests\
**Created:** [June 7, 2020, 8:55am UTC](https://talk.openmrs.org/t/regression-test-dataset/28867 "2020-06-07T08:55:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 7, 2020, 8:55am UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/1 "2020-06-07T08:55:25Z")

</div>

Hello everyone;

Am having a challenge trying to set up a `RegressionTest-data-openmrs-2.2.xml` data set for testing purposes with the regression test helper in htmlformentry. when i run the unit test i get `org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Referential integrity constraint violation:` [https://pastebin.com/bi3HEZnD](https://pastebin.com/bi3HEZnD) … This violation is from the h2 not understanding the reference made to the `program` table with `program_id ="10"`during the definition of the `patient_program` table yet i have defined the program table with `program_id ="10"` in the [datatset created](https://pastebin.com/tnUxLTbe) ,which is abit strange here …

What could i be missing here ?

@dkayiwa @ibacher @mksd

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 7, 2020, 4:56pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/2 "2020-06-07T16:56:02Z")

</div>

Can you share a draft pull request?

---

<div class="post-metadata">

**Author:** ![reagan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/reagan/32/10652_2.png) [@reagan](https://talk.openmrs.org/u/reagan)\
**Post date:** [June 7, 2020, 5:31pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/3 "2020-06-07T17:31:35Z")

</div>

Checkout [this](https://talk.openmrs.org/t/initialising-a-dataset/27925/6)

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 7, 2020, 5:32pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/4 "2020-06-07T17:32:36Z")

</div>

@dkayiwa this is the pr draft [https://github.com/openmrs/openmrs-module-htmlformentry/pull/167](https://github.com/openmrs/openmrs-module-htmlformentry/pull/167)

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 7, 2020, 5:41pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/5 "2020-06-07T17:41:11Z")

</div>

thanks @reagan ,

i had a look at this earlier on though in this use case the referenced table is defined which should make it existing in the in-memory DB, which i think should deal with the problem but unfortunately not 🙁…

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 7, 2020, 5:46pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/6 "2020-06-07T17:46:14Z")

</div>

The error in your pull request is very different from the one you shared above.

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 7, 2020, 6:08pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/7 "2020-06-07T18:08:16Z")

</div>

@dkayiwa i have corrected the program id instance in `enrollPatientInProgramSimpleFormWithPatientProgramAttributeUuid` from 1 to 10 to match the program in the dataset could this be what your referring to ?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 7, 2020, 6:41pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/8 "2020-06-07T18:41:30Z")

</div>

Travis says it all.

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 7, 2020, 6:50pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/9 "2020-06-07T18:50:28Z")

</div>

Thanks 👍

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 8, 2020, 6:55pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/10 "2020-06-08T18:55:24Z")

</div>

Hello @dkayiwa i solved the problem in the travis failure ,this is my [updated pr](https://github.com/openmrs/openmrs-module-htmlformentry/pull/167) ,however i run into the `Failed to load ApplicationContext` when i run do the maven build yet the test passes in the IDE with junit but fails during compilation .I have added the dependency to `org.openmrs.test` where the `BaseModuleContextSensitiveTest` class is defined.

Requesting for your thoughts on this.

Thanks

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 9, 2020, 6:53pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/11 "2020-06-09T18:53:28Z")

</div>

@gcliff did you get around this?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 9, 2020, 7:15pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/12 "2020-06-09T19:15:54Z")

</div>

@dkayiwa not yet still blocked …

i have been looking through [similar occurrences](https://talk.openmrs.org/search?q=failed%20to%20load%20application) though have yet found some thing to apply in my use case

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 10, 2020, 8:14pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/13 "2020-06-10T20:14:22Z")

</div>

Can you first resolve the merge conflicts in your pull request?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 15, 2020, 2:47pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/14 "2020-06-15T14:47:23Z")

</div>

hello @dkayiwa i resolved the conflicts and fixed the error i was facing .

On running the test on the `EnrollInProgramElement2_2` in `EnrollInProgramElement2_2Test` tag i have come across this [issue](https://pastebin.com/0vgn52aM) which was fixed in [TRUNK-5491](https://issues.openmrs.org/browse/TRUNK-5491) ,however am facing it because the fix was done in `core 2.3` and am working to a sub project that depends on `core 2.2` …

Could it be possible to backport the fix to `core 2.2` ?

> <https://github.com/openmrs/openmrs-module-htmlformentry/pull/167/files>

cc @mksd

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 15, 2020, 7:08pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/15 "2020-06-15T19:08:20Z")

</div>

Have you updated your pull request up to the point where you get [this issue](https://pastebin.com/0vgn52aM)?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 15, 2020, 7:50pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/16 "2020-06-15T19:50:52Z")

</div>

yes @dkayiwa i have updated the pr, the changes that hard caused the merged conflicts where caused by this [pr](https://github.com/openmrs/openmrs-module-htmlformentry/pull/180) of which i had to first rebase

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 17, 2020, 11:13am UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/17 "2020-06-17T11:13:27Z")

</div>

In your test, add this line: `Logger.getLogger(AuditableInterceptor.class).setLevel(Level.INFO);`

Do not forget to add a comment that this is a temporary workaround for [TRUNK-5491](https://issues.openmrs.org/browse/TRUNK-5491)

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 17, 2020, 11:27am UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/18 "2020-06-17T11:27:53Z")

</div>

sure, going to do that ,thanks @dkayiwa 👍

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 18, 2020, 11:42am UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/19 "2020-06-18T11:42:15Z")

</div>

> [@dkayiwa](#):
>
> Logger.getLogger(AuditableInterceptor.class).setLevel(Level.INFO);

hello @dkayiwa i added this line in the test `Logger.getLogger(AuditableInterceptor.class).setLevel(Level.INFO);` however the `getLogger()` method of the logger(`java.util.logging.Logger`) takes in parameter of type string and a refused a class instance parameter ,so i tried this

> ```
> > AuditableInterceptor auditableInterceptor = new AuditableInterceptor();
> > Logger log = Logger.getLogger(auditableInterceptor.toString());
> > log.setLevel(Level.INFO);
> 
> ```

but still got same error.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 18, 2020, 11:52am UTC](https://talk.openmrs.org/t/regression-test-dataset/28867/20 "2020-06-18T11:52:11Z")

</div>

Did you take a look at this? [https://wiki.openmrs.org/display/docs/Java+Conventions#JavaConventions-loggingLogging](https://wiki.openmrs.org/display/docs/Java+Conventions#JavaConventions-loggingLogging)

[Next page](https://talk.openmrs.org/t/regression-test-dataset/28867.md?page=2)
