This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit b1452985843bab06638feae953ba70059e193a44 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Sep 26 14:53:23 2024 +0100 Add further test case for BZ 69338 --- .../apache/el/parser/TestELParserPerformance.java | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/org/apache/el/parser/TestELParserPerformance.java b/test/org/apache/el/parser/TestELParserPerformance.java index 36b7853c58..7f56c7d224 100644 --- a/test/org/apache/el/parser/TestELParserPerformance.java +++ b/test/org/apache/el/parser/TestELParserPerformance.java @@ -141,4 +141,36 @@ public class TestELParserPerformance { } System.out.println(""); } + + + /* + * Ignored by default since this is an absolute test primarily for + * https://bz.apache.org/bugzilla/show_bug.cgi?id=69338 + */ + @Ignore + @Test + public void testAstNotEmpty() { + + ELManager manager = new ELManager(); + ELContext context = manager.getELContext(); + ExpressionFactory factory = ELManager.getExpressionFactory(); + + for (int j = 0; j < 5; j++) { + + String expression = "${not empty 'abc'}"; + + long start = System.nanoTime(); + + for (int i = 0; i < 10000000; i++) { + ValueExpression ve = factory.createValueExpression(context, expression, Boolean.class); + Boolean result = ve.getValue(context); + Assert.assertEquals(Boolean.TRUE, result); + } + + long duration = System.nanoTime() - start; + System.out.println("duration [" + duration + "]"); + + } + System.out.println(""); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org