Package org.htmlparser.sax

Examples of org.htmlparser.sax.XMLReader


    "<div class=\"haupt\">\n" +
    "<div class=\"bold\">Auftrags-Nr.: ZDZLUE</div>\n\n" +
    "<div>Karlsruhe Hbf - Frankfurt(Main)Hbf<br /><span class=\"bold\">am 26.05.2011, ICE   78, ab 08:51</span><br /><span class=\"bold\">Wg. 4, Pl. 113, 1 Mitte, Abteil, 2. Kl.</span></div>" +
    "Gesamtpreis: 2,50 EUR" +
    "</div>";
    XMLReader reader = new org.htmlparser.sax.XMLReader();
    InputStream inputStream = HTTPUtils.stringToStream(testData);
    CommitValidationHandler commitHandler = new CommitValidationHandler();
    reader.setContentHandler(commitHandler);
    reader.parse(new InputSource(inputStream));
    Assert.assertEquals("ZDZLUE", commitHandler.getCommitData().getOrderNumber());
    Assert.assertEquals("Karlsruhe Hbf", commitHandler.getCommitData().getStart().getValue());
    Assert.assertEquals("Frankfurt(Main)Hbf", commitHandler.getCommitData().getDestination().getValue());
    Assert.assertEquals("26.05.2011", DateUtils.getDateFormat().format(commitHandler.getCommitData().getDate()));
    Assert.assertEquals("08:51", DateUtils.getTimeFormat().format(commitHandler.getCommitData().getTime()));
View Full Code Here

TOP

Related Classes of org.htmlparser.sax.XMLReader

Copyright © 2018 www.massapicom. 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.