JUnit class again

public void test1()
{
  runTest("test_title");
}

public void test2()
{
  runTest("test_title_oops");
}

public void runTest(String testName)
{
  DOMResult resultsink = new DOMResult();
  Transformer tests = createTrans(loadSource("xslt_unit_test.xsl"));
  tests.setParameter("test-name", testName);
  tests.transform(loadSource("test_data.xml"), resultsink);

  ...
}
The code that does the real work is largely boilerplate.

We have the same number of test methods as there are tests in our definition. The test names are already specified in the test definition.

Possibly a bit of a problem with the XML source data and the XSLTunit stylesheet name. Let's assume we can solve that.

So most of this is starting to look like boilerplate ... rather mechanical. If only there were some way to generate the bits we need.

Well, blow me there is! XSLT!