Author Message
AntBuild
Joined: Apr 15, 2020
Messages: 21
Offline
Hi,

I need to have a UNIT test case for OD module. Can you help me how can i add UNIT test case and test it in OD module ?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Typically a unit test case is for a piece of code such as a method in a Java class. I am not sure what you mean in terms of a OD module. Do you mean reusable module? A module in OD is basically a standalone app. You should test it in the simulation.
AntBuild
Joined: Apr 15, 2020
Messages: 21
Offline
I am working on a Gitlab pipeline script for automated deployment.
As part of this process, we run a code scan using SonarQuebe.
For this we need to submit coverage report after running UNIT test case.
I just need a code for test case / JUNIT test case make sure build is successful without any issue after creating WAR file i think assuming that is a valid test . May be something like test validity of "OD_Module/start" ?

Please let me know if you have any queries.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
I don't think that is how unit tests work. If you call the <module>/Start, you would run the application. In order to do that, you have to have the app deployed. When you run the app from the Start node, it depends on whether you run it from the voice browser or web browser and you get different results.
AntBuild
Joined: Apr 15, 2020
Messages: 21
Offline
So can you help me how can i do UNIT testing of OD module after creating WAR file OR with source code?
AntBuild
Joined: Apr 15, 2020
Messages: 21
Offline
This is exactly my situation in the post below

https://www.devconnectprogram.com/forums/posts/list/15/2772.page

But i dont understand how to use that , how to call and use it. Can you help me with this?

We also have target to achieve 70% of code coverage on our IVR projects.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
That is about creating a unit test for a particular servlet.
AntBuild
Joined: Apr 15, 2020
Messages: 21
Offline
Can you help me how can i add a generic UNIT test case for any OD module?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
First you need to figure out how to add a unit test case for any of the servlets in the module you want to test. This out of the scope of the forum.
Go to:   
Mobile view