• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

How to test simple java method using StrutsTestCase

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have got a method in java file like this:
public boolean inserDB(String name, String Address){
// Gets the DB connection
// insers one record into Database and returns true/false
return boolean;
}
How can i write a test scrpt in StrutsTestCase?
We have got many similar methods, to perform all sorts of DB operations.
Now we need to write automated unit test cases. We thought of using StutsTestCase frame work.
Can any one help me.
Thanks,
Sripathi.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about separating the two "comments" into separate methods so that you can replace the JDBC Connection object for testing purposes?
Something like this:

and
 
Sree Reddy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much,
I will try to follow the same.
Bye,
Sree
reply
    Bookmark Topic Watch Topic
  • New Topic