Possible Duplicate:
junit test class for the following code
How can I write the junit test class for the following code,
package sample;
public class Fortest {
UserDao userdao = new UserDao(); Phone name = new Phone(); public String handleUser(User user) { String returncode="failed"; // User usr = new User("bob"); String username=user.getUsername(); String pass=user.getPass(); System.out.println("username and password : "+username+" : "+pass); String ph = name.getA(); System.out.println("ph "+ph); if(ph.equalsIgnoreCase("test")){ System.out.println("A "+ph); returncode="done"; } System.out.println("returning "+returncode); return returncode; // System.out.println("name "+name.toString()); // System.out.println(name.getA()); } }