Examples of XMLUnitRuntimeException


Examples of org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException

    private static Document stripWhiteSpaceUsingXSLT(Document forDoc) {
        try {
            Transform whitespaceStripper = getStripWhitespaceTransform(forDoc);
            return whitespaceStripper.getResultDocument();
        } catch (TransformerException e) {
            throw new XMLUnitRuntimeException(e.getMessage(), e.getCause());
        }
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException

        }
        try {
            Transform commentStripper = XMLUnit.getStripCommentsTransform(orig);
            return commentStripper.getResultDocument();
        } catch (TransformerException e) {
            throw new XMLUnitRuntimeException(e.getMessage(), e.getCause());
        }
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException

     */
    private String getDefaultSystemId() {
        try {
            return PWD.toURL().toExternalForm();
        } catch (MalformedURLException e) {
            throw new XMLUnitRuntimeException("Unable to determine current "
                                              + "working directory!", e);
        }
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException

        throws XMLUnitRuntimeException {
        Schema schema = null;
        try {
            schema = parseSchema(null);
        } catch (SAXException e) {
            throw new XMLUnitRuntimeException("Schema is invalid", e);
        }

        final ArrayList l = new ArrayList();
        javax.xml.validation.Validator v = schema.newValidator();
        v.setErrorHandler(new CollectingErrorHandler(l));
        try {
            v.validate(instance);
        } catch (SAXException e) {
            // error should have been recorded in our ErrorHandler,
            // but better double-check.
            if (l.size() == 0) {
                l.add(e);
            }
        } catch (java.io.IOException i) {
            throw new XMLUnitRuntimeException("Error reading instance source",
                                              i);
        }
        return l;
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException

                if (XMLUnit.getControlEntityResolver() != null) {
                    s = XMLUnit.getControlEntityResolver()
                        .resolveEntity(publicId, systemId);
                }
            } catch (SAXException e) {
                throw new XMLUnitRuntimeException("failed to resolve entity: "
                                                  + publicId, e);
            } catch (IOException e) {
                // even if we wanted to re-throw IOException (which we
                // can't because of backwards compatibility) the mere
                // fact that DefaultHandler has stripped IOException
                // from EntityResolver's method's signature wouldn't
                // let us.
                throw new XMLUnitRuntimeException("failed to resolve entity: "
                                                  + publicId, e);
            }
            if (s != null) {
                return s;
            } else if (systemId != null) {
View Full Code Here

Examples of org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException

                    ? s.getBytes() : s.getBytes(encoding);
                for (int i = 0; i < b.length; i++) {
                    buf.append(b[i] & 0xFF);
                }
            } catch (java.io.UnsupportedEncodingException use) {
                throw new XMLUnitRuntimeException("Unsupported encoding", use);
            }
        }

        decl = new IntBufferReadable(buf);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.