use of org.apache.catalina.core.StandardWrapper in project tomcat by apache.
the class TestMultipartConfig method testDefaultMultipartConfig.
@Test
public void testDefaultMultipartConfig() throws Exception {
MultipartDef multipartDef = new MultipartDef();
// Do not set any attributes on multipartDef: expect defaults
StandardWrapper servlet = config(multipartDef);
MultipartConfigElement mce = servlet.getMultipartConfigElement();
Assert.assertNotNull(mce);
Assert.assertEquals("", mce.getLocation());
Assert.assertEquals(-1, mce.getMaxFileSize());
Assert.assertEquals(-1, mce.getMaxRequestSize());
Assert.assertEquals(0, mce.getFileSizeThreshold());
}
use of org.apache.catalina.core.StandardWrapper in project tomcat by apache.
the class TestMultipartConfig method testPartialMultipartConfigMaxRequestSize.
@Test
public void testPartialMultipartConfigMaxRequestSize() throws Exception {
MultipartDef multipartDef = new MultipartDef();
multipartDef.setMaxRequestSize("10240");
StandardWrapper servlet = config(multipartDef);
MultipartConfigElement mce = servlet.getMultipartConfigElement();
Assert.assertNotNull(mce);
Assert.assertEquals("", mce.getLocation());
Assert.assertEquals(-1, mce.getMaxFileSize());
Assert.assertEquals(10240, mce.getMaxRequestSize());
Assert.assertEquals(0, mce.getFileSizeThreshold());
}
use of org.apache.catalina.core.StandardWrapper in project tomcat by apache.
the class TestMultipartConfig method testPartialMultipartConfigFileSizeThreshold.
@Test
public void testPartialMultipartConfigFileSizeThreshold() throws Exception {
MultipartDef multipartDef = new MultipartDef();
multipartDef.setFileSizeThreshold("24");
StandardWrapper servlet = config(multipartDef);
MultipartConfigElement mce = servlet.getMultipartConfigElement();
Assert.assertNotNull(mce);
Assert.assertEquals("", mce.getLocation());
Assert.assertEquals(-1, mce.getMaxFileSize());
Assert.assertEquals(-1, mce.getMaxRequestSize());
Assert.assertEquals(24, mce.getFileSizeThreshold());
}
use of org.apache.catalina.core.StandardWrapper in project tomcat by apache.
the class TestMapper method createWrapper.
private Wrapper createWrapper(String name) {
Wrapper wrapper = new StandardWrapper();
wrapper.setName(name);
return wrapper;
}
use of org.apache.catalina.core.StandardWrapper in project spring-boot by spring-projects.
the class TomcatServletWebServerFactoryTests method getJspServlet.
@Override
protected JspServlet getJspServlet() throws ServletException {
Tomcat tomcat = ((TomcatWebServer) this.webServer).getTomcat();
Container container = tomcat.getHost().findChildren()[0];
StandardWrapper standardWrapper = (StandardWrapper) container.findChild("jsp");
if (standardWrapper == null) {
return null;
}
standardWrapper.load();
return (JspServlet) standardWrapper.getServlet();
}
Aggregations