Create test cases for generation exceptions
Hey,
In my generation process I check different things, which can't be constrained before. In the error case I throw an exception. Is there any way to build wrong models in a sandbox, which expect an exception? Only if no exception is thrown an error should be reported.
Of course I know how to do things like this in Java, but I don't know how to catch an exception from the generation process.
Many thanks
Fabian
In my generation process I check different things, which can't be constrained before. In the error case I throw an exception. Is there any way to build wrong models in a sandbox, which expect an exception? Only if no exception is thrown an error should be reported.
Of course I know how to do things like this in Java, but I don't know how to catch an exception from the generation process.
Many thanks
Fabian
Please sign in to leave a comment.
http://confluence.jetbrains.net/display/MPSD2/Language+tests+language
But at the moment I've modified my structure so that I have a None-Typesystem-Rule, which calls some behavior methods. Is there any chance to bind an error to a node from within the behavior methods? At the moment I give it back to the rule, where I use the error command. But this is not very convenient.
See Generating MPS models from Ant
At the moment it would be easier to compare things as models. Isn't there any chance to get the output model, or even the transient models, in test aspects? I think this would be a helpful test feature.
error <message> -> <node>
statement, but I don't see any object which I can pass to the behavior methods. At the moment I return my error nodes to the caller of the methods, but this is really cumbersome. I guess there is a better way.