Search in sources :

Example 1 with StandardELContext

use of jakarta.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(jakarta.servlet.jsp.TesterPageContext) ELContext(jakarta.el.ELContext) StandardELContext(jakarta.el.StandardELContext) ELResolver(jakarta.el.ELResolver) StandardELContext(jakarta.el.StandardELContext) Test(org.junit.Test)

Aggregations

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