static void assertLineFails(String line, String message) {
        StringBuilder sb = createDefTemplate();
        sb.append(line).append("\n");
        Class<?> exceptionClass = DefParser.DefParserException.class;
        try {
            createParser(sb.toString()).parse();
            fail("Didn't find expected exception of type " + exceptionClass);
        } catch (Exception e) {
            assertExceptionAndMessage(e, exceptionClass,
                                      "Error when parsing line 2: " + line + "\n" + message);
        }
    }
Unit tests for DefParser.

@author hmusum
@author gjoranv
configgen/src/test/java/com/yahoo/config/codegen/DefParserTest.java