1 20 package org.apache.cactus.sample.servlet.unit; 21 22 import javax.servlet.ServletOutputStream ; 23 24 import org.apache.cactus.ServletTestCase; 25 26 35 public class TestClientServerSynchronization extends ServletTestCase 36 { 37 45 public void testLongProcess() throws Exception 46 { 47 ServletOutputStream os = response.getOutputStream(); 48 49 os.print("<html><head><Long Process></head><body>"); 50 os.flush(); 51 52 Thread.sleep(3000); 54 os.println("Some data</body></html>"); 55 } 56 57 59 65 public void testLotsOfData() throws Exception 66 { 67 ServletOutputStream os = response.getOutputStream(); 68 69 os.println("<html><head>Lots of Data</head><body>"); 70 os.flush(); 71 72 for (int i = 0; i < 5000; i++) 73 { 74 os.println("<p>Lots and lots of data here"); 75 } 76 77 os.println("</body></html>"); 78 } 79 } 80 | Popular Tags |