Community
Participate
Working Groups
The new mwe2 file generates a stub class for parsing tests, which is cool, since it provides a nice starting point. I would like to have other stub classes generated (by enabling the stubs in the mwe2 file) for testing other aspects: e.g., a stub for validator tests, a stub for compiler tests, a stub for formatting tests, and the same also in the ui.tests project: a stub for content assist test, a stub for outline tests, a stub for workbench test, etc... If someone else thinks it might be useful, I can start working on that.
I think some kind of one-off wizard would be better.
(In reply to Sven Efftinge from comment #1) > I think some kind of one-off wizard would be better. Do you mean that these stubs should be generated by the project wizard? In that case are you suggesting some options to check in the wizard dialog? I was suggesting mwe2 boolean options in the junit fragment in StandardLanguage because, this way, if new stub classes are contributed in the future you can enable them in existing projects. Or maybe generate some stub classes by default during the project wizard and allow for additional stub classes to be enabled later in the mwe2?
No, not the project wizard. I just wanted to say that reusing the generator for generating examples is not really nice, because the generator regenerates. For instance I usually name test classes differently then I will always get the class again. From the user perspective it seems a bit odd to - go into the generator configuration, - enable the generation of examples, - start the generator - go back into config and disable again. It's better than no examples at all, but not ideal. I would prefer another way to allow people to get example junit tests. Also some explanation would be helpful so maybe it's something for blogs/documentation?
I think the right place to provide such kind of example test cases are the example projects (Domain-Model Example, Home Automation Example, Simple Arithmetics Example, State-Machine Example) shipped with the Xtext framework. They already contain both JUnit and JUnit Plug-in test cases that are a good starting point to get some inspiration.