Conversation
this is the old default else branch, where implicitly is true.
pmouawad
left a comment
There was a problem hiding this comment.
Hello @FSchumacher ,
Thanks for this PR which will be a great addition to JMeter.
It looks clean to me, but I think we need to have a PatternCache otherwise we will degrade JMeter performance.
Also if we could centralize the Regex implementation selection through a factory it would avoid having the property spread in multiple classes.
Thanks again for you work
src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java
Show resolved
Hide resolved
|
Just wondering: does it replace all
What do you think if the property is something like |
$ find src -name "*.java" -exec grep -rl \.oro\. {} \;
src/components/src/main/java/org/apache/jmeter/visualizers/RenderAsRegexp.java
src/components/src/main/java/org/apache/jmeter/assertions/ResponseAssertion.java
src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java
src/components/src/main/java/org/apache/jmeter/assertions/jmespath/JMESPathAssertion.java
src/components/src/main/java/org/apache/jmeter/assertions/CompareAssertion.java
src/components/src/main/java/org/apache/jmeter/extractor/RegexExtractor.java
src/core/src/test/java/org/apache/jmeter/report/dashboard/ApdexPerTransactionTest.java
src/core/src/main/java/org/apache/jmeter/engine/util/ReplaceFunctionsWithStrings.java
src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java
src/core/src/main/java/org/apache/jmeter/save/CSVSaveService.java
src/core/src/main/java/org/apache/jmeter/report/dashboard/ReportGenerator.java
src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/util/accesslog/LogFilter.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/util/EncoderCache.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/parser/HtmlParsingUtils.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
src/functions/src/main/java/org/apache/jmeter/functions/RegexFunction.java
src/functions/src/main/java/org/apache/jmeter/functions/EscapeOroRegexpChars.javaI have started with the functions and assertions. The other stuff is less user visible, but would need to replaced, too.
For the bugfix, I concentrated on a feature flag to ease the transition from Oro to Java based. If we would like to be more flexible, the simplistic approach -- I took -- might not be the best and we should take more care to introduce a real abstraction instead of the if clauses. |
What I mean is primitive values, especially On the other hand, if the only values are |
I am not really against using a more flexible approach, but I will first try to finish the classes left :) Giving the users more choice, will let more room for misspellings, though :) |
The choice is the same: two possible values. |
|
The |
0269117 to
1a2aba2
Compare
Codecov Report
@@ Coverage Diff @@
## master #700 +/- ##
============================================
- Coverage 55.54% 55.25% -0.29%
- Complexity 10350 10374 +24
============================================
Files 1061 1061
Lines 65220 65666 +446
Branches 7433 7511 +78
============================================
+ Hits 36229 36287 +58
- Misses 26432 26798 +366
- Partials 2559 2581 +22
Continue to review full report at Codecov.
|
and use DOT_ALL to match new lines
Oro seems to count group(0) twice
Use a different approach to split the template and correct the difference between Java Regex groupCount() and Oro groups()
Oro seems to get along with the escaped braces, so use them for testing both implementations
Guard it for usage within a Regex
The Java Regex implementation sees an empty group at the end of a string, when matching against .*. So let us rephrase our wish to at least one character.
If a system property prefixed with jmeter.properties. is found, Gradle will now pass it as a system property without that prefix to the unit tests. That allows to set system properties (which might be used as jmeter properties) to the unit tests, without setting them in the JVM, that is used by Gradle.
pmouawad
left a comment
There was a problem hiding this comment.
Hello @FSchumacher ,
Thanks for this great PR.
I made another review.
Regards
src/core/src/main/java/org/apache/jmeter/report/dashboard/ReportGenerator.java
Outdated
Show resolved
Hide resolved
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Outdated
Show resolved
Hide resolved
...st/java/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
Show resolved
Hide resolved
src/core/src/main/java/org/apache/jmeter/save/CSVSaveService.java
Outdated
Show resolved
Hide resolved
...rotocol/http/src/main/java/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java
Outdated
Show resolved
Hide resolved
Make switch flag internally always a privatestatic final variable, as it might help the JIT compiler to remove dead code.
|
I think I am ready with this PR. The three things left above, are done, which were
Now, the question remains. Should we merge it before 5.5? |
|
I just noticed the PR was merged as 69 commits. It would be better to squash all of them in a single commit so the git history (and |
Description
Try to replace usage of Oro Regex implementation by Java Regex implementation. This is done by adding a property to let the user switch between the two. Default is to use the old Oro based one.
This is not finished. There are not all occurrences enhanced with the switch. A lot of it feels like a hack, as much code has been duplicated.
I thought about adding some interfaces to hide the Oro and Java Regex implementations behind, but currently I believe it would be overengineered. But maybe someone has a good idea to make this code less hacky.
Motivation and Context
The Oro library has been unmaintained for years and is feature-wise behind the built-in Java Regex implementation. To make a smooth transition from Oro to the Java built-in implementation the plan is to
Every step should be made with at least one release in between.
Discussed in Bug 57672 and Bug 65883
How Has This Been Tested?
Tests were run with the default setting (Oro Regex) and some manual tests with the setting
jmeter.use_java_regextotrue.Screenshots (if appropriate):
Types of changes
Checklist: