• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Junit v&s Http Unit

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am facing a problem wherein the my test using HttpUnit are taking more time to complete than the JUnit Test cases.
I am using WebConversation to get the response for a request and then compare the request against a predefined text:
Response res = WebConverstaion.getResponse(request).

Where following code takes lesser time:
PostMethod pm = new PostMethod("http...")
HttpClient.execute(PostMethod).

Can anzbody help me in this regard. Any help will me in this regard.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what exactly is your problem? Can you accomplish what you need to do with the second (faster) approach?
 
Abhijit Sontakey
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The problem is i have used HttpUnit Testing to test the code.
Now it is taking more time compared to Junit. So i need to explain why HttpUnit is taking more time.Is it documented somewhere that HttpUnit is slower than Unit.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, HttpUnit actually does a lot more than just executing a post request. It parses the whole website; if it contains a frameset, it loads all subframes; if it contains javascript, it executes it as necessary etc. pp.

Take a look at its source code to see what happens behind the curtain - it's open source, after all!
reply
    Bookmark Topic Watch Topic
  • New Topic