}
@Test
public void testTemplateSources() throws Exception {
try {
new Parser(PlainMatchTemplateTests.class, "/META-INF/services/java.nio.charset.spi.CharsetProvider", "ISO-8859-1");
Assert.fail();
} catch (RuntimeException ex) {
Assert.assertEquals("Cannot parse line:\n" +
" [java.nio.charset.spi.CharsetProvider:2] sun.nio.cs.ext.ExtendedCharsets", ex.getMessage());
}
String filename = "build/1.jmf";
new File("build").mkdirs();
FileOutputStream fos = new FileOutputStream(filename);
fos.write("ML X\r\n".getBytes());
new Parser(filename, "ISO-8859-1").parse("X\n", "ignored");
new Parser(null, "UnitTest", new BufferedReader(new StringReader("ML X\r\n"))).parse("X\n", "ignored");
try {
PlainMatchTemplateImpl.createTemplateImpl("nonsense", null, null, null, null);
} catch (IllegalArgumentException ex) {
Assert.assertEquals("Unsupported match template language!", ex.getMessage());
}