Package de.marcusschiesser.dbpendler.server.bahnwrapper.handler

Examples of de.marcusschiesser.dbpendler.server.bahnwrapper.handler.CommitValidationHandler


      commitParam += "&button.ticketbuchen_p=Ticket buchen";
    }
   
    String response = session.postMethod(commitURL, commitParam);
    InputStream inputStream = HTTPUtils.stringToStream(response);
    CommitValidationHandler commitHandler = new CommitValidationHandler();
    reader.setContentHandler(commitHandler);
    reader.parse(new InputSource(inputStream));
   
    return commitHandler.getCommitData();
  }
View Full Code Here


    "<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()));
    Assert.assertEquals("Wg. 4, Pl. 113, 1 Mitte, Abteil, 2. Kl.", commitHandler.getCommitData().getReservation());
  }
View Full Code Here

TOP

Related Classes of de.marcusschiesser.dbpendler.server.bahnwrapper.handler.CommitValidationHandler

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.