Monday, August 31, 2009

DDTUnit and Eclipse Snippets

One of the tedious aspects of using the excellent DDTUnit library is the creation of the Java class for the test case and the XML data sets. There is no nice Eclipse wizard to do that for you, but today I started to create a set of Eclipse snippets for it. My productivity went to the ditch for the first three hours, but it should pay off sometime between today and tomorrow.

I just select some complicated block of DDTUnit source code or XML on Eclipse, right-click it and choose "Add to snippets". I then replace some hard-coded values, such as the name of an input object, with a variable and save it.

Later, when I need a similar snippet, I just position the cursor where I need the new source code or XML, double-click the snippet from the toolbar, fill out any variables associated with the template (usually one or two) and goodbye round-trips to the DDTUnit reference guide.


The snippets library master:

No comments:

Post a Comment