Bug 492034 - Create stubs for several kinds of tests
Summary: Create stubs for several kinds of tests
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-19 13:43 EDT by Lorenzo Bettini CLA
Modified: 2019-04-25 04:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Bettini CLA 2016-04-19 13:43:00 EDT
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.
Comment 1 Sven Efftinge CLA 2016-04-19 15:03:40 EDT
I think some kind of one-off wizard would be better.
Comment 2 Lorenzo Bettini CLA 2016-04-19 15:21:49 EDT
(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?
Comment 3 Sven Efftinge CLA 2016-04-20 04:35:44 EDT
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?
Comment 4 Tamas Miklossy CLA 2019-04-25 04:18:39 EDT
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.