protected void assertBeanValidatorFailsToCompile(
Class<? extends Validator> validatorClass, Class<?> beanType,
Class<? extends ValidationException> expectedException,
Pattern expectedMessage) throws UnableToCompleteException {
ValidatorGenerator generator = new ValidatorGenerator(cache, validGroups);
generator.generate(failOnErrorLogger, context,
validatorClass.getCanonicalName());
context.finish(failOnErrorLogger);
// Now create the validator that is going to fail
ValidatorGenerator specificGenerator = new ValidatorGenerator(cache, validGroups);
String beanHelperName = createBeanHelper(beanType);
assertUnableToComplete(expectedException, expectedMessage,
specificGenerator, beanHelperName);
}