I was curious how the abstract BuildSupport class is working that does all those great things for e.g. the SwingBuilder and AntBuilder.
So I wrote the following Groovy Test that exposes its behaviour:
The SpoofBuilder is a sample instance of the abstract BuilderSupport class that does nothing but logging how it was called, returning 'x' for each node.
The test sections call the SpoofBuilder in various ways and the log reveals what methods were called during the "Build".
This test allowed me to verify my assumption on how the builder pattern works here. I used this knowledge to write a specialized AntBuilder forCanoo WebTest
. This "MacroStepBuilder" allows using the Canoo WebTest "steps" (that walk through a webapp for testing) from Groovy Code. Groovy has now become a first-class citizen in theCanoo WebTest Community
When writing the above test I stumbled over a few things, here are two of them:
What I especially appreciated:
keep up the good work!