Search in sources :

Example 1 with StandardELContext

use of javax.el.StandardELContext in project tomcat by apache.

the class TestScopedAttributeELResolverPerformance method testGetValuePerformance.

/*
     * With the caching of NotFound responses this test takes ~20ms. Without the
     * caching it takes ~6s.
     */
@Test
public void testGetValuePerformance() throws Exception {
    ELContext context = new StandardELContext(ELManager.getExpressionFactory());
    context.putContext(JspContext.class, new TesterPageContext());
    ELResolver resolver = new ScopedAttributeELResolver();
    for (int i = 0; i < 100000; i++) {
        resolver.getValue(context, null, "unknown");
    }
}
Also used : TesterPageContext(javax.servlet.jsp.TesterPageContext) StandardELContext(javax.el.StandardELContext) ELContext(javax.el.ELContext) ELResolver(javax.el.ELResolver) StandardELContext(javax.el.StandardELContext) Test(org.junit.Test)

Aggregations

ELContext (javax.el.ELContext)1 ELResolver (javax.el.ELResolver)1 StandardELContext (javax.el.StandardELContext)1 TesterPageContext (javax.servlet.jsp.TesterPageContext)1 Test (org.junit.Test)1