During my current project, i encountered jWebUnit, a unittesting framework based on jUnit and HttpUnit. Old news for some, new for me.
Since we already had some posts on jUnit and HttpUnit, i thought this might be of interest.
An example of its conciseness (as found on the jWebUnit homepage):

Old code (jUnit & HttpUnit):

   public void testSearch() throws Exception {
      WebConversation wc = new WebConversation();
      WebResponse resp = wc.getResponse( "http://www.google.com");
      WebForm form = resp.getForms()[0];
      form.setParameter("q", "HttpUnit");
      WebRequest req = form.getRequest("btnG");
      resp = wc.getResponse(req);
      resp = resp.getLinkWith("HttpUnit").click();
      assertEquals(resp.getTitle(), "HttpUnit");
      assertNotNull(resp.getLinkWith("User's Manual"));

New code, using jWebUnit:

   public void setUp() {

   public void testSearch() {
      setFormElement("q", "httpunit");
      assertLinkPresentWithText("User's Manual");

For more information, see http://jwebunit.sourceforge.net/

Next Post

Table FUNctions: select a graph in SQL

You may seen some enthousiastic ramblings on Table Functions in earlier posts I have written. This is another one. With approximately 50 lines of code, you can select crude graphs for any query. For example, a graph that indicates the total salary sum for the three departments in the SCOTT […]
%d bloggers like this: