This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit a501929e6aa3cfbd1789e67cbbe64ce534313d55
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 424a6fe27f..c5e8b5a3bc 100644
--- a/test/org/apache/el/parser/TestELParserPerformance.java
+++ b/test/org/apache/el/parser/TestELParserPerformance.java
@@ -142,4 +142,36 @@ public class TestELParserPerformance extends ELBaseTest {
         }
         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

Reply via email to