OpenMRS resources: Difference between revisions

Content added Content deleted
imported>Hypotext
imported>Hypotext
Line 151: Line 151:


== Making Unit Tests ==
== Making Unit Tests ==
Once you've fixed the bug or added the new feature, you want to make sure that others don't break it. To do this, find existing tests in the code base that relate to your ticket. Modify existing tests so that they properly test for the new behavior. Then add any additional tests you find necessary to ensure that your changes are kept when future contributors start messing with the code. Once this is done, re-compile and re-test your changes to make sure everything works.
Once you've fixed the bug or added the new feature, you want to make sure that others don't break it. To do this, find existing tests in the code base that relate to your ticket. (We won't tell you exactly where to find them, but if you're stuck, you can refer to the TRUNK-3780 merged pull request.)

Modify existing tests so that they properly test for the new behavior. Then add any additional tests you find necessary to ensure that your changes are kept when future contributors start messing with the code. Once this is done, re-compile and re-test your changes to make sure everything works.


You can run tests by doing `mvn clean install` in the top-level openmrs-core directory. Check the output to see which tests fail and pass.
You can run tests by doing `mvn clean install` in the top-level openmrs-core directory. Check the output to see which tests fail and pass.