com.google.caja.lexer.ParseException

Here are the examples of the java api class com.google.caja.lexer.ParseException taken from open source projects.

1. DomParserTest#testEofMessageDueToMismatchedQuotes()

Project: caja
File: DomParserTest.java
public final void testEofMessageDueToMismatchedQuotes() {
    ParseException pex = null;
    try {
        htmlFragment(fromString("<foo><bar baz='boo></bar></foo>"));
    } catch (ParseException ex) {
        pex = ex;
    }
    if (pex == null) {
        fail("Mismatched quote did not result in exception");
    } else {
        Message msg = pex.getCajaMessage();
        assertEquals(DomParserMessageType.UNCLOSED_TAG, msg.getMessageType());
        assertEquals("testEofMessageDueToMismatchedQuotes:1+6@6 - 10@10", msg.getMessageParts().get(0).toString());
    }
}

2. DomParserTest#testIssue1207()

Project: caja
File: DomParserTest.java
public final void testIssue1207() {
    ParseException pex = null;
    try {
        xmlFragment(fromString("<?xml ?><html><"));
    } catch (ParseException ex) {
        pex = ex;
    }
    assertNotNull(pex);
}