import org.apache.cactus.*;
import javax.servlet.*;
import junit.framework.*;
import java.io.IOException;
 
public class TestSampleServlet extends ServletTestCase {
 
  SampleServlet myserlvet=new SampleServlet();
 
  public TestSampleServlet(String theName) {
        super(theName);
  }
 
  public void setUp(){
      try {
            myserlvet.init() ;
      }
      catch (ServletException ex) {
            ex.printStackTrace() ;
            this.fail() ;
      }
    }
 
    public void tearDown()  {
    }
 
    [color=red]public void beginGetUser(WebRequest theRequest)  {
        theRequest.addParameter("name", "hxm");
    }[/color]
    [color=red]public void testGetUser() throws IOException, ServletException {
        String result=myserlvet.getUser(request,response);
        assertEquals("hxm",result);
    }[/color]
    public static void main(String[] theArgs)
        {
            junit.textui.TestRunner.main(new String[]{
            TestSampleServlet.class.getName()});
        }
 
        public static Test suite()
        {
            return new TestSuite(TestSampleServlet.class);
        }
 
}  
