@Test public void testInvalidRSS() throws Exception { this.validator.setDocument(getClass().getResourceAsStream("/rss-invalid.xml")); this.validator.validate(); assertEquals(1, this.validator.getErrors().size()); assertEquals("Invalid XML", this.validator.getErrors().get(0).getMessage()); }
@Override protected void validate(Document document) { try { SyndFeedInput input = new SyndFeedInput(); input.build(getDocument()); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (FeedException e) { if (e instanceof ParsingFeedException) { ParsingFeedException pfe = (ParsingFeedException) e; addError(Type.ERROR, pfe.getLineNumber(), pfe.getColumnNumber(), e.getMessage()); } else { addError(Type.ERROR, -1, -1, e.getMessage()); } } }
RSSValidator extends AbstractXMLValidator { @Override protected void validate(Document document) { try { SyndFeedInput input = new SyndFeedInput(); input.build(getDocument()); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (FeedException e) { if (e instanceof ParsingFeedException) { ParsingFeedException pfe = (ParsingFeedException) e; addError(Type.ERROR, pfe.getLineNumber(), pfe.getColumnNumber(), e.getMessage()); } else { addError(Type.ERROR, -1, -1, e.getMessage()); } } } }
RSSValidator extends AbstractXMLValidator { @Override protected void validate(Document document) { try { SyndFeedInput input = new SyndFeedInput(); input.build(getDocument()); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (FeedException e) { if (e instanceof ParsingFeedException) { ParsingFeedException pfe = (ParsingFeedException) e; addError(Type.ERROR, pfe.getLineNumber(), pfe.getColumnNumber(), e.getMessage()); } else { addError(Type.ERROR, -1, -1, e.getMessage()); } } }  }
RSSValidator extends AbstractXMLValidator { @Override protected void validate(Document document) { try { SyndFeedInput input = new SyndFeedInput(); input.build(getDocument()); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (FeedException e) { if (e instanceof ParsingFeedException) { ParsingFeedException pfe = (ParsingFeedException) e; addError(Type.ERROR, pfe.getLineNumber(), pfe.getColumnNumber(), e.getMessage()); } else { addError(Type.ERROR, -1, -1, e.getMessage()); } } }  @Override String getName(); }
RSSValidator extends AbstractXMLValidator { @Override protected void validate(Document document) { try { SyndFeedInput input = new SyndFeedInput(); input.build(getDocument()); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (FeedException e) { if (e instanceof ParsingFeedException) { ParsingFeedException pfe = (ParsingFeedException) e; addError(Type.ERROR, pfe.getLineNumber(), pfe.getColumnNumber(), e.getMessage()); } else { addError(Type.ERROR, -1, -1, e.getMessage()); } } }  @Override String getName();  }