wood burning stoves 2.0*
The moose likes Testing and the fly likes Help needed In starting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Help needed In starting" Watch "Help needed In starting" New topic
Author

Help needed In starting

Rohan Deshmkh
Ranch Hand

Joined: Aug 31, 2012
Posts: 127
I just started with jWebUnit . I wanted to write a simple program to check if i installed everything correctly, so i wrote following code:



I have no idea if this is correct or not.Can you tell where i am wrong?I could not find a complete example to run in order to check if everything is set up correctly.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

Rohan,
There is an example in the quick start on the jwebunit site. I see two problems in yours:

  • 1) It isn't being run as a unit test. JWebUnit is intended to be run by JUnit not as a main method.
  • 2) You should add the @Before/@Test annotations rather than having prepare call your test. JWebUnit is assuming you are using standard junit (see item #1) and may not work if you call things directly.


  • [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
    Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
    Rohan Deshmkh
    Ranch Hand

    Joined: Aug 31, 2012
    Posts: 127
    Jeanne Boyarsky wrote:Rohan,
    There is an example in the quick start on the jwebunit site. I see two problems in yours:

  • 1) It isn't being run as a unit test. JWebUnit is intended to be run by JUnit not as a main method.
  • 2) You should add the @Before/@Test annotations rather than having prepare call your test. JWebUnit is assuming you are using standard junit (see item #1) and may not work if you call things directly.


  • ok, i will start learning about JUnit first , and then i will come back to this problem.
    Thanks for clarifying , also i wanted to ask one more thing , does httpUnit work the same way, also how do you learn these things from documentation itself as no other resources are available.
    Jeanne Boyarsky
    author & internet detective
    Marshal

    Joined: May 26, 2003
    Posts: 30789
        
    157

    Yes. HttpUnit is similar.

    I learn by reading the documentation. I don't know how to answer beyond that. JWebUnit has the quickstart. HttpUnit has a tutorial and cookbook.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Help needed In starting