# \#unit-tests

**URL:** https://talk.openmrs.org/tag/unit-tests/268.md

[Latest](https://talk.openmrs.org/latest.md) · [Categories](https://talk.openmrs.org/categories.md) · [Tags](https://talk.openmrs.org/tags.md)

---

## [org.dbunit.DatabaseUnitRuntimeException: org.dbunit.dataset.NoSuchColumnException: OBS.STATUS - (Non-uppercase input column: status) in ColumnNameToIndexes cache map.](https://talk.openmrs.org/t/org-dbunit-databaseunitruntimeexception-org-dbunit-dataset-nosuchcolumnexception-obs-status-non-uppercase-input-column-status-in-columnnametoindexes-cache-map/48153)

<div class="topic-metadata">

**Author:** [@kmvipin](https://talk.openmrs.org/u/kmvipin)\
**Replies:** 10\
**Last updated:** [January 29, 2026, 5:55pm UTC](https://talk.openmrs.org/t/org-dbunit-databaseunitruntimeexception-org-dbunit-dataset-nosuchcolumnexception-obs-status-non-uppercase-input-column-status-in-columnnametoindexes-cache-map/48153 "2026-01-29T17:55:48Z")

</div>

Hi everyone, I am trying to migrate the Obs class from Hibernate XML mapping to annotation-based mapping in openmrs-core (module 3). After making all the required changes, I am getting the following error when running:…

---

## [Set a Daemon token in modules context-sensitive tests](https://talk.openmrs.org/t/set-a-daemon-token-in-modules-context-sensitive-tests/32022)

<div class="topic-metadata">

**Author:** [@mksd](https://talk.openmrs.org/u/mksd)\
**Replies:** 13\
**Last updated:** [May 13, 2021, 6:03pm UTC](https://talk.openmrs.org/t/set-a-daemon-token-in-modules-context-sensitive-tests/32022 "2021-05-13T18:03:21Z")

</div>

@dkayiwa @ibacher @mseaton @wyclif, how do you guys setup a Daemon token for context-sensitive tests? I had to resort to reflection: @Before public void setup() throws Exception { Field field = ModuleFactory.class.…

---

## [Regression test dataset](https://talk.openmrs.org/t/regression-test-dataset/28867)

<div class="topic-metadata">

**Author:** [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Replies:** 33\
**Last updated:** [June 29, 2020, 12:27pm UTC](https://talk.openmrs.org/t/regression-test-dataset/28867 "2020-06-29T12:27:16Z")

</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.Jd…

---

## [Travis build failure TRUNK-5138](https://talk.openmrs.org/t/travis-build-failure-trunk-5138/29052)

<div class="topic-metadata">

**Author:** [@gracebish](https://talk.openmrs.org/u/gracebish)\
**Replies:** 3\
**Last updated:** [June 19, 2020, 6:53am UTC](https://talk.openmrs.org/t/travis-build-failure-trunk-5138/29052 "2020-06-19T06:53:48Z")

</div>

Please help me fix the above travis build failures @dkayiwa, @ibacher

---

## [Error when running unit test: Failed to load ApplicationContext](https://talk.openmrs.org/t/error-when-running-unit-test-failed-to-load-applicationcontext/28070)

<div class="topic-metadata">

**Author:** [@moshon](https://talk.openmrs.org/u/moshon)\
**Replies:** 4\
**Last updated:** [June 10, 2020, 11:49am UTC](https://talk.openmrs.org/t/error-when-running-unit-test-failed-to-load-applicationcontext/28070 "2020-06-10T11:49:39Z")

</div>

Hi, I am getting errors when running a basic unit test in a test class that extends the BaseModuleContextSensitiveTest class. Here’s the error log https://pastebin.com/uexJhwmj Here’e the code public class IsantePlusR…

---

## [Failing to run tests because of Conflicting Bean Definition Exception](https://talk.openmrs.org/t/failing-to-run-tests-because-of-conflicting-bean-definition-exception/17412)

<div class="topic-metadata">

**Author:** [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Replies:** 18\
**Last updated:** [April 10, 2020, 10:18am UTC](https://talk.openmrs.org/t/failing-to-run-tests-because-of-conflicting-bean-definition-exception/17412 "2020-04-10T10:18:37Z")

</div>

Heilo,i am running a test within the meta deploy module but i get exception below.I have tried to look for the beans as per the error but cannot find them.Any clue?? https://pastebin.com/DtVCvbPh

---

## [org.h2.jdbc.JdbcSQLException: Database is already closed when autowiring UiUtils in context sensitive test](https://talk.openmrs.org/t/org-h2-jdbc-jdbcsqlexception-database-is-already-closed-when-autowiring-uiutils-in-context-sensitive-test/10604)

<div class="topic-metadata">

**Author:** [@mksd](https://talk.openmrs.org/u/mksd)\
**Replies:** 11\
**Last updated:** [March 25, 2020, 3:30pm UTC](https://talk.openmrs.org/t/org-h2-jdbc-jdbcsqlexception-database-is-already-closed-when-autowiring-uiutils-in-context-sensitive-test/10604 "2020-03-25T15:30:54Z")

</div>

Hi @dkayiwa, In the Address Hierarchy module, as soon as I autowire UiUtils in AddressHierarchyAjaxControllerTest I get this ERROR - SchemaExport.execute(287) |2017-03-18 11:15:35,416| schema export unsuccessful or…

---

## [How to use MySQL to read xml dataset for integration test instead of H2 database](https://talk.openmrs.org/t/how-to-use-mysql-to-read-xml-dataset-for-integration-test-instead-of-h2-database/23488)

<div class="topic-metadata">

**Author:** [@cfaife](https://talk.openmrs.org/u/cfaife)\
**Replies:** 17\
**Last updated:** [February 28, 2020, 1:35pm UTC](https://talk.openmrs.org/t/how-to-use-mysql-to-read-xml-dataset-for-integration-test-instead-of-h2-database/23488 "2020-02-28T13:35:37Z")

</div>

Hi there, we are developing a reporting module that uses specific MySQL functions in queries. When we run the queries in H2 database for integration test it complains the syntax. I tried to replace the functi…

---

## [AppFrameworkServiceTest vs AppFrameworkServiceImplTest](https://talk.openmrs.org/t/appframeworkservicetest-vs-appframeworkserviceimpltest/25235)

<div class="topic-metadata">

**Author:** [@mksd](https://talk.openmrs.org/u/mksd)\
**Replies:** 2\
**Last updated:** [October 28, 2019, 5:17pm UTC](https://talk.openmrs.org/t/appframeworkservicetest-vs-appframeworkserviceimpltest/25235 "2019-10-28T17:17:04Z")

</div>

@dkayiwa @mogoodrich @wyclif, I have noticed that AF’s main service is tested through two context-sensitive test classes: AppFrameworkServiceTest AppFrameworkServiceImplTest I don’t see any fundamentally good reason f…

---

## [How to test public method of Service class not belonging to the interface](https://talk.openmrs.org/t/how-to-test-public-method-of-service-class-not-belonging-to-the-interface/24647)

<div class="topic-metadata">

**Author:** [@farndt](https://talk.openmrs.org/u/farndt)\
**Replies:** 3\
**Last updated:** [September 17, 2019, 9:03pm UTC](https://talk.openmrs.org/t/how-to-test-public-method-of-service-class-not-belonging-to-the-interface/24647 "2019-09-17T21:03:59Z")

</div>

The method public void triggerStateConversion(Patient patient, Concept trigger, Date dateConverted) in class org.openmrs.api.ProgramWorkflowService is a more complex method. Unfortunately it cannot be tested as a BaseCo…

---

## [Naming convention unit test](https://talk.openmrs.org/t/naming-convention-unit-test/24559)

<div class="topic-metadata">

**Author:** [@farndt](https://talk.openmrs.org/u/farndt)\
**Replies:** 4\
**Last updated:** [September 8, 2019, 8:05am UTC](https://talk.openmrs.org/t/naming-convention-unit-test/24559 "2019-09-08T08:05:39Z")

</div>

Am I correct in assuming that the current naming convention is (as in the OpenMRS template for Eclipse) @Test public void shouldSentence() {... Or is the picture in https://wiki.openmrs.org/display/docs/Developer+How…

---

## [Is this unit test too trivial?](https://talk.openmrs.org/t/is-this-unit-test-too-trivial/24544)

<div class="topic-metadata">

**Author:** [@farndt](https://talk.openmrs.org/u/farndt)\
**Replies:** 4\
**Last updated:** [September 1, 2019, 1:03pm UTC](https://talk.openmrs.org/t/is-this-unit-test-too-trivial/24544 "2019-09-01T13:03:36Z")

</div>

I would like to contribute and thought I start with something easy yet useful like unit tests. According to coverall WebUtil could do with some more tests but I’m wondering if they might be to trivial. There are one lin…

---

## [Core: enabling context-sensitive tests to start modules](https://talk.openmrs.org/t/core-enabling-context-sensitive-tests-to-start-modules/13098)

<div class="topic-metadata">

**Author:** [@mksd](https://talk.openmrs.org/u/mksd)\
**Replies:** 34\
**Last updated:** [January 31, 2019, 10:42am UTC](https://talk.openmrs.org/t/core-enabling-context-sensitive-tests-to-start-modules/13098 "2019-01-31T10:42:16Z")

</div>

Hi all, Would anyone have any objection to enrich BaseContextSensitiveTest for it to mock started modules? I just tried this locally and it worked well: public BaseContextSensitiveTest() { ... Context.setRunti…

---

## [rethink unit test style to remove duplication](https://talk.openmrs.org/t/rethink-unit-test-style-to-remove-duplication/10200)

<div class="topic-metadata">

**Author:** [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Replies:** 62\
**Last updated:** [January 29, 2019, 1:38pm UTC](https://talk.openmrs.org/t/rethink-unit-test-style-to-remove-duplication/10200 "2019-01-29T13:38:02Z")

</div>

Hi there! I was so getting used to the OpenMRS unit test style that I didnt see this until someone told me that we have duplication in our unit test style convention. In the class we want to test we write the @should…

---

## [Add support for Aspect-Oriented Programming (AOP) unit tests to the Core](https://talk.openmrs.org/t/add-support-for-aspect-oriented-programming-aop-unit-tests-to-the-core/19603)

<div class="topic-metadata">

**Author:** [@suthagar23](https://talk.openmrs.org/u/suthagar23)\
**Replies:** 12\
**Last updated:** [August 30, 2018, 2:00pm UTC](https://talk.openmrs.org/t/add-support-for-aspect-oriented-programming-aop-unit-tests-to-the-core/19603 "2018-08-30T14:00:07Z")

</div>

We have some base classes which are providing unit testing support from the core (eg : BaseModuleContextSensitiveTest). We can extend those classes into our modules, and can easily follow the unit tests requirements for …

---

## [Failed to load ApplicationContext](https://talk.openmrs.org/t/failed-to-load-applicationcontext/17395)

<div class="topic-metadata">

**Author:** [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Replies:** 9\
**Last updated:** [August 13, 2018, 1:27pm UTC](https://talk.openmrs.org/t/failed-to-load-applicationcontext/17395 "2018-08-13T13:27:02Z")

</div>

I am runing tests within metadasharing module under org.openmrs.module.metadatadeploy.handler.impl, but constantly getting this error as shown below in the logs.any clue?? java.lang.IllegalStateException: Failed to load…

---

## [Executing module schema changes for unit testing](https://talk.openmrs.org/t/executing-module-schema-changes-for-unit-testing/19330)

<div class="topic-metadata">

**Author:** [@owais.hussain](https://talk.openmrs.org/u/owais.hussain)\
**Replies:** 2\
**Last updated:** [August 13, 2018, 7:08am UTC](https://talk.openmrs.org/t/executing-module-schema-changes-for-unit-testing/19330 "2018-08-13T07:08:32Z")

</div>

Hi, While working on HFE REST module, we’ve (@piyush9620, @ivange94) encountered an issue. Here’s what we tried so far: The module extends HFE and uses REST module to restify HFE. In order to set up unit tests, we c…

---

## [REST web services clean checkout tests fail](https://talk.openmrs.org/t/rest-web-services-clean-checkout-tests-fail/19101)

<div class="topic-metadata">

**Author:** [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)\
**Replies:** 3\
**Last updated:** [July 24, 2018, 3:22pm UTC](https://talk.openmrs.org/t/rest-web-services-clean-checkout-tests-fail/19101 "2018-07-24T15:22:06Z")

</div>

With a clean checkout and “mvn clean install” of the of the REST web services module, the 2.2 OMOD tests fails with the following error. Is there a special profile one needs to set up to build this module? asRepresentat…

---

## [EMR-API BUILD test failure](https://talk.openmrs.org/t/emr-api-build-test-failure/18994)

<div class="topic-metadata">

**Author:** [@mozzy](https://talk.openmrs.org/u/mozzy)\
**Replies:** 13\
**Last updated:** [July 18, 2018, 4:25pm UTC](https://talk.openmrs.org/t/emr-api-build-test-failure/18994 "2018-07-18T16:25:51Z")

</div>

Error while running a test unit java.lang.AssertionError: expected:\<2\> but was:\<0\> at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.failNotEquals(Assert.java:834) at org.junit.Assert.assertEquals(Assert.java…

---

## [RegistrationCore mdule tests fail even in a fresh copy](https://talk.openmrs.org/t/registrationcore-mdule-tests-fail-even-in-a-fresh-copy/12833)

<div class="topic-metadata">

**Author:** [@nipun](https://talk.openmrs.org/u/nipun)\
**Replies:** 7\
**Last updated:** [July 6, 2018, 1:20pm UTC](https://talk.openmrs.org/t/registrationcore-mdule-tests-fail-even-in-a-fresh-copy/12833 "2018-07-06T13:20:22Z")

</div>

I've checked out the RegistrationCore module 1.7.1 ( RegistrationCore-1.7.1), But the module fails tests while building. It's a fresh copy and i haven't made any changes. But this only happens in my machine. When i try …

---

## [Failing to include BaseModuleContextSensitiveTest using maven dependency](https://talk.openmrs.org/t/failing-to-include-basemodulecontextsensitivetest-using-maven-dependency/17301)

<div class="topic-metadata">

**Author:** [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Replies:** 10\
**Last updated:** [May 10, 2018, 3:49pm UTC](https://talk.openmrs.org/t/failing-to-include-basemodulecontextsensitivetest-using-maven-dependency/17301 "2018-05-10T15:49:30Z")

</div>

i want to make tests in within my meta deploy module.But including the dependency that brings in BaseModuleContextSensitiveTest is failing.Any help ??My pom.xml from metata deploy -api looks as below 4.0.0 \<parent\> \<…

---

## [OrderSetService NoClassDefFoundError when running EmrConceptSearchControllerTest test cases](https://talk.openmrs.org/t/ordersetservice-noclassdeffounderror-when-running-emrconceptsearchcontrollertest-test-cases/17849)

<div class="topic-metadata">

**Author:** [@mrbioeng](https://talk.openmrs.org/u/mrbioeng)\
**Replies:** 2\
**Last updated:** [May 2, 2018, 7:46pm UTC](https://talk.openmrs.org/t/ordersetservice-noclassdeffounderror-when-running-emrconceptsearchcontrollertest-test-cases/17849 "2018-05-02T19:46:59Z")

</div>

Hello, when running the EmrConceptSearchControllerTest test cases at the emrapi omod module \[version1.25.0\] i get the following exception java.lang.NoClassDefFoundError: org/openmrs/api/OrderSetService at java.lang.Clas…

---

## [Testing tickets](https://talk.openmrs.org/t/testing-tickets/17501)

<div class="topic-metadata">

**Author:** [@jwnasambu](https://talk.openmrs.org/u/jwnasambu)\
**Replies:** 15\
**Last updated:** [April 22, 2018, 6:24am UTC](https://talk.openmrs.org/t/testing-tickets/17501 "2018-04-22T06:24:46Z")

</div>

Hello all, I kindly request for volunteers to help test this tickets RA 1176, RA1386, RA 807, RA1416, RA1405, and RA 1414 that are to be reflected in RefApp 2.8.0. Thanks cc @wyclif, @raff, @ssmusoke and @mogoodrich

---

## [Finding a testing task](https://talk.openmrs.org/t/finding-a-testing-task/17365)

<div class="topic-metadata">

**Author:** [@bmid98](https://talk.openmrs.org/u/bmid98)\
**Replies:** 9\
**Last updated:** [April 18, 2018, 3:47am UTC](https://talk.openmrs.org/t/finding-a-testing-task/17365 "2018-04-18T03:47:50Z")

</div>

Hi there, My team has been on the search for a ticket that has us add/modify test cases. We have not had any luck, as the tickets are usually taken or are old enough to be irrelevant. Is anyone able to point us in the r…

---

## [Ticket UICM-66 Example](https://talk.openmrs.org/t/ticket-uicm-66-example/17407)

<div class="topic-metadata">

**Author:** [@mahovsven](https://talk.openmrs.org/u/mahovsven)\
**Replies:** 3\
**Last updated:** [April 11, 2018, 11:04pm UTC](https://talk.openmrs.org/t/ticket-uicm-66-example/17407 "2018-04-11T23:04:05Z")

</div>

Hello, I am a part of the team working on Ticket UICM-66. I am fairly certain we have found the location of the bug, however, I am unsure if what we have found is a bug versus the bug. If anyone has an example applicati…

---

## [How to run UI Commons JavaScript tests](https://talk.openmrs.org/t/how-to-run-ui-commons-javascript-tests/17420)

<div class="topic-metadata">

**Author:** [@mahovsven](https://talk.openmrs.org/u/mahovsven)\
**Replies:** 2\
**Last updated:** [April 11, 2018, 12:20am UTC](https://talk.openmrs.org/t/how-to-run-ui-commons-javascript-tests/17420 "2018-04-11T00:20:37Z")

</div>

Hello. I need to make tests for the navigatorModels.js file in UI Commons here. How do you run these tests. There is no indication in the file, or any of the directories in the entire repository of how you would run Jav…

---

## [Help setting up tests for TRUNK-5307.](https://talk.openmrs.org/t/help-setting-up-tests-for-trunk-5307/17093)

<div class="topic-metadata">

**Author:** [@mahovsven](https://talk.openmrs.org/u/mahovsven)\
**Replies:** 2\
**Last updated:** [March 28, 2018, 12:58am UTC](https://talk.openmrs.org/t/help-setting-up-tests-for-trunk-5307/17093 "2018-03-28T00:58:46Z")

</div>

Hello, I am a member of a team working on TRUNK-5307. We have a problem which is blocking us from testing a part of the method we are testing. TLDR: If you know how to get a form’s EncounterTypes and set that up in the …

---

## [Extending BaseModuleContextSensitiveTest fails out of the box against Core 1.10.x](https://talk.openmrs.org/t/extending-basemodulecontextsensitivetest-fails-out-of-the-box-against-core-1-10-x/17094)

<div class="topic-metadata">

**Author:** [@mksd](https://talk.openmrs.org/u/mksd)\
**Replies:** 6\
**Last updated:** [March 23, 2018, 8:17pm UTC](https://talk.openmrs.org/t/extending-basemodulecontextsensitivetest-fails-out-of-the-box-against-core-1-10-x/17094 "2018-03-23T20:17:06Z")

</div>

@dkayiwa I wonder if you could have a look at this quickly. I stumbled upon this in Attachments and perhaps something is misconfigured somewhere… Look at this test in Attachments. It an API test (located in api/) and if…

---

## [CoreApps build failing when running mvn clean install](https://talk.openmrs.org/t/coreapps-build-failing-when-running-mvn-clean-install/16846)

<div class="topic-metadata">

**Author:** [@pluwum](https://talk.openmrs.org/u/pluwum)\
**Replies:** 1\
**Last updated:** [March 15, 2018, 5:28pm UTC](https://talk.openmrs.org/t/coreapps-build-failing-when-running-mvn-clean-install/16846 "2018-03-15T17:28:12Z")

</div>

Hello Everyone, I forked and cloned the latest version of the coreapps module, but on running mvn clean install on my local setup, the overall build fails because some tests are failing, however, the Travis badge on the…

---

## [Bahmni Core: how to run a single integration test with Maven?](https://talk.openmrs.org/t/bahmni-core-how-to-run-a-single-integration-test-with-maven/12043)

<div class="topic-metadata">

**Author:** [@mksd](https://talk.openmrs.org/u/mksd)\
**Replies:** 3\
**Last updated:** [January 29, 2018, 3:39pm UTC](https://talk.openmrs.org/t/bahmni-core-how-to-run-a-single-integration-test-with-maven/12043 "2018-01-29T15:39:56Z")

</div>

Hi Bahmni team, (Q1.) How do you do that in Bahmni Core? Sorry in advance if that's an obvious Maven question. Usually I would do this: mvn -Dtest=MyTestIT test But this doesn't actually launch the IT, nor does th…

[Next page](https://talk.openmrs.org/tag/unit-tests/268.md?match_all_tags=true&page=1&tags%5B%5D=unit-tests)
