Troubleshooting: generate test case Eclipse plugin for omod test cases

1 view
Skip to first unread message

Janet Riley

unread,
Jul 27, 2012, 6:23:28 PM7/27/12
to d...@openmrs.org
Jordan and I ran across a configuration issue last week.  Search.openmrs.org shows others have run into the same issue.  I'm posting the solution here so it's easier for the next person to find.

Symptoms:   We added a test folder and test cases to the omod, following the same conventions used in the api project.  When trying to run the Generate Test Case plugin, it gave an error of "the view that generated  the event is unknown".  We wrote a test class by hand.  "mvn test" gave an error, something about source directories. 

Solution: 
1) We recreated the omod src/test/java directory.  In Eclipse, in the Package Explorer area (the left column, by default),  right-click the YourModuleName-omod project. Select "build path", then "new source folder".  Create the src/test/java folder.  This will ensure the folder appears when you ....

2) Configure the Generate Test Case plugin.  In the Eclipse Package Explorer, right click the YourModuleName-omod project.  Select "Properties".  Find the Generate Test Cases  item and click on it.  In the configuration pane on the right,  set the source folder to src/main/java and test folder to src/test/java .  Save the changes.

Right-click on the java file to be tested and select Generate Test Cases.  You should be shown a dialog and a checklist of method names.

Janet  

Friedman, Roger (CDC/CGH/DGHA) (CTR)

unread,
Jul 30, 2012, 7:00:28 AM7/30/12
to d...@openmrs.org

Thanks, Janet

--
-- OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org
Unsubscribe: dev+uns...@openmrs.org
 
 

Filip Spiridonov

unread,
Jun 28, 2013, 6:41:44 AM6/28/13
to d...@openmrs.org
I have a similar error:

When I right click on the class and press "Generate Test Cases" an error popup appears that says: "the view that generated the event is unknown.."
I try to do it on the openmrs-api, not on the module. I also have configured source and test folders in the project properties.
My IDE is Eclipse-bases Spring Tool Suite.

Does anybody know the cause of this error? How to fix it? Or is there a source code of the plugin somewhere, so that I can investigate it deeper?

Thank you,
Filip
Reply all
Reply to author
Forward
0 new messages