This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 675daacc5a998fb0326cdbbb342eb74503626ed1
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org