This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release18.12 by this push:
new 16ed130367 Fixed: Test run was unsuccessful because of failing solr
tests (OFBIZ-12595)
16ed130367 is described below
commit 16ed1303670ae493760a78099b1deadcf3053001
Author: Jacques Le Roux <[email protected]>
AuthorDate: Wed Apr 13 14:24:26 2022 +0200
Fixed: Test run was unsuccessful because of failing solr tests (OFBIZ-12595)
The previous commit for OFBIZ-12594 was only working on Windows. On *nix OSs
there is no way to reliably get "--test" String from java.class.path
property.
Also the previous fix was brittle because relying only on 1 space separating
words.
This fix puts in the SolrDispatchFilter system property at the beginning of
the
4 Solr tests and removes it at end of them. That presence can reliably be
tested
in ControlFilter that is called before SolrDispatchFilter. It allows to
bypass
SecurityUtil::containsFreemarkerInterpolation that would else change the
parameters content type that must be application/x-www-form-urlencoded.
content
Thanks: Tom Pietsch for report and Mart Naum for confirmation
Conflicts handled by hand
---
.../src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git
a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java
b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java
index ad8b351cfe..5b991355b6 100644
---
a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java
+++
b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java
@@ -135,9 +135,7 @@ public class ControlFilter implements Filter {
offset = requestUri.length();
}
if
(!GenericValue.getStackTraceAsString().contains("ControlFilterTests")
- &&
!(System.getProperty("java.class.path").contains("--test component=solr") //
Allows Solr tests
- ||
System.getProperty("java.class.path").contains("ofbiz --test_ManifestJar.jar")
// Allows Solr tests in testIntegration
- ||
System.getProperty("java.class.path").contains("ofbiz.jar")) // Allows Solr
tests in testIntegration in 18.12
+ && null == System.getProperty("SolrDispatchFilter") //
Allows Solr tests
&&
SecurityUtil.containsFreemarkerInterpolation(httpRequest, httpResponse,
requestUri)) {
return;
}