use of org.apache.tomcat.util.buf.ByteChunk in project tomcat by apache.
the class TestValidator method testTldVersions25.
@Test
public void testTldVersions25() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-2.5");
// app dir is relative to server home
tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() + "/test/tld-versions.jsp");
String result = res.toString();
assertTrue(result.indexOf("<p>00-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'01-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>02-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'03-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>04-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'05-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>06-hello world</p>") > 0);
}
use of org.apache.tomcat.util.buf.ByteChunk in project tomcat by apache.
the class TestValidator method testTldVersions24.
@Test
public void testTldVersions24() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-2.4");
// app dir is relative to server home
tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() + "/test/tld-versions.jsp");
String result = res.toString();
assertTrue(result.indexOf("<p>00-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'01-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>02-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'03-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>04-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'05-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>06-hello world</p>") > 0);
}
use of org.apache.tomcat.util.buf.ByteChunk in project tomcat by apache.
the class TestValidator method testTldVersions40.
@Test
public void testTldVersions40() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-4.0");
// app dir is relative to server home
tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() + "/test/tld-versions.jsp");
String result = res.toString();
assertTrue(result.indexOf("<p>00-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'01-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>02-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'03-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>04-hello world</p>") > 0);
assertTrue(result.indexOf("<p>#{'05-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>06-hello world</p>") > 0);
}
use of org.apache.tomcat.util.buf.ByteChunk in project tomcat by apache.
the class TestValidator method testTldVersions23.
@Test
public void testTldVersions23() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-2.3");
// app dir is relative to server home
tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() + "/test/tld-versions.jsp");
String result = res.toString();
assertTrue(result.indexOf("<p>${'00-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>#{'01-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>${'02-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>#{'03-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>${'04-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>#{'05-hello world'}</p>") > 0);
assertTrue(result.indexOf("<p>${'06-hello world'}</p>") > 0);
}
use of org.apache.tomcat.util.buf.ByteChunk in project tomcat by apache.
the class TestJspContextWrapper method testELTagFileELContextListener.
@Test
public void testELTagFileELContextListener() throws Exception {
getTomcatInstanceTestWebapp(false, true);
ByteChunk out = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + "/test/bug5nnnn/bug58178c.jsp", out, null);
Assert.assertEquals(HttpServletResponse.SC_OK, rc);
String result = out.toString();
Assert.assertTrue(result, result.contains("JSP count: 1"));
Assert.assertTrue(result, result.contains("Tag count: 1"));
}
Aggregations