Search in sources :

Example 26 with LocatorImpl

use of org.xml.sax.helpers.LocatorImpl in project jPOS by jpos.

the class GenericValidatingPackagerTest method testGenericValidatorContentHandlerErrorThrowsSAXParseException.

@Test
public void testGenericValidatorContentHandlerErrorThrowsSAXParseException() throws Throwable {
    SAXParseException ex2 = new SAXParseException("testGenericValidatorContentHandlerParam1", new LocatorImpl());
    try {
        new GenericValidatingPackager().new GenericValidatorContentHandler().error(ex2);
        fail("Expected SAXParseException to be thrown");
    } catch (SAXParseException ex) {
        assertEquals("ex.getMessage()", "testGenericValidatorContentHandlerParam1", ex.getMessage());
        assertNull("ex.getPublicId()", ex.getPublicId());
        assertNull("ex.getSystemId()", ex.getSystemId());
        assertEquals("ex.getLineNumber()", 0, ex.getLineNumber());
        assertEquals("ex.getColumnNumber()", 0, ex.getColumnNumber());
        assertNull("ex.getException()", ex.getException());
    }
}
Also used : SAXParseException(org.xml.sax.SAXParseException) LocatorImpl(org.xml.sax.helpers.LocatorImpl) Test(org.junit.Test)

Aggregations

LocatorImpl (org.xml.sax.helpers.LocatorImpl)26 SAXParseException (org.xml.sax.SAXParseException)9 SAXException (org.xml.sax.SAXException)7 SchemaLocationFilter (com.sun.xml.bind.marshaller.SchemaLocationFilter)5 MarshalException (javax.xml.bind.MarshalException)5 IOException (java.io.IOException)3 URL (java.net.URL)3 URLConnection (java.net.URLConnection)3 DocumentImpl (org.apache.harmony.xml.dom.DocumentImpl)3 KXmlParser (org.kxml2.io.KXmlParser)3 DocumentType (org.w3c.dom.DocumentType)3 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)3 Test (org.junit.Test)2 Locator (org.xml.sax.Locator)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Properties (java.util.Properties)1 XMLEventReader (javax.xml.stream.XMLEventReader)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1