Hello All,

I hava question. I want to test a simple JSP with cactus.
I wrote JSP Tester Class(see below), but sb.toString() return "null".

Is this correct beginOut() method? 


public class SampleJspTester extends JspTestCase {
    public SampleJspTester(String name) {
        super(name);
    }

    ....

     public void beginOut(ServletTestRequest theRequest) {
         theRequest.setURL("localhost:8080", null, "/test/test/test.jsp", 
                           null, null);
     }

     public void testOut() {

     }

     public void endOut(HttpURLConnection theConnection) throws IOException {
     
         StringBuffer sb = new StringBuffer();
         BufferdReader input = new BufferdReader(new InputStreamReader(theConnection
                                                                       
.getInputStream()));
         String str;
         while (null != ((str = input.readLine()))) {
             sb.append(str);
         }
         System.out.println(sb.toString());
         assert(sb.toString().indexOf("Hello !") > 0);
     }
}

---
Toru Suzuki     
MHI Aerospace Systems Corp.

Reply via email to