Search in sources :

Example 1 with ParseException

use of org.apache.sling.repoinit.parser.impl.ParseException in project sling by apache.

the class ParsingErrorsTest method checkResult.

@Test
public void checkResult() throws ParseException, IOException {
    final StringReader r = new StringReader(input);
    boolean noException = false;
    try {
        new RepoInitParserImpl(r).parse();
        noException = true;
    } catch (Exception e) {
        assertEquals("for input " + input, expected, e.getClass());
    } catch (Error err) {
        assertEquals("for input " + input, expected, err.getClass());
    } finally {
        r.close();
    }
    if (noException && expected != null) {
        fail("Expected a " + expected.getSimpleName() + " for [" + input + "]");
    }
}
Also used : RepoInitParserImpl(org.apache.sling.repoinit.parser.impl.RepoInitParserImpl) StringReader(java.io.StringReader) IOException(java.io.IOException) ParseException(org.apache.sling.repoinit.parser.impl.ParseException) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 ParseException (org.apache.sling.repoinit.parser.impl.ParseException)1 RepoInitParserImpl (org.apache.sling.repoinit.parser.impl.RepoInitParserImpl)1 Test (org.junit.Test)1