I want to answer that later, not enough time right now. Just on a quick notice, I did find a solution to my original question in this thread: http://forum.springsource.org/showth...on-render+test
To set a flowScope variable, e.g. to test a specific state without going through all the other states, do the following:
One of my problems while playing around had been that I getFlowScope() would return null. The trick is to call setCurrentState() before that.Code:setCurrentState("stateName"); //this configures the execution environment getFlowScope().put("varName", someObject); //set the variable
I'll be back later to answer you last post.
So, finally I found time to answer your last post.
I've thought about what you wrote and I agree. Still I find the current situation pretty annoying since every change to the flow not only requires a change to the tests but also an updated copy of the flow without the <var> declarations.
I don't really have an understanding of the internals of Webflow but maybe something like a test switch parameter to the <var> tag could be a solution. E.g.:
I'm not only sugesting this because I find it annoying to have a modified copy of the flow for the test but also because I found this setup do be error-prone: if I modify the flow, run the test but forgot to replace the test copy of the flow I will maybe discover any errors made later, once I do replace the test copy. But tracking a bug down at this point will be much more difficult since I was probably expecting problems in completely different area.Code:<var name="myClass" class="com.package.MyClass" mock="true" />
Sorry for keeping you waiting so long.