velocityProperties.setProperty("string.resource.loader.repository.name", "JUnitGenerator");
//create the velocity engine with an externalized resource template
final VelocityEngine ve = new VelocityEngine(velocityProperties);
//set our custom log adapter
ve.setProperty("runtime.log.logsystem", new LogAdapter());
//manage the repository and put our template in with a name
StringResourceRepository repository = new StringResourceRepositoryImpl();
repository.putStringResource(VIRTUAL_TEMPLATE_NAME, getTemplate(genCtx.getProject()));
ve.setApplicationAttribute("JUnitGenerator", repository);