Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325659 - Unit Testing for Code Generation
Summary: Unit Testing for Code Generation
Status: NEW
Alias: None
Product: AMP
Classification: Modeling
Component: AMF (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Miles Parker CLA
QA Contact: Miles Parker CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 17:38 EDT by Miles Parker CLA
Modified: 2010-09-17 17:41 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miles Parker CLA 2010-09-17 17:38:30 EDT
While this is marked as an enhancement it really is a critical gap in QA. Presently we don't have any automated unit testing coverage for code generation, which leads invariably to issues like bug 325628 when a change to some aspect of code generation breaks something somewhere else. Not having this support has meant that I've been very conservative about making changes to code generation capability.


Anyway to make this all work we need to be able to:

1. Load a model (in a project)
2. Cause model to generate (using builder or generate task)
3. Execute tasks against that model.

The annoying thing is that there *is* a good unit testing support harness written along with good coverage for base model generation. The basic problem is that in order to run the tests, you already need to have the classes built. But there is no way to actually launch it without manual steps because JUnit's design is completely unusable when it comes to dynamically loading classes. I've tried all sorts of clever ways to bootstrap the process with interfaces etc.. but it comes down to some really basic assumptions that JUnit makes about its environment.

I've investigate using TestNG, which is a much better testing framework but is not nearly as well supported by Eclipse and build infrastructure. 

Another possibility is to run this all through SWTBot, that is walk through all of the steps a user would take in building a model and then execute the pieces within that.
Comment 1 Miles Parker CLA 2010-09-17 17:41:12 EDT
Oh, needless to say, if you'd like to contribute to AMP, this is a task that would gain you undying gratitude!