TransformFilter extends AbstractFilter implements ErrorListener { public void setParams( Map<String,Object> params) { transformParams_ = params; } TransformFilter();  TransformFilter( Source transform);  TransformFilter( InputStream transform);  TransformFilter( File transform);  TransformFilter( Source transform, Map<String,Object> params);  TransformFilter( InputStream transform, Map<String,Object> params);  TransformFilter( File transform, Map<String,Object> params); void setTransform( Source transform); void setParams( Map<String,Object> params); Map<String,Object> getParams(); void error( TransformerException exception); void fatalError( TransformerException exception); void warning( TransformerException exception); String toString();  }
@Test public void testWithParams() throws Exception { TransformFilter filter = new TestDefToJUnitFilter(); File target = File.createTempFile( "TestTransformFilter-WithParams-", ".java"); target.deleteOnExit(); filter.setTarget( target); HashMap<String,Object> params = new HashMap<String,Object>(); params.put( "throws", "true"); params.put( "class", "SUT"); filter.setParams( params); IOUtils.copy ( getClass().getResourceAsStream( "system-test-def-2.xml"), filter.getSource()); filter.getSource().close(); assertThat( "Output written", target.length() > 0, is( true)); String result = FileUtils.readFileToString( target); assertThat ( "System tested=SUT", contains( result, "Tests \\{@link SUT#Function-0 Function-0\\(\\)\\}"), is( true)); assertThat ( "Throws=Exception", contains( result, "public void Function-0_0\\(\\) throws Exception$"), is( true)); }