Java Code Examples for org.apache.tomcat.util.buf.ByteChunk#toStringInternal()

The following examples show how to use org.apache.tomcat.util.buf.ByteChunk#toStringInternal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestGenerator.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
@Test
 public void testBug56529() throws Exception {
     Tomcat tomcat = getTomcatInstance();

     File appDir = new File("test/webapp-3.0");
     // app dir is relative to server home
     tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

     tomcat.start();

     ByteChunk bc = new ByteChunk();
     int rc = getUrl("http://localhost:" + getPort() +
             "/test/bug5nnnn/bug56529.jsp", bc, null);
     Assert.assertEquals(HttpServletResponse.SC_OK, rc);
     String response = bc.toStringInternal();
     Assert.assertTrue(response,
             response.contains("[1:attribute1: '', attribute2: '']"));
     Assert.assertTrue(response,
             response.contains("[2:attribute1: '', attribute2: '']"));
}
 
Example 2
Source File: TestGenerator.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
@Test
 public void testBug56529() throws Exception {
     Tomcat tomcat = getTomcatInstance();

     File appDir = new File("test/webapp-3.0");
     // app dir is relative to server home
     tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

     tomcat.start();

     ByteChunk bc = new ByteChunk();
     int rc = getUrl("http://localhost:" + getPort() +
             "/test/bug5nnnn/bug56529.jsp", bc, null);
     Assert.assertEquals(HttpServletResponse.SC_OK, rc);
     String response = bc.toStringInternal();
     Assert.assertTrue(response,
             response.contains("[1:attribute1: '', attribute2: '']"));
     Assert.assertTrue(response,
             response.contains("[2:attribute1: '', attribute2: '']"));
}
 
Example 3
Source File: TestGenerator.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
 public void testBug56529() throws Exception {
     getTomcatInstanceTestWebapp(false, true);

     ByteChunk bc = new ByteChunk();
     int rc = getUrl("http://localhost:" + getPort() +
             "/test/bug5nnnn/bug56529.jsp", bc, null);
     Assert.assertEquals(HttpServletResponse.SC_OK, rc);
     String response = bc.toStringInternal();
     Assert.assertTrue(response,
             response.contains("[1:attribute1: '', attribute2: '']"));
     Assert.assertTrue(response,
             response.contains("[2:attribute1: '', attribute2: '']"));
}