You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/08/29 14:59:59 UTC

(camel-performance-tests) branch main updated: Added last group of missing tests

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

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git


The following commit(s) were added to refs/heads/main by this push:
     new 9beb635  Added last group of missing tests
9beb635 is described below

commit 9beb635b26902b58d7c4e82ffa2070d7fc086a98
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Aug 29 16:59:50 2024 +0200

    Added last group of missing tests
---
 .../org/apache/camel/itest/jmh/StringHelperTest.java    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/StringHelperTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/StringHelperTest.java
index cc9bc1a..772efb0 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/StringHelperTest.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/StringHelperTest.java
@@ -39,6 +39,9 @@ public class StringHelperTest {
 
     private String className = "java. lang. String";
 
+    private String betweenText = "Hello ${foo bar} how are you";
+
+
     @Test
     public void launchBenchmark() throws Exception {
         Options opt = new OptionsBuilder()
@@ -177,4 +180,18 @@ public class StringHelperTest {
         bh.consume(StringHelper.sanitize(sanitazableText));
     }
 
+    @Benchmark
+    @BenchmarkMode(Mode.AverageTime)
+    @OutputTimeUnit(TimeUnit.MICROSECONDS)
+    public void testBetweenNegative(Blackhole bh) {
+        bh.consume(StringHelper.between(betweenText, "'", "'"));
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.AverageTime)
+    @OutputTimeUnit(TimeUnit.MICROSECONDS)
+    public void testBetweenPositive(Blackhole bh) {
+        bh.consume(StringHelper.between(betweenText, "${", "}"));
+    }
+
 }