How to see effects of code change on the RefApp

Hi,

I am working on this ticket, I would like to know how to see the effects of the code change I made on the RefApp when I make changes on the required code. Any help with this? @herbert24 @ruhanga @samuel34 @dkayiwa

Hi @odorajonathan , It depends on the kind of changes you have introduced. If these are api changes, you possibly want to make unit tests for your changes and increase coverage.

If your changes are UI changes, you can manually build a new .OMOD file by running mvn clean install -Dmaven.test.skip=true. The .omod file can be found at legecayui/omod/target directory. From the system Administration page in the reffApp, you can update and existing module and then see your changes popup. You could also look at

1 Like

Thanks @samuel34 let me go through that link as well

its better to run mvn clean install without skipping any tests and then deploy the .omod

So what you are saying @herbert24 is that I should make unit tests for the changes then also run the mvn clean and deploy the .omod?

@odorajonathan , for specifically that ticket. You don’t even need to run the reference app. it would be an unnecessary resource wastage. just run the platform with only the legacy UI.

1 Like

@dkayiwa Every time I need to see changes I have to redeploy the module, any better way to notice these changes without having to redeploy the module

Which files are you changing?

All am changing is the code in the legacyui module under OptionsFormController.java

yes @odorajonathan, thats what you have to do when working with the legacy UI. aftr avery local change, you rebuild and redeploy the modue to visualise your changes.

it would only be possible when working with the UI framework , if you set on the debug mode, that’s wen you wouldn’t need to recompile and and re deploy the module.

Are you able to run OpenMRS from your IDE?

Not really, because it says selection cannot be launched when i try to run it on eclipse

Is there any wiki page you are following to try run OpenMRS from your IDE?

I am not following any but I guess it must definitely be this that I should

I see under Debug a web application with eclipse it says we should add the following command

-Xdebug

-Xnoagent

-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000

under the java command used to launch Tomcat, not sure where that goes

For the first pass, you do not have to do everything on that page. For instance, you can start by not running in debug mode. This will ensure that you can at least launch an instance of OpenMRS from your IDE.

I hope you mean debug perspective when you say debug mode, then I’ll have to run after I change the perspective to java browsing

For instance, you can start by not running in debug mode.

I have failed to disable debug mode and google searches show the debug perspective mostly, if debug mode, then it’s how to run programs in the debug mode in eclipse

From the eclipse pop up menu which comes up after right clicking on the openmrs-webapp project, select “Run As” instead of “Debug As”.